TMS320F280049C: Converting SCI Bootloader to CAN Bootloader

Part Number: TMS320F280049C
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:


We are using the TMS320F280049C-56RSH microcontroller. We have access to two GPIO pins:

  • GPIO12 – connected to both SCIB_TX & CANB_TX

  • GPIO13 – connected to both SCIB_RX & CANB_RX

We are using the flashapi_ex2_sci_kernel and flashapi_ex3_live_firmware_update example applications for SCI bootloading. These examples are based on the 100-pin LaunchPad version of the F280049C, and they use SCIA by default.

Since the SysConfig tool is not available, we are manually configuring everything.

Following questions I have;

  1. How can we implement CAN bootloading, by converting present SCI Bootloader to CAN Based Bootloader for 56 RSH pin ?
    Please guide us on how to modify the example codes (ex2 and ex3) to support CAN-based bootloading, using CANB through GPIO12 and GPIO13.

  2. Please share the link If you have helpful datasheet regarding conversion process for F28004x
        I hope to hear from you soon!!

        With Regards,
         Nibesh
  • Hi Nibesh,

    We do not have any documents that will guide you on converting an SCI bootloader to a CAN-based bootloader. I suggest that you begin by configuring a CAN connection using CANB in a simple example and then slowly porting that code over to the firmware update examples. We have examples that will help you configure CAN on F28004x at the following location (C2000Ware_Install\driverlib\f28004x\examples\can). Once you have a CAN configuration that is able to communicate with your host, you can start replacing all the SCI data reception functions in the bootloader project with an equivalent function using CAN. 

    Is there a specific part of this process that you are stuck on? Given more specifics, I can provide more detailed help.

    Kind regards,

    Skyler

  • Hi Skyler,

    Thank you very much for your support.
    I will follow the points you mentioned.

    First, I will configure the CAN communication and try to implement SCI data reception in the bootloader.

    If I have any doubts during the process, I’ll reach out to you and attach my project file here.

    Thanks and regards,
    Nibesh

  • Hi  

    Could you please review the CAN-based bootloader code that I am currently developing?
    I faced little bit challenging on Read and Write Blocking.
    Could you kindly review it and provide your feedback?

    I hope to hear from you soon.

    Thanks and Regards,
    Nibesh




    4540.CAN_flashapi_ex2_sci_kernel2_V1.zip

  • Hi Nibesh,

    I can take a look at this over the next few days. In the meantime, can you please provide some more context on the behavior you are seeing? Where are you getting stuck?

    Kind regards,

    Skyler

  • Hi Skyler,

    I hope you're doing well.

    I wanted to clarify something regarding the usage of SCI_readCharBlockingNonFIFO and SCI_writeCharBlockingNonFIFO. As you know, these functions are used to send 1 byte of data over the SCI protocol in a blocking, non-FIFO mode.

    I have implemented a similar configuration for CAN. Also I have changed the BOOT Mode and other various functions in it. However, I have some doubts about how the blocking non-FIFO behavior translates in the context of CAN, based on my current implementation.

    Could you kindly review my approach and provide your feedback?

    Thanks and regards,
    Nibesh

  • Hello  

    Have you got time to review my code?
    If you can spend some time of yours, that will be good for me Skyler.


    Thanks and Regards,
    Nibesh 

  • Part Number: TMS320F280049C

    Tool/software:

    Hello Team,

    I am currently working with the SCI kernel code (flashapi_ex2_sci_kernel) for the F28004x series. I am in the process of converting the communication interface from SCI to CAN.

    So far, I have removed the Auto Baud functionality and commented out the section that gets user commands via the console:
    command = sciGetPacket(&length, data);

    I have also modified other SCI-related data transmission code to use CAN instead.

    Could you please review the code and let me know if there are any mistakes or areas for improvement?

    Looking forward to your feedback.

    Thanks and Regards,
    Nibesh

    CAN_flashapi_ex2_sci_kernel2_V2.zip

  • Hi Nibesh,

    Is there any specific question/problem you are having?

    Thanks,

    Charles

  • Hi Charles,

    I’m currently facing an issue with converting SCI to CAN. At the moment, I don’t have any other specific problems.

    I’ll reach out again if I encounter any further issues.

    Thanks and regards,
    Nibesh

  • Hi Nibesh,

    If you are having issues converting the SCI kernel to a CAN kernel, have you referenced one of our existing CAN Flash kernels? They are listed in the CAN Flash Programming of C2000 Microcontrollers app note.

    Thanks and regards,

    Charles

  • Hi Nibesh,

    Apologies for the delay, I have taken a quick look at the code but can you provide some more detail on the behavior you are seeing? You mentioned that you have some questions about the non-FIFO behavior, but what behavior are you seeing when you try and interact with this code over CAN?

    Kind regards,
    Skyler

  • Hi Skyler,

    No worries.

    Actually, I am trying to simulate the same working method of SCI using CAN. However, I’m noticing that it’s not working as expected.

    My main concern is to replicate the exact working methodology that SCI follows just replacing SCI with CAN.

    I hope you can provide some guidance or suggestions to make this work.

    Looking forward to hearing from you soon.

    Thanks and regards,
    Nibesh

  • Hi Charles,

    I have already reviewed the datasheet a long back which you have attached.
    However, the example code provided is for a different controller, which I don’t have. I’m working with the F280049C.

    I have tested SCI bootloading successfully on this controller, and it’s working fine for me. Now, I’m trying to replicate the same bootloading process using CAN, but it’s not working as expected.

    Could you please help me with this issue?


    Thanks and Regards,
    Nibesh

  • Hi Nibesh,

    After looking through your provided example, it is recommended that you use the functions provided for DCAN initialization and follow a similar example given for the F28003x device (C2000Ware_6_00_00_00\driverlib\f28003x\examples\flashflash_ex5_dcan_flash_kernel).

    At the beginning of your example, you initialize the device and GPIOs, but then should follow the DCAN_Boot() function flow, found here:

    C2000Ware_6_00_00_00\libraries\boot_rom\f28004x\revB\rom_sources\F28004x_ROM\bootROM\source\DCAN_Boot.c

    Thanks,

    Charles

  • Hello Charles,

    I wanted to clarify that the F28004x series does not support DCAN.

    I have implemented the solution based on your suggestion. however, I am still encountering issues. Could you please take a look at the code and help identify the problem?

    Thank you for your assistance.

    Regards,
    Nibesh Khulal


    CAN Bootloader.zip

  • Hi Nibesh,

    As previously stated, the problem resides in needing to use the DCAN_BOOT function for the F28004x device, which can be found in the bootROM source files for the device, as well as in similar example for the F28003x Flash DCAN Kernel. This device has DCAN support as specified by the device datasheet and technical reference manual.  

    I have read through your code, and it is better to use the F28003x flash_kernel_ex5_dcan_flash_kernel project as a porting basis for this device.

    Thanks and regards,

    Charles

  • Thanks, Charles.

    I will check and try to port it.
    If I run into any issues, I’ll post them here.

    Regards,
    Nibesh

  • Hi Charles,

    I was looking at the DCAN_Boot.c source file inside the BootROM source folder.
    I have a doubt: is this the main file?
    Even after adding the supporting libraries, it's still giving compilation errors.

    What could be the issue?
    Do we need to map the memory manually?


  • Hi Nibesh,

    This is a main support file for the ROM bootloader, but for your project it should not be used solely as the main file but as a reference. If we look at the flash_kernel_ex5_dcan_flash_kernel project, you can see this file is included as a part of the project's build, but the main source file used is called flash_kernel_ex5_dcan_flash_kernel.c . Can you give an image of the compilation errors?

    The memory mapping should be handled by the linker command file for the project and may need to be modified as well.

    Thanks and regards,

    Charles

  • Hello Charles,

    I have attached my code and images for your reference.
    Could you please review them and provide any necessary updates?

    With Regards,
    Nibesh





     




    1682.CAN_01_09_2025.zip

  • Hello Charles,

    Did you got time to review my code.
    I hope to hear from you soon.

    Thanks and Regard,
    Nibesh

  • Hi Nibesh,

    Apologies for the delay, our expert is currently out of office and should have a response early next week.

    Best,

    Alex

  • Hi Nibesh,

    From first import and rebuilding of the project, it gives the following error for "_bankSelect" symbol being undefined:

    As well, in the code I am seeing quite a few lines that use the "Escape point for OTP patches". This functionality should primarily be used by the bootROM source and should not be added to your CAN Flash Kernel.

    I advise that the source for this project model something closer to the F28003x Flash DCAN Kernel example in terms of structure.

    Thanks and regards,

    Charles