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.

TMS320F28069: CAN BOOT mode and CAN Flash Kernal

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE, , TMS320F28379D

Hi,

I have few queries on the CAN BOOT and CAN flasble bootloader

1. How to enter into CAN BOOT and Exit from CAN BOOT mode if we are not using the OTP method. For now we  planing to wtitten one application branching test code form there we are driectly branching to CAN boot jump address 0x03FF4FC. Is this method is correct? After this point we are loading the CAN kernal and Application.

2. Which boot comand we should have to used for genrating the ASCII file .a00? Please provide the same.

2. My important query is if CAN Kernal has erased the complete flash to load the new application and power is switched off. Then there is no applicaion in the flash in this case what will happen and how to enter into CAN BOOT Mode again after power ON? I dont have JTAG programmer to flash/program the application again? Please guide me how to handdle this kind of stiuations. We are running out of the FLASH also. we can't afford to keep one complete sector for braching program which can jump to CAN Boot.

3.  Is the possible to erase the pratial sector instated of erasing the complete sector. In this case our plan is to keep the branching code at start of sector and only erase the part which are not being used.

We need  this details urgently.

Regards,

Pandurang Khutal

  • Hi,

    One more query on CAN Flash programming utility from were we get this utility?
    I belive i can not use the serial flash programming utility for CAN as we are using PCAN USB dongle and it will not detect as COM Port?
    Please provide the path of download utility.


    When I read the main.c file header i found below text.
    //TITLE: F28069 CAN Flash Kernel Example
    //
    //! \addtogroup f2806x_example_list
    //! <h1>F28069 CAN Flash Kernel (f28069_can_flash_kernel)</h1>
    //!
    //! This example is for use with the CAN Flash Programmer utility. This
    //! application is intended to be loaded into the device's RAM via the
    //! CAN boot mode. After successfully loaded this program implements a
    //! modified version of the CAN boot protocol that allows a user application
    //! to be programmed into flash

    Regards,
    Pandurang
  • Pandurang,

    1) You can't enter CAN boot mode in standalone mode without programming OTP. If you are okay with Emulation boot option, You can write to 0xD00 = 0x55AA and 0xD01 = 0x0007. CAN boot jump address is 0x3FF4FF.

    2) hex2000.exe --boot -a -sci8 -o <OutputFile> <Input_COFF_file>. Please refer Pg 271 (Table 12-1. Basic Hex Conversion Utility Options) www.ti.com/.../spru513p.pdf for more details.

    3) You can consider using OTP array (0x3D7800 - 0x3D7BFF) for programming custom bootloader if you are able to fit your bootloader inside OTP array

    4) No, there is no way to partially erase a section of sector.

    Regards,
    Manoj
  • Hi,

    My question is how to enter into CAN BOOT when there in no program (means controller is fresh)? For SCI by using the GPIO pins (34 LOW and 37 HIGH) pins at power up it will enter into SCI BOOT like that how it happen in CAN BOOT.


    Can you please provide code for how to load the symbol of the boot ROM.


    For CAN flashable bootloader we are going through the SCI bootloader doc and found that for serial flash programmer utility we need to provide the COM port details, but for CAN interface we are using PCAN adapter and interface to PC is USB not the CAN. Can you please tell us how to use the serial flash programmer utility for CAN bootloader? or is there any other utility used for testing the CAN BOOT loader. Please provide the details.


    Best Regards,
    Pandurang
  • Pandurang,

    1) If you want to achieve CAN boot in standalone mode. You need to do the following:-

    a) Program 0x3D7BFB = 0x005A
    b) Program 0x3D7BFE = 0x0007
    c) GPIO34 = GPIO37 = 1 (Pull these pins high during powerup)

    2) BOOTROM source file and symbols available in <C2000Ware>\libraries\boot_rom\f2806x\v1_1\rom_sources\Release

    3) CodeSkin support programming flash through CAN. Please check www.codeskin.com/programmer

    Regards,
    Manoj
  • Hi Manoj,

    1) Our requirement is to program the board without connect the JTAG on end of line production. We  are planning to program secondary bootloader and  application image using the PC utility which will run on host.

    The above method which you suggested is using the writing the OTP locations right? How I can right this when controller is fresh/blank without connecting JTAG? Please suggest?

    2)Another issue with OTP is every power on control goes to CAN_BOOT and it wait there infinitely(without timeout to exit) for CAN message to receive externally but it is not possible at every power On to send the CAN message to exit from CAN_BOOT and go to flash boot.

    What is the other way to exit from CAN_BOOT without sending CAN message and jump to flash boot?

    3) For SCI we are using the serial_flash_programmer.exe to program the SCI flash kernel. Now which utility  we have to use for to program the CAN flash kernel? I believe TI might used some utility while testing the CAN flash kernel. Please provide the path to download it.

    Or if TI used the serial_flash_programmer.exe for testing then can you please provide the command used for flashing the CAN kernel.

    we have tried giving the command like: serial_flash_programmer -v -d f2806x -k f28069_can_flash_kernel.txt -a Test_2806xLEDBlink.txt -w  but it  throws COM port not recognized error and not going ahead. please suggest.

    4) Will CodeSkin support to program the CAN flash kernel? We have downloaded the CodeSkin utility but in c2prog the CAN option is disabled I think for TMS320F28069 the CAN feature is not supported. Please confirm.

    Regards,

    Pandurang Khutal

  • Pandurang,

    1) You can't achieve CAN boot without programming OTP. If you don't want to program OTP values using JTAG, you may have to use SCI boot to program a hex code which when executed would program OTP to get ready for CAN boot.

    2) Yes, your understanding is correct. When OTP is programmed for CAN boot, it would go CAN_BOOT each time it is powered up and wait in an infinite loop to receive CAN data. Unfortunately, there is no timeout and the only way to exit CAN boot is sending a wrong key value (any value other than 0x08AA). When a wrong key is sent, it goes to flash boot

    3) TI doesn't offer CAN flash kernel utility similar SCI flash kernel utility

    4) Please contact CodeSkin on this question.

    Regards,
    Manoj
  • Pandurang,

    Please see whether below suggestion suits your needs:-

    1) Use boot to flash. This doesn't require you to program TI OTP

    2) Write a custom bootloader which fits into USR OTP. As soon as device boots to flash, you need to jump to start address of custom
    bootloader in OTP

    3) Use SCI boot to program custom bootloader into USR OTP.

    3) Once you have customer bootloader programmed in OTP, you can use it to update application program in your production line (or) in field. Your custom bootloader (which uses CAN boot) is supposed to look for a specific signature which determines whether to update the application code (or) just jump to existing application code and execute it.

    Below example uses SCI boot to program flash. You can modify the example project to work as custom CAN bootloader to suit your requirement.

    <C2000Ware>\device_support\f2806x\examples\c28\f28069_flash_kernel

    Regards,
    Manoj
  • Hi Manoj,

    I try to develop custom secondary bootloader for CAN to use it like a flash kernel for f28379d. I started it with your suggestion.
    When I develop custom secondary bootloader, can I achieve CAN boot without programming OTP ?

    You replied me like this before :" Yes, it is possible with custom secondary boot loader. You have use GPIO72 = GPIO84 = 1, which boots to flash if you don't program TI OTP. Once it boots to flash, you can set a condition for custom bootloading (or) just jump to your application project."

    But in your thread with Pandurang there is a phase like this : "You can't achieve CAN boot without programming OTP."

    I suppose that I misunderstood your post before. Would you mind clarifying again this issue ?

    Best Regards,
    Adem.

  • Manoj,

    We are jumping from application code to CAN_BOOT address (0x003FF4FC) forcefully when we get the request for bootloader. We believe that PC jumps to this address but exit from CAN_BOOT we are sending data as invalid but it didn't came out staying there only.

    Can you please tell us how to ensure that in jump to CAN_BOOT address and get the data via CAN?

    We have checked that if application is running we get he data on CAN and receiving bootloader update command we jumps to CAN_BOOT address and data which is coming on CAN also stopped that's the reason we are saying control (program counter) properly jumps to CAN_BOOT address and it stay there to receive like 0x08AA or invalid command. we are sending Invalid data other then 0x08AA but still it is not coming out of the CAN_Boot to Flash entry point.

    What is the causes of this and How did TI tested this CAN flash kernal? cCan you please guide, how to test the CAN Flash kernel is working?

    Best Regards,
    Pandurang Khutal
  • Adem,

    Your custom secondary bootloader can internally call CAN boot option (which is available in BOOTROM). This secondary bootloader can be programmed in flash (or) USER OTP. In Pandurang case, since they don't have enough space in flash I suggested them to use USER OTP.

    Whatever suggestion I gave you in your original post is good. Don't get confused with Pandurang's post. I just meant to say you can't get to CAN boot by using boot mode pins without using custom bootloader (or) programming OTP.

    Regards,
    Manoj
  • Okey, I understood Manoj. Thanks for your replying.
    Best Regards !
  • Pandurang,

    In debug mode, you should be able to set a breakpoint at CAN_Boot address and make sure you are in CAN_boot available in bootrom.
    Which address in BOOTROM is the code stuck?

    I would suggest you to load BOOTROM symbols available in below path to help you in debug process.

    BOOTROM source code : <C2000Ware>\libraries\boot_rom\f2806x\v1_1\rom_sources\

    Regards,
    Manoj
  • Hi Manoj,

    1. Can you please tell us how to load the symbols and how they help for testing the code status. Do you have any document on this.

    2. I checked in debugger program counter goes to CAN_BOOT address (0x003FF4FC) but after this point control goes to ROM BOOT and we can not debug the code. We are sending invalid data on CAN but it is not coming from CAN BOOT to flash boot. I wait there infinity. Why?

    3. We have used the CAN ID on and baudrate as 100Kbps to send the invalid data through PCAN for testing purpose. Is this correct?

    4. I have question how does the TI tested this CAN flash kernel without having the PC based utility just like serial flash programmer?
    As we know this utility can not used for flashing CAN flash kennel. Please provide the CAN flash PC based utility for testing.


    We are not getting through this issue even putting more efforts and our project dead line is already crossed? need help on this to resolve the issues.

    Can we have webex session for discussion tomorrow @5PM India time? Please send me your email ID so that I can setup the Webex call.

    Best regards
    Pandurang Khutal
  • Pandurang,

    1) How to load symbols?
    a) Connect to device
    b) First Import the <C2000Ware>\libraries\boot_rom\f2806x\v1_1\rom_sources\ project in CCS
    c) Run -> Load -> Add symbols -> Load the BOOTROM COFF file (TMS320x2806x_boot_rom_gold_release.out)
    Please add the BOOTROM symbols after CAN gets stuck in an infinite loop

    2) The reason I wanted you to load the symbols is to help you debug the code to reason out why CAN boot is stuck in an infinite loop

    3) Sorry, I haven't used PCAN. So, I don't know

    4) We don't use PC based utility. We configure one of C2000 device (which supports CAN) to send our hex file

    We unfortunately don't support joint debug support through webex session. We aren't staffed to provide that level of support.

    Regards,
    Manoj
  • Hi Manjo,

    I have imported the code into workspace and trying to compile the code  to connect to the JTAG but getting below errors. Can tell me what is missing and can not able to add the symbols as that option is disabled.

    Description Resource Path Location Type
    cannot find file TMS320x2806x_boot_rom_lnk.cmd /2806x_boot_rom/lnk line 56 C/C++ Problem
    cannot find file TMS320x2806x_boot_rom_lnk.cmd /2806x_boot_rom/lnk line 57 C/C++ Problem
    errors encountered during linking; "TMS320x2806x_boot_rom.out" not errors encountered during linking; "TMS320x2806x_boot_rom.out" not 2806x_boot_rom    C/C++ Problem
    gmake: *** [TMS320x2806x_boot_rom.out] Error 1 2806x_boot_rom    C/C++ Problem
    gmake: Target 'all' not remade because of errors. 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl2806x_ClearSector, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl2806x_CompactSector, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl2806x_EraseSector, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl2806x_Init, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_ClearLoop, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_ClosePulse, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_CompactPulse, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_CompactVerify, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_Delay, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_DepRecoverCompactSector, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_DisableInt, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_DisableNMI, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_EnterCmdMode, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem
    unresolved symbol _Fl28x_ErasePulse, first referenced in ./source/rom_flash_api_table.obj 2806x_boot_rom    C/C++ Problem

    I have done one experiment, I have loaded the application code and  put the code into debug mode after this I loaded the symols of ROM CAN BOOT and started the debugging the code CAN ROOM BOOT code, what I found is the code is stucking at yellow line in CAN_GetWordData() function. I have configured CAN ID = 1 and Baud rate is 100KBPS Is this setting correct? Attached the screen shot also for reference.

    I have used the CANA port and GPIO30 and 31. I have tested CANA port with  normal application and it is working fine. I don't see any hardware issue. can you please tell me what is the issue and how to resolve it.

    Uint16 CAN_GetWordData()

    {

    Uint16 wordData;

    Uint16 byteData;

    wordData = 0x0000;

    byteData = 0x0000;

    // Fetch the LSB

    while(ECanaRegs.CANRMP.all == 0) { }

     

  • Pandurang,

    The BOOTROM golden COFF file (TMS320x2806x_boot_rom_gold_release.out) is already available in the below path. So, it is not required for you to compile the BOOTROM code.

    COFF file path: <C2000Ware>\libraries\boot_rom\f2806x\v1_1\rom_sources\Release\TMS320x2806x_boot_rom_gold_release.out

    If the code is stuck in CAN_GetWordData() function, then it tells that F28069.CANA didn't receive any CAN data. CAN settings available in BOOTROM is correct. CAN bit rate is calculated with SYCLKOUT = 10MHz as BOOTROM is executed at 10MHz.

    Regards,
    Manoj
  • Hi Manoj,

    I have tested the CANA port with other code with PCAN view and it is working fine. Why it is not working for CAN ROM BOOT CODE?

    I have done below setting in PCAN view and sending data as below -

    Mode standard
    Bit rate is 100kbps

    CAN ID-001
    Length - 2
    Data - FF 33 //invalid to come out from can boot

    Regards,
    Pandurang
  • Hi Manoj,

    I am jumping from application code to  CAN bottom address 0x3ff4fc and application is running at 90Mhz. Do I need to change this OSC and PLL setting  to internal OSC as 10Nhz and PPL as 1 before jumping to CAN ROM boot or it will taken care by CAN Boot code.  Please  confirm on this. This is very important to move forward.

    Thanks

    Pandurang

  • Bootloader sets the o/p of the PLL to /1. It does not configure the PLL. IOW, the i/p clock is indeed expected to be 10 MHz. So, answer to your question is "yes". Bootloader source is in C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f2806x\v1_1\rom_sources\source
  • Yes, the CAN_boot assumes that system is running at 10 MHz. So, before jumping to CAN boot change the setting to run the device at 10MHz.

    Regards,
    Manoj
  • Hi Manoj,

    1.)  I modified can_flash_kernel code for tms320f28379d using DCAN_Boot.c source code which in C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f2837xd\revB\rom_sources\F2837x_bootROM\cpu01-bootROM\source. At the top of the code there is a phase like this: "DCAN boot loader functions for Soprano". But I use LaunchXL F283779d. May it be a problem ?

    2.) For GetWordData() function there are two different logic like below. Which one should I use ? 

    In Can_Boot for f2806x GetWordData function like below: 

    Uint16 CAN_GetWordData()
    {
    Uint16 wordData;
    Uint16 byteData;

    wordData = 0x0000;
    byteData = 0x0000;

    // Fetch the LSB
    while(ECanaRegs.CANRMP.all == 0) { }
    wordData = (Uint16) ECanaMboxes.MBOX1.MDL.byte.BYTE0; // LS byte

    // Fetch the MSB
    byteData = (Uint16)ECanaMboxes.MBOX1.MDL.byte.BYTE1; // MS byte

    // form the wordData from the MSB:LSB
    wordData |= (byteData << 8);

    /* Clear all RMPn bits */
    ECanaRegs.CANRMP.all = 0xFFFFFFFF;

    return wordData;
    }

    In DCAN_Boot for f28379d GetWordData() function like below: 

    Uint16 DCAN_GetWordData()
    {
    //Wait for a new CAN message to be received in mailbox 1
    while (DcanaRegs.CAN_NDAT_21 != 0x1) {;}

    //Transfer the message from IF1
    DcanaRegs.CAN_IF1CMD.all = 0x00070001;
    while (DcanaRegs.CAN_IF1CMD.all & 0x8000) {;}
    return (Uint16)DcanaRegs.CAN_IF1DATA.all;

    }

    Also,  GetWordData function which in SCI_Boot for f28379d similar with  GetWordData function which in Can_Boot.

    Which one should I use ? 

    Best Regards.

  • Hi Manoj,

    Thanks for inputs.

    In application, before jumping, I have done the setting of PLL and selected the IntOsc1Sel() as clock sources and device is running at 10MHz. But still it was stucking in the CAN_GetWordData function.

    After this point, I have commented the complete initialization part of the application code and just added the below as initialization code in main.c and its working fine. Now my query is how to make this workable through the application code.

    1. What is causing the issue when application code initialization part is present?

    2. Before jumping to CAN_BOOT through application do we need to take extra care and what are these? please tell us the steps.

    3. Can you please provide the code snippet before jumping what are the things need to do?

    void (*EntryFunc_ptr)(void);

    void main()

    {

    DisableDog();

    IntOsc1Sel();

    DELAY_US(100);

    //IntOsc2Sel();

    //InitPll(DSP28_PLLCR,DSP28_DIVSEL);

    InitPll(1,3);

    while(1)

    {

    DELAY_US(100);

    EntryFunc_ptr = (void (*)(void))0x3ff4fc;

    EntryFunc_ptr();

    }

    }

    Thanks,

    Pandurang Khutal

  • Adam,

                DCAN_Boot.c in C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f2837xd\revB\rom_sources\F2837x_bootROM\cpu01-bootROM\source directory is the correct file for F28379D.

     The SCI module is the same between F28069 and 28379D. So, sameness in the SCI module functions is to be expected between the two devices. However, the CAN module is completely different (from a registers/bits perspective and hence programming perspective) between these two devices. Please open a new post and explain your problem clearly. Do not continue the discussion in this thread.

  • Adem,

    Please open a new thread and post this question.

    Regards,

    Manoj

  • Pandurang,

    I can't think of any additional code required. Here are some things we would try.

    Did you check whether CANA registers are configured correctly? Not sure what else can go wrong? I would check whether CAN registers are programmed correctly. Check whether you accessing the right CAN boot GPIO pins (CAN boot uses 30 / 31)? Have you looked at scope shots etc?

    Regards,
    Manoj
  • Hi Hareesh ,

    I opened a new thread with this question. But, I have a quick question. I want to develop a custom CAN bootloader for f28379d. When I asked that how I can develop it, some TI employees said me : " you can refer can_flash_kernel in f2806x , sci_flash_kernel in f28379d and DCAN_Boot.c source code which for f28379d. And you can port them to f28379d."

    I understood from all replying for my questions that I should modify these example codes and port the can_flash_kernel code to f28379d. But, all these examples are very different each other. I couldn't decide that which one is true for my purpose. And What should my steps be to develop can_flash_kernel for f28379d.

    Regards.

  • Adem,

    I'm sorry. But you have to post your question on your own thread. Even though both you and Pandurang are working on CAN bootloader, you folks are working on two different devices. Answering your question in this forum will confuse Pandurang and viceversa.

    Regards,
    Manoj
  • Pandurang,

        I presume this issue is resolved. Please close the post.

  • Dear Pandurang,

    did you solve your can bootloader already? i have exactly the same issues as you when boot loading from CAN in field. i also have the same questions like yours. please share your experience if solved. many many thanks.


    BR
    Feng
  • i have the same question when developing can bootloader. and i already opened a thread in the link: e2e.ti.com/.../2616003

    according to your suggestion: i can develop a customer can bootloder based on SCI bootloader "f28069_flash_kernel", can you please advise what is PC based utility for CAN bootloader?
  • A host PC CAN flash programmer should be released by the end of the year.

    You can use the serial flash programmer host tool and modify it for CAN in the meantime.

    Regards,
    sal
  • Dear Sal,

    thanks very much for your reply.

    actually i have modified for can flash based on SCI flash programmer and post a new thread on 

    , but unfortunately, it don't work until now. would you mind give me more detail suggestion? thanks,

    BR

    ChenFeng

  • Pandurang,

    I'm closing this thread as I haven't heard back from you for a long time.

    Regards,
    Manoj