cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 DFU-Mode

Stephan Scherer
Associate II
Posted on January 31, 2017 at 08:21

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

                ENDP

Sadly 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?

1 ACCEPTED SOLUTION

Accepted Solutions
Sean Park
ST Employee
Posted on January 31, 2017 at 08:42

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.

View solution in original post

2 REPLIES 2
Sean Park
ST Employee
Posted on January 31, 2017 at 08:42

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.

Stephan Scherer
Associate II
Posted on January 31, 2017 at 10:21

Thx Sean, it works.