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.

TMS320F28377D: 28377D USB Bootloader

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Dear team,

One of my customers is developing USB Bootloader program. By far they are testing the example code in Control Suite locates in "C:\ti\controlSUITE\device_support\~Utilities\usb_flash_programmer".

According to the “f28027Xd_fw_upgrade_example.txt”  we have:

1) Boot the F2837xD in USB Boot Mode (see contents.txt, "Starting the MCU")
2) Connect USB from Host PC to F2837xD.
3) From the Host command line:
        usb_flash_programmer.exe  F2837xD_usb_flash_kernels_cpu01.dat  blinky_cpu01.dat

Referring “Context.txt”  we have:

Starting the MCU:
Reset the MCU, then write 0x0C5A to the boot mode select address (0xD00) with the debugger.
Run from the reset vector to start the USB boot loader. Connect the MCU to the PC.

So, they connected the MCU, loaded "F2837xD_usb_flash_kernels_cpu01"and wite 0x05CA to 0XD00. Then CPU Rest->Restart->Run.

Next, connect the MCU to PC with USB, an unknown device can be found:

Try to run "usb_flash_programmer.exe -l", an error occurs:

Questions:

1)Did they follow the correct procedure to perform the example code? How to correctly "Run from the reset vector to start the USB boot loader" ?

2)Is the same to write 0XD00 via Memory Browser and operate Emukey and EmuBMode? I believe it should be same.

3)Is it possible to load the USB driver on PC without plug in or out the USB cable?

  • The above post is the question from my customer. Here is some of my ideas:
    1) I believe it is not necessary to load the any code when "Boot the F2837xD in USB Boot Mode " is that correct?
    2) After writing to 0xD00, is any configuration needed in CCS before reset? After the reset, what value should be in PC?
    3) On a 28379D launchpad, is it needed to config any jumpers to activate the USB ?

    Thanks a lot!
  • Hi Weiqi,

    Lots of questions... I will try to respond appropriately.

    1) it looks like the correct pocedure was followed.

    2) Yes, write 0x0C5A to 0xD00 memory address.

    3) I am not sure this question makes sense.

    4) The ROM includes a USB bootloader.

    5) Writing to 0xD00 will cause the device to boot to the USB boot loader mode on the reset.

    6) No.

    Please use these updated drivers attached.

    Regards,

    sal

    windows_driver.zip

  • Hi, Sal.

    I try to update the windows driver attached above, but it makes no difference! There still exists as "Unknown Device". My PC is win7 64 bit system. I also refferencing the approach ,but invalid.I debug the "F2837xD_usb_flash_kernels" example, Run in Ram, when connect the USB cable to PC, the Debuger halt in the "UsbIntHandler" if insert a breakpoint here. It seems that the USB PIN is configured right, but the Usb Windows Driver goes wrong.

    I tried more, and configure the example "F2837xD_usb_flash_kernels" running in Flash. It  results here:

    I update its driver using the zip files above, then the device appears as  "F28x7x USB Boot Loader"  in Device Manager. Configure Right!

    But the  phenomenon confuse me that "unKnown Device" is still identified in USB Boot Mode (Write 0x0C5A to Address 0xD00) .

    More detail about the Question 2: When Debugging in CCSV7, the EmuKey is addressed at 0xD00 and the EmuBMode is addressed at 0xD01; Writing 0x 0C5A to 0xD00 will change the EmuKey to 0x0C5A, but the EmuBMode did not change.Can u explain this?

    Then I execute  "usb_flash_programmer.exe  F2837xD_usb_flash_kernels_cpu01.dat  blinky_cpu01.dat" in  command line, error occurs:

    Other Problem: how can I run the F021_Flash_API in Ram?

    I modified the Cmd files, inserts:

    FLASH_API:
    {
          -l F021_API_F2837xD_FPU32.lib//(.text)
    }LOAD = FLASHA, RUN = RAMGS0,
    LOAD_START(_F021_API_LoadStart),
    RUN_START(_F021_API_RunStart),
    SIZE(_F021_API_RunSize),
    PAGE = 0,ALIGN(4)

    but  the program run to ILLEGAL ISR when execute Init_Flash_Sectors function in "F2837xD_usb_flash_kernels" project.

    Is this configure right for Flash API run in Ram, and How to configure when it's wrong?

    Thanks.

  • "F28x7x USB Boot Loader" is the proper device driver. If it shows up in device manager, then that is good.

    I don't know what your question is about the EMU boot key and boot mode. It appears you are doing it properly and that is why the bootloader is running and connecting to the PC.

    i don't understand your flash API questions.

    When using the F2837x USB bootloader, make sure you are using REV C silicon. There was a bug fix in the ROM for the USB bootloader. The bug exists in early versions of the silicon.

    Please use the latest controlCARD.

    Regards,
    sal
  • Hello, Sal.

    The "F28x7x USB Boot Loader" only shows up when I run the "F2837xD_usb_flash_kernels_cpu01" example in Flash(Entry Point: 0x80000), and "Unknown Device " as I force the MCU to run from usb boot loader by writing 0x0C5A to 0xD00 with Emulator, Reset MCU and Start. I verify the MCU(TMS320 F28377DZWTT YFC_65C13ZW) is REV C silicon.So what's the problem with the USB BootLoader in ROM and the windows driver.

     The "F2837xD_usb_flash_kernels_cpu01" program goes into  "ILLEGAL ISR" when it run into "InitFlash()" Function. What can I do to deal with the Exception?

    Flash API Question: Can I load the F021_API_F2837xD_FPU32.lib from FlashA and run at RAM, and how ?

    The Cmd File is modified  as shown above. Is it configured properly, and how to configure when something wrong?

    Thanks.

  • Hi,

    The kernel is meant to run from RAM. I am not sure what is the issue with the boot loader. We have not experienced any issues like this. Once you install the driver properly with the boot loader running, it should show up as USB Boot Loader.

    The kernel is linked to run from RAM.

    In your flash application, you can place the Flash API, but when you execute it, you must execute it from RAM after copying it to RAM.

    Hope this helps,
    sal
  • Dear Sal and Yang,

    I verified the USB boot mode with the latest driver you provided.

    On my own computer, the computer cannot recognize the USB after I reset the MCU.  Even a unknown device did not appear.

    However, on my colleagues computer, the USB boot can work successfully.

    I am quite sure we followed the same procedure and we are using the same computer provided by TI(Win10 64 bit).

    Could you please tell how I can enable the USB on my computer? And maybe Yang could try to use another computer.

  • Dear Wang,

    I have tried the same procedure both on office computer and my own Notebook. It all shows up the "unknown device" in the Device Manager. The system of them is Win7 64bit. I have also tried in another win8 64bit notebook, No difference. May be I should try more.

    Thanks.

  • Hi,

    The updated driver support Windows 7, 8 and 10.

    I am not sure what the issue could be. Are you both using control Cards? or custom boards? The device should be showing up in the device manager if the USB connector and schematic portions are correct.

    We have been able to certify the control CARD so that schematic is correct and functional according to the standard.

    Regards,
    sal
  • I test it in my own Product control Board,so that may be the problem.There exists a Anti-surge chip(NUF2221W1T2G, as an AttachmentNUF2221W1T2G.pdf) between the controller and the connector.Refer to the figure below, the Resistence(Rs) is 22 Ohm,  Can the MCU work well in this design.If you need more details  to make a judgement, please Inform me, and  I  will provide the information as soon as possible if accessible.

    Thanks.

  • I am not familiar with this type of surge protector. But I suggest this may be the issue.

    Please review the schematic of the cCard for f28x7x. This should help you.

    Regards,
    sal
  • Dear Wang and Sal,

    I get an access to have the MCU configured  as F28x7x USB Boot Loader now, it works well.Thanks a lot.

    But  when I customize the USB Boot Loader for my own project,  some other exceptions occured as I list below.

    First, when I added another Usb loaderEndpointDescriptor, insert the code:

    const sUsbEndPointDescriptor loaderEndpointDescriptor1 =
    {
       USB_DTYPE_ENDPOINT<<8 | (2*sizeof(sUsbEndpointDescriptor)-1),
       {
          1,0,1 //Endpoint1, in type
          2,0,0,0 //bulk mode transfers
        }
        64,
        0
    }

    Those code works well as My Computer identify the Bulk in EP1 and Bulk out EP1.I send data from MCU to PC using the code:

    //Transmit data from USB endpoint 1
    void TxDataEp1(const Uint16 *data, Uint16 length8, eDataEnd dataEnd)
    {
    	Uint16 c;
    	// Enables the endpoint1 direction as TX
    	//Write the data to the FIFO
    	for (c = 0; c < length8; c++)
    	{
    		USBREG8(USB_O_FIFO1) = __byte((int *)data, c);
    	}
    
    	//Kick off the transmission. If there's no more data, set the end bit.
    	USBREG8(USB_O_TXCSRL1) = (dataEnd == USB_END_DATA) ? (USB_TXCSRL1_TXRDY | USB_TXCSRL1_SETUP) : USB_TXCSRL1_TXRDY;
    	// Enables the endpoint1 direction as RX
    
    }

    But when I Read usb Pipe using "winusb driver lib",  it returns nothing. Does the procedure of customizing usb driver  follow the right way? And what is wrong with the "TxDataEp1" function?

    Another,  when I run the Flash Kernel in MCU and send the program data to it in ascii8 hex type, the F021 Flash API works really well, and the program loads to the MCU.But when it  runs after reset, exception occurs as the program goes to "ILLEGAL_ISR". I compare the flash data in  circumstances with different tools, one loading the data using XDS200U debugger while the other using the F021 Flash Api through usb bootloader . There is only one difference in the memory located at address 0x097FFE, "00 06 00 06" appears in XDS200U mode, while "FF FF FF FF" in usb bootloader mode. I verified that the raw data "00 06 00 06"  exists in hex file.

    Could you explain these? I am really confused.

     

    Best regards!

     

  • Hi,

    Please use the usb flash programmer tool and usb bulk host example Visual Studio projects for references with Host PC programming. I am not sure why you are not receiving data.

    It is hard to say what the difference is and why that one location is not being programmed. Does it appear this is related to the Illegal ISR? Also, you can modify the VS project for the usb flash programmer and set a breakpoint when that address and data is being transmitted, and then step through the MCU usb kernel to see what it is doing with that data.

    You may also want to make sure that your flash image and sections arae aligned to 64-bit boundaries.

    sal
  • Hi,

    I break down the MCU program following your advice, at the entry of programming the address of 0x097FFE using F021 Flash API.  32 bits data to load at the address. How to configure the flash section to be aligned to 64bit boundaries, does the ALIGN(4) appeared in cmd link file configure well?

    Fortunately, I solve the flash problem in a way that rebuild the Project after change the cmd link files to regenerate the hex file, load to MCU using the customized USB BootLoader. All is going well!

    I will try more in reference with the bulk host example. 

    Thanks. 

  • Hi,

    Yes, you should use ALIGN(4) in the linker command file.

    After you modified your code, it may have gotten aligned by linking the modified image. ALIGN(4) should be a way to ensure it works going forward.

    Glad you got it working. If you have more questions, please open another thread and verify one of my responses to close this thread.

    Thanks,
    sal