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.

TMS570LS1114: Some problems about the code of SPNA186?

Part Number: TMS570LS1114

Dear Experts:

         When I transplant the code from SPNA186 , I am caught with many problems. By the window of Memory Allocation, I make sure having succeeded to copy the code from FLASH0 to RAM. However some details still bother me. 

When I debug the code,I find the program stopping here.

Bootloader is used to load the bootloader code, CAL_ROM is used to restore the calibration information(thanks to FEE is to used oher functions).

         For example, int  parameter=5,I will save the address of parameter in the CAL_ROM. Whether I ought to load the code to replace the g_pulDataBuffer[BUFFER_SIZE].

PacketWrite(canBASE_t *node, uint32_t ulId, const uint8_t *pucData, uint32_t ulSize)

Is to used load the data?

  • Hello Chi Qiu,

    You code gets stuck at while((node->NWDATx[regIndex] & bitIndex) == 0), this means the bootloader is waiting for the packet. The host or the PC should command and data to the bootloader.

    PacketRead(..) is to read the next DCAN packet that is sent to the bootloader, and PacketWrite(..) is to send a packet to the controller or PC that is communicating with the bootloader.

    In CAN bootloader, UpdaterCAN() reads bootloader commands and perform the firmware update through the CAN bus. The host or PC which send data to bootloader should use the same baudrate.

  • Dear QJ Wang:
    Thank you for your enthusiastic response.
    In fact,In the PC,I send data fail .PC:The CAN_BIT-RATE is 125000, ID(HEX)0x2 Data(HEX)00 01 02 03 04 05 06 07
    However,I fail.I don't know if I should ID(HEX)=0x5A0~0X5A5,but still fail.I find even a varible(g_ulTransferAddress) which its adreess is 0x00000000.
  • Hi Chi Qiu,

    1. The TMS570LS1114 PCB board should have a CAN transceiver which is the interface the CAN protocol controller (in LS1114) and the physical CAN bus.

    2. USB-to-CAN is recommended to use for connecting PC to CAN network. The sample code we provided supports the USB-2-CAN module from NI (nican.dll, nican.h, and nicanmsc.lib etc should be included).

    3. First, load the bootloader and execute the bootloader in MCU side, the bootloader is waiting for the commands and data from the CAN bus

    4. second, run the project on PC side

         1. Ping MCU: check if you get ACK from bootloader

          2. If ping the MCU successfully, send DOWNLOAD command, then data, check the ACK 

          3. Send command to run the application or reset the MCU

    Can you tell at which step you get a wrong message?

          

  • 3312.can_bltest.c

    Attached please find the example code used on PC side. Please tell me where you failed/ Thanks

    5482.bl_commands.h

  • What is the ID number of CAN Communicantion according to the example of safetyMCU_Bootloader(TMS570LS12X)?

    I have many questions about the SPNA186.

    #define MSG_OBJ_BCAST_TX_ID 1 in bl_can.c

    #define MSG_OBJ_BCAST_RX_ID 2 in bl_can.c

    ①These code is means the ID is 1 or 2 between PC and Bootloader?

    ②Tx identififier:0x5A(device ID)+CMDs(0x00,0x01,0x02,0x03,0x04,0x05,0x06) is the ID?My PC ID set 0x5A0~0x5A6?It bothers me.

    ③My program is still stop at:

    While((node->NWDATx[regIndex]&bitIndex)==0)

    I know I should send the data to Bootloader ,but I fail many times.I don’t make sure the ID number

    ④Why there is no booloader example for TMS570LS11x?

    ⑤Sample Code for PC-Side Application could transplant in the device 570LS11x?It seems no copletement project,only apply to RM?or TMS570 other devices?

  • PC Side Code run in the VC++2010?My computer has no this software.Whether I could transpant the code into my bl project?
  • PC Side Code run in the VC++2010?My computer has no this software.Whether I could transpant the code into my bl project in the CCS V6?
  • Hello ChiQiu,

    Please check my answer in another thread:

    e2e.ti.com/.../656705
  • chi qiu said:
    PC Side Code run in the VC++2010?My computer has no this software.Whether I could transpant the code into my bl project in the CCS V6?

    My example code was compiled using VC++ 2010. You can use other compiler to generate a standalone execution file (*.exe). Why to import to CCS V6 project? Are you going to use another MCU as host?

  • My CAN device is USBCAN-II,If I use the PC-Side Code ,which configuration should I do?
  • Do you have example code from USBCAN-II company? Normally the tool company has tool library and example code showing you how to call the APIs (CAN read/write etc). Please find it from USBCAN-II website.