Skip to main content
Visitor II
January 22, 2024
Question

Stlink v3 set IAR 8.50 error "Failed to load Flash loader"

  • January 22, 2024
  • 1 reply
  • 3218 views

I am currently working on a project that requires the use of IAT EWARM 8.50. When I compile this project for an STM32H745XI MCU and try to flash/debug I get the "Failed to load Flash loader" error. 

On the flash console I get this output:

C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\config\flashloader\ST\FlashSTM32H7x5.mac(169,34): Error: Operation error.

At that location (169,34) in the macro file I find:

DBGMCU_APB3FZ1 = __readMemory32(0xE00E1034, "AP2_Memory");

And column 34 is at the start of the first argument for __readMemory32. 

I have tried a few different settings while debugging and unchecking the 'override default .board file'

Also, This process works on the built in stlink v3 for the STM32H745 Nucleo board and for the STlinkv2. 

Has anyone seen this problem before?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    January 23, 2024

    Hello,

    Is that normal that you're using IAR EWARM 8.50, but the .mac file is pointing to the 8.4 version ?

    C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\config\flashloader\ST\FlashSTM32H7x5.mac

    Here is what I have in the 8.50 version at line 168/169:

    // Refresh counter to Reload value
    __writeMemory32(0xAAAA, 0x58004800, "Memory");

    Visitor II
    January 23, 2024

    @Mike_ST Thanks for the reply, that is a good point. When I installed EWARM the first time I selected an incorrect version for the code I am using (8.40). I then uninstalled and used the same folder for 8.50. 

    I'll go check our version of EWARM to see if it has the correct .mac. 

    This error occurs right after the 'execUserFlashInit()'  macro is called. It then calls a function related to disabling the watchdog. This is what I am seeing in that WD function:

    Porsche944_0-1706025214975.png
    The program faults on either 168 or 169 depending on where the line count starts.