cancel
Showing results for 
Search instead for 
Did you mean: 

Going to DFU mode programmatically STM303RE

Marius CO
Associate III

Hi,

I hav difficulties going to DFU mode programmatically. In the en.DM00070391.pdf

page 19, says

The embedded boot loader is located in the System memory, programmed by ST during

production

but does not specify the start address.

 I tried en.CD00167594.pdf @ page 292

3 Kbyte starting from address 0x1FFFEC00

contain the bootloader firmware, but as soon (*JumpDFU)(); I go a

HardFault_Handler () at ../Src/stm32f3xx_it.c:65

65   {

     uint32_t BOOT_LOADER_ADDR = ??????;  0x1FFFEC00  did not work
     tmp = BOOTLOADER_MAGIC_TOKEN; // set before reset at the end of RAM
    if (tmp == BOOTLOADER_MAGIC_TOKEN)
    {
		pFunction JumpDFU;
		uint32_t JumpAddress;
 
		JumpAddress = *(__IO uint32_t*) (BOOT_LOADER_ADDR + 4);
		JumpToApplication = (pFunction) JumpAddress;
		/* Initialize user application's Stack Pointer */
		__set_MSP(*(__IO uint32_t*) bsaddr);
		(*JumpDFU)(); //  ->>>>>>   void HardFault_Handler(void)
		while(1){blinkErr(); /* should never get here*/}
    }

1 REPLY 1

AN2606 suggests its 0x1FFFD800, but you can inspect the memory in the debugger, and look at the values you load before you jump to them.

Clearly you'd want the initial stack pointer to actually describe a RAM address (ie 0x20000000..0x2000FFFF or whatever the range is), so perhaps check for that, and an initial PC in the same 0x1FFF???? space, and ODD

https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..