2017-01-30 11:21 PM
Hello,
I try to implement a bootloader via dfu mode.
In my applicationi write a magic value and perform a reset.
In the bootlaoder i read the magic value and try to jump to the system memory.
Therefore i try this:
Bootloader_Dev PROC
EXPORT Bootloader_Dev ; bootloader via USB device LDR R0, =0x40013800 ; SYSCFG_MEMRMP register laden LDR R2, [R0] LDR R1, =0x00000001 ORR R2, R1 LDR R0, =0x40013800 STR R2, [R0] LDR R0, =0x00000000 LDR SP,[R0, #0] LDR R0,[R0, #4] BX R0 ENDPSadly it didn't work. I have to switch off and on the power supply to enter the dfu mode.
Anyone know what I make wrong?
Solved! Go to Solution.
2017-01-30 11:42 PM
I shared the jump to user application using HAL base source..
// Jump IAP or System BOOT
HAL_RCC_DeInit();
HAL_DeInit(); __HAL_REMAPMEMORY_SYSTEMFLASH(); __set_MSP(*((uint32_t*) 0x00000000));// Application Interrupt and Reset Control :: resetting the peripherals, change the value to 0x05FA0001
{ #define SCB_AIRCR_VECTKEY_RESET (0x05FA0001) SCB->AIRCR = SCB_AIRCR_VECTKEY_RESET; }((void (*)(void)) *((uint32_t*) 0x00000004))();
while (1);Please refer to source.
2017-01-30 11:42 PM
I shared the jump to user application using HAL base source..
// Jump IAP or System BOOT
HAL_RCC_DeInit();
HAL_DeInit(); __HAL_REMAPMEMORY_SYSTEMFLASH(); __set_MSP(*((uint32_t*) 0x00000000));// Application Interrupt and Reset Control :: resetting the peripherals, change the value to 0x05FA0001
{ #define SCB_AIRCR_VECTKEY_RESET (0x05FA0001) SCB->AIRCR = SCB_AIRCR_VECTKEY_RESET; }((void (*)(void)) *((uint32_t*) 0x00000004))();
while (1);Please refer to source.
2017-01-31 01:21 AM
Thx Sean, it works.