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: Looking for basic C2000 F28377D example for CCS7.2 of booting from flash, copying flash to ram, then running from ram

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

I'm recently returned to the C2000 world after much time away and am struggling to go from a working build that runs in RAM to a build that will start out in flash, copy to RAM and run from there.  I've been looking through the C2000 examples for my control card, which have been very useful for getting peripherals working in short order.  However, I'm not finding examples like what are provided in SPRA958L January 2013.  Is there an update to SPRA958L for CCS7.2 and later vintage C2000 devices?  Thanks!

  • Susan,

    Attached is a SPRA958 style code example for CPU1 for F28377D.  This is a CCSv7 example.  My suggestion though would be to download and use the latest CCS, which is CCSv8.  There are two project configurations in this project: FLASH, and RAM.  The FLASH configuration will come up by default when you load the project into CCS since F preceeds R in the alphabet.  You will probably also get a warning on project load about the compiler version the project was created with not being installed.  Just change the project to use an installed/latest compiler, and the warning will go away.

    F28377D_example_CPU1_nonBIOS_2017Mar16.zip

    Regards,

    David

  • Thanks David.  (And how cool to get a response from the spra958L author!!) I'm having the same kind of behavior when I try to run this on my control card as when I try to make a flash version of my own code.  I do a CPU reset to PC=0x3ff16A, single step into the code, put a breakpoint in Main_nonBIOS.c at the first function call of main(), InitSysCtrl(); but I never get there.  Instead, the processor is in an infinite loop at 0x003fee00 and I can only see the disassembly. 

    If I say "go main" then the PC starts from 0x082e5d and I appear to execute the code in main() and get to the infinite loop, but the address of 0x082e5d is in the flash, which makes me think I didn't successfully copy to RAM and make the jump to execute from RAM. 

  • Susan,

    Check the bootmode switches on the control card.  They should both be "ON" for GetMode (which jumps to flash by default).

    - David

  • Also note that the bootROM code can be found in C2000Ware here:

    C:\TI\c2000\C2000Ware_1_00_04_00\libraries\boot_rom\f2837xd

    You can load the symbols into CCS, and step through the bootloader process to see where it goes awry.

    - David
  • Hmm, I have double checked the switches.  They were in Wait Mode (10) and I've changed them to Flash Mode (11) but the code is somehow detecting SCI Boot Mode (01)?

  • Susan,

    When the JTAG is connected, Get Mode determine which mode to use by checking a couple of locations at the start of the PIE RAM. In CCS, look on the scripts menu for the bootmode choice options. Try the boot to flash mode.

    Alternately, flash the device with the code I sent and then disconnect the JTAG. Power-cycle, and the LED should blink on the control card.

    - David
  • Changing EMU Boot Mode Select from Scripts in CCS to EMU_BOOT_FLASH allowed me to get through the bootloader with EmuKey 0xB5A and BootMode 0x000B, which did result in me getting to the main() of the project provided, same as if I tell the debugger to Go Main().

    So I think from the perspective of the app note for how to run an image from flash, this works as expected now. If I disconnect the debugger and power cycle the control card, the LEDs continue to blink, so the image is properly loaded and the boot process is operating.

    I am still ultimately looking for an example of copying the user code from flash to RAM and running from RAM after booting from Flash. Is there a simple example of that? Thank you for the help so far!
  • Susan,

    There is no example that I know of that copies the entire application to RAM and runs from there. The code I sent you copies some select functions. You can probably copy the entire .text section to RAM by following the method used in the SPRA958 appnote.

    Regards,
    David
  • Thanks! I'm probably designing with a yester-year mindset that the code running from flash is "too slow" without really thinking about it too much. I'm sure as I play around more with the processor, I'll figure out which, if any, pieces need to run from RAM instead of from Flash.