DIY Things on EHW

.

Friday, 5 February 2016

USB Programing of STM32 Controllers -Flashing/Reprogrming

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
USB DFU STM32L -Flashing/Reprogrming


2.Choose the first option (generate a DFU file)


USB DFU STM32L -Flashing/Reprogrming


3.On the following GUI, select “Multi BIN…”


USB DFU STM32L -Flashing/Reprogrming


4.Select the “…” to browse for the source file
USB DFU STM32L -Flashing/Reprogrming


5.Select the .bin file and select “save”. (the file will not be modified)


USB DFU STM32L -Flashing/Reprogrming


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”.


USB DFU STM32L -Flashing/Reprogrming


7. Finally, change the PID and version if required and select “Generate…” to generate the .dfu file.


USB DFU STM32L -Flashing/Reprogrming


8.Choose the destination folder and file name
USB DFU STM32L -Flashing/Reprogrming


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.


USB DFU STM32L -Flashing/Reprogrming


3. Select & Select  “Choose” in the “Upgrade or Verify Action” subsection to select the .dfu source file.


USB DFU STM32L -Flashing/Reprogrming


5. Select “Upgrade” to program the board.


USB DFU STM32L -Flashing/Reprogrming


6. Success!


USB DFU STM32L -Flashing/Reprogrming


So yea , you had flashed your device successfully.

0 comments:

Post a Comment

 

Copyright @ 2016 All About Hardware .

Blog by EHW