2022-11-29 05:38 PM
Hi,
I am attempting to jump to system memory to be able to update the firmware via UART. Due to design constraints, BOOT0 pin will not an option for accessing the bootloader thus jumping to system memory within the application is needed.
I'm using the following code to jump to system memory:
__enable_irq();
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
const uint32_t p = (*((uint32_t*) 0x1FFF0000));
__set_MSP( p );
void (*SysMemBootJump)(void);
SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1FFF0004));
SysMemBootJump();
In AN2606 there is a note for MCUs that use the dual bank feature, I believe this is the part that is preventing the system from bootloading correctly. I jump to system memory in main() and using STM32CubeProgrammer attempt to connect via UART. However, it timeouts since there is no response from the ST chip.
I've tried this code both on my dev kit and custom hardware with the same result.
Is there a step that I am missing in order to correctly perform a UART DFU?
Thanks,
Tom
Solved! Go to Solution.
2022-12-08 12:30 AM
Hello @TJime.1 ,
Thanks for your feedback and welcome to STCommunity,
You can activate the bootloader by applying one of the patterns described in Table 2 in AN2606. In the case of STM32L475, check pattern 7.
Since BOOT0 is not an option for you, you can activate BFB2 Option byte and delete the flash memory (second option in pattern 7). No code is needed to jump to system memory if you decide to work with this.
I hope this helps !
If you need any further details, don't hesitate to ask me :smiling_face_with_smiling_eyes:
Sara.
2022-12-08 12:30 AM
Hello @TJime.1 ,
Thanks for your feedback and welcome to STCommunity,
You can activate the bootloader by applying one of the patterns described in Table 2 in AN2606. In the case of STM32L475, check pattern 7.
Since BOOT0 is not an option for you, you can activate BFB2 Option byte and delete the flash memory (second option in pattern 7). No code is needed to jump to system memory if you decide to work with this.
I hope this helps !
If you need any further details, don't hesitate to ask me :smiling_face_with_smiling_eyes:
Sara.