2019-03-12 02:39 PM
Hi there, I´m using a NUCLEO-L4R5ZI evaluation kit, running STM32L4R5 mcu.
For simplicity I have implemented a very simple application that configures my LEDs, creates a few blinks and then it is supposed to jump to System Memory Bootloader.
The application runs fine, LEDs blink as expected and I think it makes the jump as well.
I notice that it turns on the user-LED3 on my board, which is when I think it enters the system memory bootloader... just guessing, though.
Then I´m trying to connect, using the STMFlashLoader Demo application, downloaded from here: https://www.st.com/en/development-tools/flasher-stm32.html#design-scroll
By reading AN2606 I have tried with USART1, USART2 and USART3, but without luck.
Can anyone tell, is this supposed to work out of the box, or would there be something to it, a tweak or two that is needed?
My jump to bootloader looks like this:
(code borrowed from here: https://github.com/akospasztor/stm32-bootloader)
typedef void (*pFunction)(void);
#define SYSMEM_ADDRESS (uint32_t) 0x1FFF0000
void Bootloader_JumpToSysMem(void)
{
uint32_t address = *(__IO uint32_t*)(SYSMEM_ADDRESS + 4);
pFunction Jump = (pFunction) address;
GPIO_DeInIt();
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__disable_irq();
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
__set_MSP(*(__IO uint32_t*)SYSMEM_ADDRESS);
Jump();
while(1);
}
Kind regards
Gestur
2019-03-12 03:42 PM
Nobody enables IRQs on the other side, turn OFF all your interrupt sources.
Not sure if the L4+ allows for this. Use a debugger and step into the ROM
2019-03-13 03:45 AM
Hi Clive, thanks for replying.
I´m using System Workbench from ST and debugging only gets me to the jump, then I don´t know what to expect.
I believe I´m turning off all my interrupt sources in the code above, but my application is only initializing the GPIOs, clocks and systick.
If my code above seems correct I was hoping if someone had played with this on an evaluation kit, similar to mine, and if there is anything specific I need to do.
/Gestur
2019-05-24 06:54 AM
Are you able to enter the system bootloader with BOOT0 pin asserted and able to write flash with the demonstrator from there?