cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Flashloader after applying the IAR patch to Support STM32G4 in IAR 8.22

Umesh_Kumar278
Associate

Moved from this thread (new question)

Hello,

I have installed the STM32G4 patch for IAR (from the STM32CubeG4 repository) on IAR Embedded Workbench 8.22.3. After applying the patch:

  • The STM32G431RB appears in the device selection list.
  • The project builds successfully.
  • However, flashing & debugging fail with the following error:
  •  

Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.22.3\arm\config\flashloader\ST\FlashSTM32G43xxB.flash
Error while calling macro execUserFlashInit

 

What I Have Tried:
Manually set Flash Loader to FlashSTM32G4xxx.flash instead of FlashSTM32G43xxB.flash.
Disabled "Verify Download" in IAR Debug settings.
Reduced SWD Speed to 1 MHz.
Replaced flashloader files from the patch.

Questions:
Which is the correct flashloader file for STM32G431RB?
Does the STM32G4 patch officially support IAR 8.22.3, or do I need IAR v9+?
Is there an updated STM32G4 flashloader for older IAR versions?
Any additional settings needed in IAR to make flashing work?

1 REPLY 1
Umesh_Kumar278
Associate

Hello, @SofLit  and all,

 

I am using IAR Embedded Workbench 8.22.3 and needed to add support for STM32G4 series (specifically STM32G431RB). Since this version of IAR did not originally support STM32G4, I followed the official patch installation process .

 

  • Steps Followed & Observations
    Downloaded & Installed Patch for IAR
    Downloaded STM32G4 patch from ST’s official GitHub:STM32CubeG4 Patch for EWARM
    Ran Install_Patch.bat as Administrator → Patch installed successfully.
    Restarted IAR → Now STM32G4 series appeared in the device list.
    Compiled Application Successfully
    Created a new project targeting STM32G431RB.
    Compilation completed successfully without errors.

 

  • Download & Debug Issue (Flashing Failure)

When trying to Download and Debug, the following error appeared in the IAR Debug Log:

Umesh_Kumar278_0-1739787223850.png

Umesh_Kumar278_2-1739787409451.png

 

Checked flash loader directory:

C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0 EWARM FS 8.22.3\arm\config\flashloader\ST\
 
and Found:
  • FlashSTM32G4xxx.flash
  • FlashSTM32G43xxB.flash
  • FlashSTM32G4xxx_OTP.flash

 Tried selecting different loaders but none worked.

  1. Questions is 
    Does IAR 8.22.3 fully support flashing STM32G431RB after applying the patch, or is a newer IAR version required?. 
  2. Are there any updated STM32G4 flash loaders (.flash files) from ST that work for STM32G431RB?
  3. Is there a way to manually modify an existing flash loader for STM32G431RB?
  4. Why is STM32CubeProgrammer missing an external loader for STM32G431RB?
  5. Has anyone successfully flashed STM32G431RB in IAR 8.22.3? If so, how?