This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am running the boot_demo_usb project on a DK-TM4X129X board. The Device Manager shows the composite device appearing and disappearing as I plug/unplug the USB cable. But when I run Uniflash and click on "Display DFU devices" nothing shows up.
I also tried to follow the instructions in the source code comments about running dfuprog:
//! To illustrate runtime DFU capability, use the <tt>dfuprog</tt> tool which
//! is part of the Tiva Windows USB Examples package (SW-USB-win-xxxx.msi)
//! Assuming this package is installed in the default location, the
//! <tt>dfuprog</tt> executable can be found in the
//! <tt>C:/Program Files/Texas Instruments/Tiva/usb_examples</tt> or
//! <tt>C:/Program Files (x86)/Texas Instruments/Tiva/usb_examples</tt>
//! directory.
But after installing the USB examples package there is no dfuprog tool in the specified directory. There is only a usb bulk example program, which complains that it is unable to initalize a bulk device when I run it.
Any idea what might be going wrong? I have seen other comments on the board regarding problems with Uniflash, but I downloaded the latest version yesterday (3.3.0.00058).
Thanks, Amit. I guess I had not installed the SW-USB item before. The composite device is showing up now using dfuprog. But why does it not show up using the other flash loader programs? Will they only see a pure DFU device and not a composite one?
Also, I need to create a flash-based DFU bootloader. Is there already an example anywhere of that? None of the examples I have seen so far have that particular implementation. I know I can create one myself by hacking up one of the other examples, but if there is already one configured that way it would make life easier.
Thanks,
Dave
Hi, Amit,
Now that I finally got that USB library update issue resolved, I am back to trying to get a flash-based USB bootloader working. As you suggested, I found the boot_usb project in the TM4C123G example code, and changed the processor type in the General Options > Target to TM4C129XNCZAD. I also changed the defined symbols in C/C++ Compiler > Preprocessor to:
ewarm
PART_TM4C129XNCZAD
TARGET_IS_TM4C129_RA2
I did not see anything in the bl_config.h file that looked specific to the 123 chip, so I did not make any changes there. [UPDATE: I took a second look and updated the CRYSTAL_FREQ to 25000000, but that did not make a difference.]
The project built without any problems, but when I tried to run the program I had a couple of issues crop up.
First, when loading the program using the debugger I got a message saying “The stack plug-in failed to set a breakpoint on “main”. The Stack window will not be able to display stack contents.” After clicking OK, the program finished loading, but stopped inside HandleRequestDnloadSync() instead of main(). The code still seems to run, so I am not sure if that is a problem or not.
Second, however, is more disconcerting. When I run the program and plug in a USB cable, I get an “Unknown USB Device” error from Windows. I did check the project’s include file options, and they are pointing to the right folder! :-)
Is there something else I need to modify to get this example code working on my TMC129X board?
Thanks,
Dave
Hi, Amit,
I made the changes you noted, but the program still does not work. I found out that it is entering the FaultISR function in bl_startup_ewarm.S.
It sounds like you already have a TM4C129 version of the bootloader. Can you just post a zip file with that project so that I can try it out?
Thanks,
Dave
Hi, Amit,
Thanks. I don't have CCS, though, so that is not going to help me. However I did do a diff between your bl_config.h and mine, and they are identical.
I re-checked all of the project options, and there does not appear to be anything chip-specific that I have overlooked. I did change the target processor references in both the General Options > Target and C/C++ Compiler > Preprocessor tabs to specify the 129 chip.
The .icf file is in the bootloader folder -- as is the bl_startup_ewarm.S file -- so presumably those do not need to be customized for a particular processor.
I looked in the example code folder and found that the makefile had references to the 123 chip. So I changed the makefile to use
PART=TM4C129XNCZAD
CFLAGSgcc=-TARGET_IS_TM4C129_RA2
But after rebuilding, the code still does not work. It hits the same FaultISR as before. [EDIT: After thinking about it, this makefile is probably only used for building gcc projects, and so has no effect on my IAR build.]
So I am at a total loss as to why the example code does not run. Is there any chance you could try loading it to see if it runs on your system? I have attached a zip file that contains the project with the latest changes to bl_config.h and the makefile.
Thanks,
Dave
Hi, Amit,
Something really weird is going on with my system. When I first download, or when I click on the Reset button, I get an error: "The stack plug-in failed to set a breakpoint on "main". (I guess this is because there is no main() function in the bootloader.) Then the program halts at line 707 of bl_usb.c (line 30 of the code snippet below), which is inside the HandleRequests() function:
void HandleRequests(tUSBRequest *psUSBRequest) { // // This request is used by the host to determine whether the connected // device supports the TIVA protocol extensions to DFU (our // DFU_CMD_xxxx command headers passed alongside DNLOAD requests). We // check the parameters and, if they are as expected, we respond with // a 4 byte structure providing a marker and the protocol version // number. // if(psUSBRequest->bRequest == USBD_DFU_REQUEST_TIVA) { // // Check that the request parameters are all as expected. We are // using the wValue value merely as a way of making it less likely // that we respond to another vendor's device-specific request. // if((psUSBRequest->wLength == sizeof(tDFUQueryTIVAProtocol)) && (psUSBRequest->wValue == REQUEST_TIVA_VALUE)) { // // Acknowledge the original request. // USBDevEndpoint0DataAck(false); // // Send the status structure back to the host. // USBBLSendDataEP0((uint8_t *)&g_sDFUProtocol, sizeof(tDFUQueryTIVAProtocol)); } else
If I do a single-step, the code starts to run but does not break. If I manually break, the Disassembly window shows it stopped at some place in RAM (a DC32 instruction). However, if I set a breakpoint in the FaultISR, it breaks as soon as I do the single step. But AFSR, CFSR and HFSR are all 0, so I have no clue what fault might have occurred.
But it sounds like you are not having these issues, and are able to single-step through the code. I wonder what the difference is between your setup and mine?
Regards,
Dave
Hi, Amit,
I got pulled into another project this week, so I haven't been able to work on this lately. Did you find out anything useful when you tried running the TM4C123 project?
Thanks,
Dave