Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

TMS320F28377S: Updating Flash thru USB using built in ROM function problem

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

We are using TMS320F28377S in our product and we require reflashing through the USB port.

We followed recommended (?) procedure (after disabling peripherals and timers):

    Uint32 (*USB_Boot_ptr)(void) = (Uint32 (*)(void))0x3fe868;  // 0x3F8000 USB_Boot() in 0x3fe868 Rev. B, 0x3fe431 Rev. 0
    void (*EntryFunc_ptr)(void);
    volatile Uint32 entryAddr = (*USB_Boot_ptr)();
    EntryFunc_ptr = (void (*)(void))entryAddr;

    (*EntryFunc_ptr)();                                         // Jump into Boot Loader.

and it seems that on some boards this works and on some it crashes and resets.
We believe that the microcontrollers are the same silicon and ROM however we do not know how to check the ROM version.

When working, we are successfully downloading TI Flash updater followed by Flash code to the chip.

Questions:
- how to check the ROM version of the TMS320F28377S ?
- what could be causing some boards to work and some not ?

- is there a better code to accomplish this reliably ? (Previously we had issues with other solutions)

Martin

  • Hi Martin,

    Please allow another 1-2 days for me to review your thread. Appreciate your patience.

    Best Regards,

    Allison

  • Hi Martin,

    Apologies for the extended delay.

    The F2837xS Boot ROM provides version information at fixed memory locations. If you take a look at the different revisions of ROM in C2000ware, you can see that the USB boot addresses are different. i.e. If your code uses 0x3fe868 this is correct only for Rev B ROM. Boards with Rev 0 ROM would jump to the wrong location and see issues. I would consider three separate items that could be contributing to inconsistent behavior:

    1  ROM Address 

    • If you have F28377S shipped with two different ROM versions in production
      • Rev 0 ROM: USB_Boot at 0x3FE431
      • Rev B ROM: USB_Boot at 0x3FE868
    • Your code hardcodes the Rev B address → Rev 0 boards will crash

    2  AUXPLL Lock Errata 

    • From F2837xS errata SPRZ422K §3.2 (pages 16-17): "PLL: May Not Lock on the First Lock Attempt"
      • Affects both SYSPLL and AUXPLL - PLL may not lock at power-up or wake from Hibernate on first attempt
      • Silicon revisions affected: Rev B and Rev C (all production silicon)
    • USB requires stable AUXPLL clock. If AUXPLL isn't locked when you call USB_Boot(), the Boot ROM code can fail
      • The USB Boot Mode boot ROM does not implement the retry workaround - your application must ensure PLL is locked before calling

    3  Function Signature

    • From c1_bootrom.h (line 250):
      • extern Uint32 USB_Boot(Uint16 bootMode); // Takes a Uint16 parameter, not void
    • Your code calls:
      • Uint32 (*USB_Boot_ptr)(void) = (Uint32 (*)(void))0x3fe868;
    • The Boot ROM expects a bootMode parameter (0x000C for USB_BOOT).

    A few resources for you to reference as well:

    Source: C2000Ware Boot ROM files

    • Rev 0 map: C:\ti\c2000\C2000Ware_*\libraries\boot_rom\f2837xs\rev0\rom_sources\ccs_files\cpu01\Release\*.map
    • Rev B map: C:\ti\c2000\C2000Ware_*\libraries\boot_rom\f2837xs\revB\rom_sources\ccs_files\cpu01\Release\*.map
    • Header: libraries\boot_rom\f2837xs\revB\rom_sources\F2837x_bootROM\cpu01-bootROM\include\c1_bootrom.h

    Source: F2837xS Errata (Literature # SPRZ422K)

    • §3.2 (pp.16-17): PLL lock errata and workaround
    • §4.2 (p.45): Boot ROM Rev B X1 clock requirement (Rev B silicon only)

    Best Regards,

    Allison

  • I am not sure if our solution is related to "AUXPLL Lock Errata" but here is what we found to make it work for us.

    We are using an external 20 MHz crystal as a clock source in our design (everything including USB works fine) and if we switch and configure back to the internal 10 MHz clock right before jumping to ROM USB boot loader then Flash Update works reliably.

    If we do not switch to the internal clock, the MCU resets on most of the boards.

    I expected that ROM code would configure itself  properly no matter what.

    I am hoping that you can explain this phenomenon so that we can be sure that our "fix" is reliable and proper.

    Martin

  • Hi Martin,

    Thank you kindly for the follow up. For below, you can reference directly from the Boot ROM source code available in C2000Ware: C2000Ware/libraries/boot_rom/f2837xs/rev0/USB_Boot.c and revB/USB_Boot.c, USB_Boot_Init() function

    Rev 0 ROM never changes the SYSPLL clock source - it assumes INTOSC2 is already active and applies a fixed IMULT=12. If your application is running from a 20 MHz crystal when you call USB_Boot() on a Rev 0 device, the ROM configures SYSCLK = 20 MHz × 12 = 240 MHz (over the 200 MHz spec). 

    Rev B ROM tries to switch the SYSPLL to INTOSC2, but does so by writing CLKSRCCTL1 to change the PLL input source without first bypassing or disabling the running SYSPLL. When the application has been running from a 20 MHz crystal at 200 MHz SYSCLK, changing the PLL source mid-operation could be causing the SYSPLL to lose lock. As noted in §3.2 advisory ("PLL May Not Lock on the First Lock Attempt"), the ROM would then hang indefinitely in its lock wait loop.

    When you switch to INTOSC (10 MHz) before calling USB_Boot(), since the source is already INTOSC2, execution continues normally.

    Best regards,

    Allison