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.

TMS320F28035: CAN Programming Clarification

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE, TMDSDOCK28035

Hello,
I have read numerous related articles regarding CAN Bootloader for 28035 and would like to confirm what I believe.
*** Starting with an unprogrammed 28035 ***
Leave GPIO37 and GPIO34 alone - defaulted it enables Get_Mode
Now I need to ensure 0x3D7BFE OTP_KEY == 0x55AA and 0x3D7BFF OTP_BMODE 0x0007
This is accomplished in the C2000Ware_3_04_00_00\device_support\f2803x\examples\c28\f2803x_can_flash_kernel example along with GPIO setup, mailbox setup, CAN setup, clocks etc.
Use the serial_flash_programmer (serial port) to copy over the kernel.txt file from the f2803x_can_flash_kernel example (Refer to SPRABV4D).
(I believe this is the ONLY way to get OTP values programmed without JTAG.)
Then the 28035 board should be power cycled.
The 28035 will now wait forever on the CAN bus until it reads the first CAN word.
If the 28035 requires application code load, send the hex file with proper key value 0x08AA via a CAN utility. (At this point there is a entry point address that the bootloader will jump to after the ExitBoot routine is called so therefore no additional reset or power cycle is required.)
If the 28035 already has application code loaded and we want it to start running, send a hex file with the incorrect key value, say 0xFFFF, and now F28035 boot from Flash.
Please feel free to critique my understanding.

  • After closer investigation of the can flash example, I am not seeing the OTP values programmed anywhere nor do I see a DATA_SECTION("OtpKeyVar");

    Do these need to be manually added?

    This is how I have coded OTP_Key and OTP_BMode.
    In file DSP2803x_Headers_nonBIOS.cmd, I added the following:


    PAGE 1 section
    OTPKEY : origin = 0x3D7BFE, length = 0x000001 /* Bootloader GetMode key */
    OTPBMODE : origin = 0x3D7BFF, length = 0x000001 /* Bootloader BMode key - Set to CAN*/
    SECTIONS section
    OtpKeyVar : > OTPKEY, PAGE = 1
    OtpBMode : > OTPBMODE, PAGE = 1


    Created an OTP.asm file with the following:
    ;/***********************************************************************/
    .sect "OtpKeyVar"
    .int 0x55AA ; One-Time Programmable for CAN BMode
    ;/***********************************************************************/
    .sect "OtpBMode"
    .int 0x0007 ; CAN BMode
    ;/***********************************************************************/
    .end


    No 'make' considerations were required as it built nicely.


    It showed up in the .map file as:
    OTPKEY 003d7bfe 00000001 00000001 00000000 RWIX
    OTPBMODE 003d7bff 00000001 00000001 00000000 RWIX


    *** DISCLAIMER *** To this point it is untested.

  • Leave GPIO37 and GPIO34 alone - defaulted it enables Get_Mode

    These pins should be sensed high coming out of reset. True there is an internal pull-up, but it must be supplemented with an external PU.

    Now I need to ensure 0x3D7BFE OTP_KEY == 0x55AA and 0x3D7BFF OTP_BMODE 0x0007

    Correct.

    Your understanding of the boot sequence is correct. I will request someone from the s/w team to comment on the kernel transfer.

  • Hi Jeffrey, 

    Setting the boot mode to CAN will direct the device to the CAN bootloader in ROM. The ROM bootloaders only write code to RAM, not Flash, so setting the device to CAN Boot to update/load an image into Flash is incorrect. If you are trying to update an image in Flash, this is where the flash kernel comes in - the flash kernel would be written to RAM, and would facilitate the writing of an application to Flash without the use of JTAG. 

    I looked at the example you pointed to, and it looks like the CAN flash kernel would need to be downloaded using SCI Boot mode. Once the kernel is downloaded, CAN is initialized and can be utilized to write an application to flash. Regarding programming the OTP values without JTAG, I will get back to you shortly. 

    Thanks, 

    Anu

  • Thanks Anu, I look forward to your response for the writing of the OTP values. It may also resolve e2e.ti.com/.../tmdsdock28035-simple-flash-help.

  • Hi Jeffrey,

    Couple of things you can try:

    1. Move the OTP section mapping to page 0 and see if that helps.  I remember hex generates separate output images for page0 and page1.  I would suggest to move all the initialized sections to page0 so that you have everything in one hex output.

    Note: I would suggest you not modify the DSP2803x_Headers_nonBIOS.cmd for your application added sections.  This is used for device register space.  Instead use your application linker cmd file.

    If above does not resolve your issue, I would suggest you take a look at #2 below.

    2. Please search for "How can we program a field in USER OTP?" in below FAQ page:

    e2e.ti.com/.../faq-faq-on-flash-api-usage-for-c2000-devices

    I will let Anu drive any further questions that you may have on kernels.

    Thanks and regards,
    Vamsi

  • Vamsi and Anu, as for the programming the OTP values, I have another thread going (see above) and will not try to duplicate this effort. Thanks for the help and I believe Anu answered my other question so this is now resolved. If I have any additional issues trying to download a hex file using SCI Boot mode, I will open another ticket. Thanks again.

  • Jeffrey,

    When Anu asked me to check the OTP write issue in this thread, I tried to click on the link that you gave above. It did not work for me.  I tried again now - no success (got below error).  You may want to share the link here again if you need further help on that.  Another colleague (Kevin) reached out to me today with similar question (did not share the E2E post with me) and I suggested him to share my FAQs.  Maybe it is the same thread that you are referring to. If it is resolved there, then it is good deal.  

    Thanks and regards,

    Vamsi

  • Yes - I am working with Kevin in another thread - issue not resolved yet. I think the link gets shortened when I paste into the post so I would now recommend searching for the thread titled "TMDSDOCK28035: Simple Flash Help" or copy and paste the following.

    e2e.ti.com/.../tmdsdock28035-simple-flash-help

  • Jeffrey,

    Ok, we can go with the other thread then.  Kevin will approach me if needed.

    Thanks and regards,
    Vamsi

  • I looked at the example you pointed to, and it looks like the CAN flash kernel would need to be downloaded using SCI Boot mode. Once the kernel is downloaded, CAN is initialized and can be utilized to write an application to flash.

    Couple questions - Can you find where the OTP values are written in the CAN flash kernel example as they would need to be to programmed for a CAN Boot?

    Also, I am a bit fuzzy on this still. If the CAN bootloader is downloaded, I am hoping it can reside in flash and on each boot forces the F28035 to wait for CAN data - either a hex file or junk so it will boot. If the CAN will only exist in RAM after being downloaded via SCI, this means when the product is in the field, I would need to use SCI and CAN to update an application. This doesn't make sense. Please clarify.

  • Jeffery, 

    The CAN flash kernel does not program OTP, that is a separate process altogether, I see that the other thread discussing this is still active so you can continue that discussion there. 

    For the sake of clarity, I want to separate the terms CAN bootloader and CAN flash kernel. The CAN bootloader resides in ROM, the CAN flash kernel can reside in RAM or Flash. If the device is set to CAN boot, you need to supply a “junk” value to the CAN bootloader every time you want to boot to flash. Else the CAN bootloader will just wait in a loop eternally for data. One alternative is to set the boot mode to boot from flash, and place the CAN Flash kernel in Flash. The flash kernel example in C2000Ware can be modified such that it waits on data from CAN for a certain number of seconds, and if no data is received, you can go to your application code. 

    If you have further questions we can set up a call. Please message me via chat if you would like that and I can set one up. 

    Thanks,

    Anu