cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to enter main() of application ROM with IAR for STM32F446

septembeer
Associate II

Hi all, my goal is to design a user can bootloader with for STM32F446 with IAR system.

With the following process:

  1. A ready application code.
  2. design a bootloader code and output as .bin file
  3. In setting of application code, linker>input> choose bin file
  4. linker>config> choose a modified icf file with the following setting

0x8000000 ~ 0x8003FFFF to place bootloader ROM

0x8004000 ~ END for application parts

.5. also modify '#define VECT_TAB_OFFSET ' to 0x4000 in system_stm32f4xx.c

and when i run debug mode, it never stop at main(void) of app.

i also saw a message in Debug log window:

Thu Sep 09, 2021 19:11:58: Target reset 

Thu Sep 09, 2021 19:11:59: DMAC: HCLK and FCLK will not be disabled in SLEEP/STOP/STANDBY modes. 

did i miss some setting or need to modify source code?

2 REPLIES 2
TDK
Guru

Is your application code compiled such that it runs at 0x8004000? Need to change the linker script such that it does.

If you feel a post has answered your question, please click "Accept as Solution".

yes, in step 5, i set the vector to 0x4000.

I also check the hex file and it looks like correct with bootloader bin @0x8000000 to 0x8003ffff and app start from 0x80040000 to the end.

When i run debug mode, and then click break, it stops at the address of bootloader part.(different addr. if i click run and break again)

0693W00000DmkZUQAZ.png what i expect is stop at main() off add as below figure(example from internet)

0693W00000DmkZoQAJ.png