Jump to content

How to use USB DFU upload

Recommended Posts

Hi all,


Just a little sharing. I investigated on use USB ROM DFU bootloader to upload a program to a TivaC123 LP. To be honnest, I don't understand all the code as I copied it from e2ti forum, but it works.


So, how to proceed :


1) Modify hardware\lm4f\cores\lm4f\driverlib\sysctl.h


and add this include : #include <stdint.h>

If you don't add it, the compiler will not recognized type use in this file like "uint_32"


2) here is the code to use in energia :

#include "driverlib/sysctl.h"

void setup() {


HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;


ROM_SysCtlDelay(ROM_SysCtlClockGet() / 3);



void loop() {

Of course you can call the routine from where you want, for example on a press on a switch. But remember if you use other USB feature before, you have to deactivate them first.


3) Disconnect your LP from DEBUG USB port, connect it to DEVICE USB port, don't forget to change the switch position, normally a new usb device is detected called "Stellaris Device Firmware Upgrade". I did not need a driver (Windows 7) but maybe you will and I don't know where to find it, maybe in TivaCware package.


3) Use LM Flash programmer to upload your code : launch it, select "manual configuration" in the drop down list, in program go seek your .bin file (the .bin file is generated when you compile a code in energia, the place where you can find it is mentionned in the bottom of the IDE, something like that "C:\Users\Batto\AppData\Local\Temp\build7167311161671757574.tmp\Blink.cpp.bin" ), click "program", it's done !


Hope it will help


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...