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

TMS320F28P650DK: unable to program cpu1 and cpu2 firmware through can bootloader

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: C2000WARE

Hi Team,

I am using the TMS320F28P65D controller and working on implementing the CAN bootloader functionality.

For testing, I am using the Flash Kernel provided in the C2000Ware examples and attempting to program the application firmware through CAN in the F28p65D Launchpad. The bootloading process appears to proceed correctly up to the Flash erase stage. However, after the erase operation, the programming process does not complete successfully. The command window does not report any errors, but the Flash memory is not being programmed internally.

A few observations:

  • Flash erase operation completes successfully.
  • No errors are reported on the command-line interface during programming.
  • The application image is not written to Flash after the erase phase.
  • The SCI bootloader works as expected with the same application image.
  • The configured CAN boot ROM pins match the hardware connections and CAN communication is functioning properly.

Could you please advise on any known issues, additional debugging steps, or specific checks that should be performed to identify why Flash programming is not proceeding after the erase operation?

Thank you for your support.

Thanks,

Sainikhil

  • Hi Sainikhil,


    Kindly refer to the Appnote CAN Flash Programming of C2000 Microcontrollers. 

    Could you please advise on any known issues, additional debugging steps, or specific checks that should be performed to identify why Flash programming is not proceeding after the erase operation?

    1. "Erase completed" only proves the kernel started, not that your application data reached it

    The kernel erases the user-designated banks and sectors right after it initializes the device, before any application data is received. The host then waits 5 seconds and sends the application at 1 Mbps with 8 bytes per frame (10 ms between frames in the host tool). So the kernel can erase successfully and then receive nothing, or garbage, if the application phase runs at a different bit rate than the kernel's.

    Make sure the clock used by the kernel project is INTOSC2 (device.h), because the boot ROM runs from the 10 MHz INTOSC2.

    You can also refer to the following threads :
    - https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1515045/launchxl-f28p65x-application-not-running-after-dcan-flashing-on-f28p65x-using-dcan_flash_programmer-exe-with-can-tool-peak-can

    - https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1591420/tms320f28p650dk-dcan-flash-kenel-rom-bootloader-issues

    - https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1564138/tms320f28p650dk-canbus-flash-kernel-inquiries

    2. Flash-section alignment in the application's linker file

    All flash sections of the image must be aligned to the kernel's programming width. The F28P65x DCAN kernel supports 512-bit programming (there is also an optional 128-bit F28P65x project), so the application needs `ALIGN(32)` after every section allocated to flash (`ALIGN(8)` for the 128-bit project).  

    3. CPU1 + CPU2 combined image

    The CPU2 image is programmed by combining the CPU1 and CPU2 application .txt files. They can't just be concatenated in an editor because each has a start header (key, reserved words, entry point) and a terminating header; the extra headers have to be removed, and you must make sure no address block is lost. The `-a` option of the host tool takes the application for CPU1, and the first image in the combined .txt must be CPU1's, followed by CPU2's (Section 7.1). First try the CPU1-only image on its own.

    4. Banks and sectors the kernel erases and programs

    In your kernel source, `Application_Flash_Banks = {0,1,2,3,4}`, all three mask arrays are `{0,0,0,0,0}`, and `numBanksToErase` is 5, so all five banks are selected by default. The A and B masks are also used when programming, where the proper mask is chosen from the target address of each data block. If you edited these arrays, make sure every address of both images falls in a bank and sector they enable. 

    Also check bank ownership. F28P65x flash banks can be mapped to either CPU with BANKMUXSEL, and a CPU needs the flash semaphore before erase/program

    5. Host-side settings for DCAN

    Bytes 3 and 4 of the kernel .txt must hold the bit-timing register value (CAN_CALC_BTRREG), least significant byte first, otherwise the host won't switch to the faster rate. For a 25 MHz CAN clock and 1 Mbps,  byte 3 = 0xC0 and byte 4 = 0x7F .Both the kernel and the application must be in the SCI8 boot format (`hex2000 -boot -sci8 -a`), and the PEAK PCAN-USB (Pro) FD adapter is required. The kernel's CAN GPIO option must also match your hardware: your call uses `CAN_BOOT_ALT1_SENDTEST`

    6. How to confirm what the kernel actually did, and what comes after

     Halt in CCS while the kernel is running, load the kernel's symbols, and inspect flash in the memory browser (or compare against the .txt/.out with the CCS on-chip flash tool). That shows whether the kernel got past erase into programming. After programming, flash boot needs both boot pins (GPIO72/GPIO84) high, then reset.  For CPU2, CPU1's application must assign CPU2's banks and GSxRAM, give GPIO control to CPU2, and run before CPU2 runs its application.



    You can also refer to TMS320F28P65x Flash API




    Regards 
    Arpit