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: Regarding CAN boot mode entry and exit

Part Number: TMS320F28069

Hi All,

I have a doubt regarding CAN flash bootloader on how to enter and exit CAN boot mode. As per the datasheet when OTP key and OTP Bmode is programmed to 0x005A and 0x007 resp , then the CAN boot mode is entered and in order to exit the CAN boot mode and enter into Flash mode we have to send and invalid data other then 0x08AA on CAN from a host which in this case is PC.Now suppose i need to program an application when the device is in CAN boot mode using flash kernel , I have to load the CAN flash kernel in RAM and flash the application code and the appliction code runs. 

But when we power cycle the microcontroller, the controller will again go and set to CAN boot mode since OTP key and OTP Bmode are already programmed to CAN boot mode and it will wait till the host sends the invalid key , so that the controller exits CAN boot mode and enters Flash boot to run the application. Is there any solution on how to enter CAN boot mode without OTP key and Bmode and exit CAN boot mode without waiting for the invalid key ,So that at power on ,when the user need to go to CAN boot mode it can enter and when at power on the user wants to run the application without waiting for invalid key or without entering CAN boot mode , it can enter application run.

Regards,

Chandrakant Pal

  • You could follow this procedure:

    Configure your design to always boot from flash. In your application, after system initialization is complete, configure eCAN and wait for a unique control byte from the host. If this byte is received, that means flash update is needed and the application code can branch to the CAN bootloader portion of the boot-ROM. If this byte is not received, proceed with application normally. A time-out should be implemented while waiting for this control-byte from the host. You could exclude the sector where this decision is made from the update process (i.e. this sector is not erased/programmed), so that even if you lose power midway, you can restart the process. Please see these posts for more information.


    e2e.ti.com/.../2109751
    e2e.ti.com/.../399344
  • Hi Hareesh,

    Thank you for your reply.

    Is there a way to default keep the microcontroler in CAN boot mode and flash the application using CAN kernel at every power On and when no input is received from host switch to Flash boot mode after timeout at power ON . We do not have FLASH memory free so using 1 FLASH sector for switching between application and CAN boot mode for flashing application is not feasible. I have seen SCI flash kernel in control suite where in using GPIO 34 and GPIO 37 we can keep the microcontroller in SCI flash mode and using SCI flash kernel flash the application. Is that mechanism possible using CAN ?

    What is the command that we need to give in command prompt for CAN as we give in SCI ? As seen in below SCI command we need to give the COM port no. But what is the command for CAN since we are using Peak PCAN USB?

    .\serial_flash_programmer.exe –d f2806x –k <~\f28069_flash_kernel.txt> -a <file> -p COM<num> 


    Regards,
    Chandrakant Pal

  • Chandra,
    Unfortunately, what you describe is not possible. The CAN boot-loader in BROM will forever wait for a character from the host. There is no timeout. SCI has a dedicated boot-mode using the GPIO34 & GPIO37 pins, but booting through CAN is one of the options with Getmode.

    A solution for CAN-based flash programming for this part number is currently unavailable.
  • Hi Hareesh,

    Thank you for your reply. Can you please share some documentation on CAN flash kernel and the utility to flash the CAN flash kernel in RAM along with the command to execute in the utility just like we have for SCI flash kernel?

    for example for SCI programming we have:

    serial_flash_programmer.exe –d <device> -k <kernel file> -a <app file> -p COM <num>
    [-m] <kernel2 name> [-n] <app2 name> [-b] <baudrate> [-q] [-w] [-v]

    -d <device> - The name of the device to connect and load to.f2802x, f2803x, f2805x, f2806x, f2837xD, f2837xS, or f2807x.
    -k <file> - The file name for the CPU1 flash kernel.This file must be in the ASCII SCI boot format.
    -a <file> - The application file name to download or verify to CPU1This file must be in the ASCII SCI boot format.
    -m <file> - The file name for the CPU2 flash kernel.This file must be in the ASCII SCI boot format.
    --n <file> - The application file name to download or verify to CPU2.This file must be in the ASCII SCI boot format.
    -p COM<num> - Set the COM port to be used for communications.
    -b <num> - Set the baud rate for the COM port.


    -d, -k, -a, -p are mandatory parameters. If the baudrate is omitted, the communication will occur at 9600 baud.

    As seen in above command for SCI -p is COM port but for CAN boot mode what will be the -p command since PCAN USB.Similarly what are the commands that we need to give in the utility when in CAN boot mode 


    Regards,
    Chandrakant Pal

  • Chandra,

         Have you considered using C2Prog from Codeskin? It has programming option via CAN.

    http://www.codeskin.com/programmer

  • Chandra

    I'm not sure what information you want regarding the CAN flash kernel, it works similar to the SCI kernel. The CAN flash programmer is still in development but as you described, will follow similar command types. When using PCAN USB, the CAN programmer doesn't require a COM port or baud rate. Our programmer will always set up CAN with 100kbps baudrate.
    Example usage with CAN programmer: -v -d f2806x -k f28069_can_flash_kernel.txt -a Example_2806xLEDBlink.txt -w

    More information will be available once it is released but as Hareesh mentioned, it is currently unavailable.

    Best regards
    Chris

  • Chandra,
    It appears you are discussing this issue on multiple threads. Please continue the discussion on only thread and close any redundant threads.