USB debugging in STM32L/F Microcontrollers
In this post ,it is explained about how a STM32L controller can be programmed via USB .
NOTE: Binary/hex file is converted to .DFU format initially. this file is loaded via usb using DFUSE software.
Requirements:
- PC
- STM32L controller with usb connection
- DFUSE SOFTWARE
Generate a DFU file from a binary
The DFU tool requires a .dfu file in order to work. Here is how it is generated:
1. Start the Dfu file manager application
2.Choose the first option (generate a DFU file)
3.On the following GUI, select “Multi BIN…”
4.Select the “…” to browse for the source file
5.Select the .bin file and select “save”. (the file will not be modified)
6. On the following GUI, change the Address to 0x08000000, i.e. the STM32F411’s start address of the first sector of the internal flash, and add the file via “Add to list >>”, so that the file appears in the centre list and choose “OK”.
7. Finally, change the PID and version if required and select “Generate…” to generate the .dfu file.
8.Choose the destination folder and file name
9.Success
* Note: if you can’t find the file, look in the following folder:
C:\Users\(user name)\AppData\Local\VirtualStore\Windows\SysWOW64
Configure the the Board to load the STM32 DFU boot-loader
System Boot code will not execute automatically , BOOT0 pin has to be pulled High and Power ON Sequence / Reset Sequence has to be done for the execution.
1.Run the “DfuSe demonstration” application (Start -> All Programs ->
STMicroelectronics -> DfuSe -> DfuSe Demonstration).
2.Connect the Board via USB and verify that it is listed and selected as DFU device.
3. Select & Select “Choose” in the “Upgrade or Verify Action” subsection to select the .dfu source file.
5. Select “Upgrade” to program the board.
6. Success!
So yea , you had flashed your device successfully.
0 comments:
Post a Comment