2018-04-11 06:22 AM
I am able to jump from User code into the built-in bootloader without any issues, I am also able to upload the new .bin file using the UART and ST FLASHER Demonstrator, however when I tick the Jump to user code option, I can see that I leave the bootloader however the user code does not start until the device is reset. After reading through the application notes I found a note mentioning 'The Jump to the application works only if the user application sets the vector table correctly to point to the application address.' Now in my code I have added the following line to the start of my code :
SCB->VTOR = FLASH_BASE | 0x0000; which I think sets the pointer to 0x080000000.
Or am I missing something?
2018-04-11 06:54 AM
Probably similar code in SystemInit()
The boot loader might enable the Watchdog, or you're crashing/failing in your code some where, perhaps making an assumption about reset conditions.
Would suggest adding some simple signs-of-life code in the front of Reset_Handler, to drive a GPIO or output character to USART.
2018-04-11 08:37 AM
Hello Wayne,
In addition to what Clive One said, make sure you initialize the vector table base address, before initializing any other peripherals that might cause in interrupt to fire.
-Frank
2018-04-12 02:57 AM
I think you are correct on SystemInit().
The bootloader does indeed enable the watchdog, however according to AN3155 the bootloader '• it initializes the registers of the peripherals used by the bootloader to their default reset values' The code works flawlessly after a reboot, and if uploaded via ST-Link, but with the way I code anything is possible.
I'm not really sure of how to add code ahead of the Reset_Handler, unless I edit the startup file?
I'm really quite stumped by this, as the device appears completely lifeless, like it is being pointed to an incorrect location by the bootloader.
2018-04-12 02:57 AM
HI Frank,
I will check on that but I'm fairly certain I am doing so.