Problem jumping into stm32l496 bootloader from application #36171
Unanswered
poreillyNewtrax
asked this question in
Q&A
Replies: 1 comment
-
@poreillyNewtrax Just found this article in 2023-05 !!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want my Zephyr (version 2.4) application running on a STM32L496 processor (on the Nucleo_L496ZG-P dev kit) to jump in the bootloader of the processor (running in ROM, at address 0x1FFF0000 of System memory (see https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf, table 137)).
Here is the source code of my application:
*void (SysMemBootJump)(void);
volatile uint32_t addr = 0x1FFF0000;
HAL_RCC_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__HAL_RCC_SYSCFG_CLK_ENABLE();
__disable_irq();
SCB->VTOR=0;
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
SysMemBootJump = (void ()(void)) (*((uint32_t )(addr + 4)));
__set_MSP((uint32_t )addr);
SysMemBootJump();
while(1);
When I call SysMemBootJump(), the processor freezes and I do not know where the program counter is at. If I run the same code, but compiled from the STM32Cube IDE, it works properly.
I use the zephyr SDK 0.11.3 to build my application.
I also use the "west" meta tool. My build command is the following:
west build -p auto -b nucleo_l496zg -s app
I think Zephyr is doing something in the initialization of the processor, that prevents running code from System memory, but I can not really find the source of the problem.
Has anyone seen this problem with the STM32L496 processor, or with any other processor of the MicroST family that supports an embedded bootloader ?
Thanks
Philippe O'Reilly
Beta Was this translation helpful? Give feedback.
All reactions