STM32 DFU Programming
The time is currently 21:42 and I’ve been sitting in front of my computer in 2 hours to get the DFU programming to work.
Now it is working, and I’m able to make one of my excisting projects into a DFU loadable project (compiled it’s a .dfu filed)
I’ve also changed the DFU bootloader code to use GPIOA_0 as DFU Enable pin, and GPIOA_1 as USB Disconnect – this makes me able to use the GPIOB and GPIOC for my display without any interferrance!
Here is how you make a Ride7 project DFU loadable:
The Default Startup script (in settings) has been set to No, as we have included a special startup script in the project (startup_stm32f10x_hd.s – found in CMSIS\Core\CM3\startup\gcc)
Also change the Linker Script in project settings to match the processor group you are using (Connectivity, High Density… and so on – fx stm32f10x_hd_flash_offset.ld)
Also be aware of the change in the NVIC_Configuration – here we tell the processor that the Flash has to start at adress 0×3000
When you have compiled the code to a HEX file, run “DFU File Manager” to create a .dfu file.
Target ID: 00 is Internal Flash
Target ID: 01 is SPI Flash
Target ID: 02 is NOR Flash
Now you can use DfuSe to load the .dfu file into the internal flash of your STM32!
What is it exactly DFU? What is the different between DFU and normal hex or bin? Thanks.
DFU stands for Device Firmware Upgrade.
In a single DFU file there can be different hex files – fx. a hex file for the internal flash, one for the external and maybe one for the serial flash.
The smart thing is that all theese flashes are updated with a single file and a single update!