2021-08-31 05:58 AM
Hi there. I am developing a bootloader application in IAR EWARM environment on my STM32f415 card. I'm having trouble uploading it to my stm32 card when I want to debug the bootloader code.Bootloader code starts from 0x08000000 and application code starts from 0x08040000. However, when I want to debug the bootloader code via IAR, I get the error "Warning: Stack pointer is setup to incorrect alignment. Stack addr=0xFFFFFFFF". There is no problem in Debugger and Linker settings. How can I debug the STM32 board? Does anyone have a solution suggestion for this problem?
Thanks.
Best regards.
2021-08-31 09:29 PM
Well, 0xFFFFFFFF is certainly an invalid stack pointer. The MSP should be set immediately at the start of your bootloader (in the startup file, not in main.c), and again at the start of your main program.
Verify that a valid end of stack pointer is in the flash at 0x08000000 and 0x08040000.
2021-08-31 11:33 PM
Thank you for your answer. I couldn't find how to set the address of the stack pointer. The contents of my startup file are as follows:
The starting address is defined as 0x08000000 in the .map file.
VEC_TAB_OFFSET value is defined as 0x00000000 in the system file.
I don't know where I made a mistake. I will be glad if you help.
Thanks .
Best regards.