Showing results for 
Search instead for 
Did you mean: 

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


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?

ST Employee


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");

@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:

The program faults on either 168 or 169 depending on where the line count starts.