I'm writing C code, with Rowley CrossStudio 5.3.0, for a board with an STM32F401, that "do things" after receiving commands incoming from a RS485 line. The board has a bootloader code at address 0x0800000 and when a "jump-to-boot" command comes, the main-code execute a "NVIC_SystemReset()", and the bootloader code takes control of the board. The main-code starts at 0x08008000, and the boot-code, at the end of firmware upload, jumps at main code, with a function I found online, an assembler code. Now the issue: one of the commands that main-code could receive, is a "reset" that restarts the main code, from address 0x08008000, with re-initialization of some variabiles to their default, inactivation of some external hardware, etc.
In STM32_Startup.s there's a "reset_handler" label, and I use a "goto *(&reset_handler)" instruction for this restart.
I defined as "extern unsigned int reset_handler" the label, so I can use the absolute address of reset_handler label.
The "goto" works, the code restarts, the compiler (gcc) doesn't show any error but the corrector on-the-text, shows an error, as in image:
IMAGE OF ERROR
"Indirect goto in function with no address-of-label expressions"
Why?
&&label, wherelabelis an actual label, not anintvalue.