B@tto 51 Posted August 27, 2016 Share Posted August 27, 2016 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() { ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); ROM_GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_5 | GPIO_PIN_4); ROM_IntMasterDisable(); ROM_SysTickIntDisable(); ROM_SysTickDisable(); HWREG(NVIC_DIS0) = 0xffffffff; HWREG(NVIC_DIS1) = 0xffffffff; ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_USB0); ROM_SysCtlUSBPLLEnable(); ROM_SysCtlDelay(ROM_SysCtlClockGet() / 3); ROM_IntMasterEnable(); ROM_UpdateUSB(0); } 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.