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.

AWR1843BOOST: CAN Secondary Bootloader Lab_0012

Part Number: AWR1843BOOST
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

I've been trying to run this application on my EVM. The User Guide states that I need to send the MetaImage using the 'CAN_Metaimage_Flasher.exe' application. However, this application is based on Peak-CAN hardware, which I don't have. Instead, I have a Kvaser CAN interface.

The User Guide also mentions the possibility of porting the application for other dongles. Could you please provide the path to the source file for this application?

  • Hi Tanoop,

    Currently the source code for PC based CAN Application is not included in the Radar Toolbox. 
    This is the flow of the application.

    Regards,

    Samhitha

  • Hi Samhitha,

    I tried writing a python script for the same using the flowchart 
    But I am getting this error 

    **********************************************
    Debug: Secondary Bootloader Application Start
    **********************************************
    Press any key to stop auto boot and Update Meta Image...
    Loading existing Meta Image from Flash in 20 19 18
    Debug: Update Meta Image selected

    Debug: Device info: Manufacturer: 0, Device type = 0, Capacity = 0

    Debug: Loading application metaImage from Flash address: c0040000
    Debug: Erasing SFlash...
    Debug: Flash Erase complete
    Debug: Start the image download using XMODEM over UART Or Hit 'Space Bar' to start Image download ove CAN interface
    CCCCCDebug: Total data written = 0x202440
    Error: Meta header absent!!!

    Error: Could not download the metaimage to RAM. Trying to boot the backup factory default image.

    Debug: Loading backup factory default image from Flash address: c0180000
    Error: Meta header absent!!!

    Error: Could not download the backup factory default image metaimage to RAM. Resetting the board to retry

    When does this issue occur ?

    Is there a way to debug this issue as far as I know we cannot debug this application as when I flash the debug file and try to attach the .xerf file of can sbl to mss core but it no initialized in halted state rater it begins in running state

    Similar to this issue 

    Thread


    Also could you explain this bit of code

    /**
     *  @brief Metaheader start word.
     */
    #define SBL_META_HDR_START (0x5254534DU)
    
    /**
     *  @brief Metaheader end word.
     */
    #define SBL_META_HDR_END (0x444E454DU)

    Edit- After further research I think the issue is with CRC 

    Any idea how to resolve this issue ?

    Because I am getting error at this line of code 

    #define SBL_META_HDR_START (0x5254534DU)
    .....
    
        if (metaHeaderStart != SBL_META_HDR_START)
        {   
            gSblMCB.metaHdrAbsent = 1U;
            gSblMCB.errorStatus |= SBL_METAHEADER_NOT_FOUND;
            numBytesRead = 0U;
        }
        
    
    .....    
    

    Kindly let me know if I am thinking in the right direction

    Thanks and Regards

  • Hi Tanoop,

    MetaImage has a meta header. Seems like you are trying to flash the binary which doesn't have the metaheader. You can try flashing SBL from mmwave_sdk_<ver>-LTS\packages\ti\utils\sbl\xwr18xx_sbl.bin. This is a screenshot of the metaheader where the start and end words are highlighted.

    Is there a way to debug this issue as far as I know we cannot debug this application as when I flash the debug file and try to attach the .xerf file of can sbl to mss core but it no initialized in halted state rater it begins in running state

    You can add a while(1) to debug.

    Regards,

    Samhitha

  • Hi Samhitha,

    So here are the steps that I followed as mentioned in the CAN_SBL_User_Guide

    1.The Meta-Image for SBL application will be created automatically along with the out file upon compiling this application. Note that this image will contain only the MSS binary (no BSS or DSS binary). This Meta-Image needs to be flashed once using the conventional method (uniflash).

    2.Find the COM port which shows as “XDS110 Class Application/User UART” under device manager, and connect to it using Terraterm.

    3.Restart the device by pressing the “SW2” on the EVM.

    4.Hit “Enter” on the console.(application will start erasing the portion of SLFASH)

    5.Start transmitting from the PC based CAN application (This application uses PCAN (Peak) USB-CAN adaptor to download firmware to device.)

    6.Once the PC application has sent the complete Meta-Image over the CAN, the console will show the total number of bytes transferred. This can be used to ensure that the complete image has been transferred.

    And I am also getting the Debug: Total data written = 0x202440 message so I think the CAN Application is also working fine.

    I put in some more debug statements in between here's what I found 


    *readPtr=1381258061
    metaHeaderStart=1381258061

    This is when the flashing goes right (ie when the factory backup is loaded)

    but when I try using download the metaimage from CAN i get different values for both these variables hence failing at below lines of code 


    readPtr = &(gSblMCB.inputBuffers.bufferPrms[gSblMCB.inputBuffers.readBufferIdx].inputBuffer[0U]);
    ...
    ...
    bytesRead = SBL_stateMetaHeaderParser(readPtr);
    ....
    ....
    SBL_stateMetaHeaderParser(uint32_t readPtrLcl[])
    { ...
    bytesRead = SBL_metaHeaderParser(readPtrLcl);
    ...
    }

    uint32_t SBL_metaHeaderParser(uint32_t bufferPtr[])
    { ...
      metaHeaderStart = *bufferPtr;
      ....
    if (metaHeaderStart != SBL_META_HDR_START)
     {
           gSblMCB.metaHdrAbsent = 1U;
           gSblMCB.errorStatus |= SBL_METAHEADER_NOT_FOUND;
          numBytesRead = 0U;
     }
    ....
    }

    Regards

  • Hi Tanoop,

    metaHeaderStart=1381258061

    This value in hex is 0x5254534D. If you see my previous reply, SBL has a metaheader and it starts with 0x5254534D. Did you try flashing SBL from mmwave_sdk_<ver>-LTS\packages\ti\utils\sbl\xwr18xx_sbl.bin?

    but when I try using download the metaimage from CAN i get different values for both these variables

    Can you please confirm if you are flashing the SBL or application binary using CAN? 

    Regards,

    Samhitha

  • Hi Samhitha,

    I am trying to download the Application file ie (MRR Lab in my case) through CAN and this SBL_LAB through uniflash
    My application file(MRR_LAB.bin) also has the similar values as header



    I also tried your solution of flashing the   mmwave_sdk_<ver>-LTS\packages\ti\utils\sbl\xwr18xx_sbl.bin file through uniflash but this SBL accepts application file through UART(XMODEM) which is not currently my use case I wanted to download through CAN

    Edit:

    To try and check if the forward logic after the CAN /  Xmodem download is working in the SBL I tried to download using Xmodem which was successful

    **********************************************
    Debug: Secondary Bootloader Application Start
    **********************************************
    Press any key to stop auto boot and Update Meta Image...
    Loading existing Meta Image from Flash in 20 19 18 17 16 15 14 13 12
    Debug: Update Meta Image selected

    Debug: Device info: Manufacturer: 0, Device type = 0, Capacity = 0

    Debug: Loading application metaImage from Flash address: c0040000
    Debug: Erasing SFlash...
    Debug: Flash Erase complete
    Debug: Start the image download using XMODEM over UART Or Hit 'Space Bar' to start Image download over CAN interface
    CCDebug: Total data written = 0x40980
    Debug: Parsing completed

    And the application is running as expected.

    But one peculiar thing I noticed is that although I am flashing the same file through both the methods 
    The number of bytes written in CAN and XMODEM are very different (these are from the debug statements )
    In XModem - Total data written = 0x40980 (33Kb)

    In CAN -  Total data written = 0x204840 (264Kb)

    And the original size of the file is around 258Kb

    But the question still persist why I am facing the issue while trying to download using CAN 

    Regards,

    Tanoop

  • Hi Tanoop,

    when I try using download the metaimage from CAN i get different values for both these variables

    Can you check what is the value of metaHeaderStart when you flash the application using CAN? Also compare the data written to the serial flash with the application binary that you are flashing to ensure that the image is flashed successfully.

    Regards,

    Samhitha

  • Hi Samhitha,

    I fixed the issue. I was transmitting the data in the classic CAN format with 8 bytes (DLC). However, after studying the code more closely, I realized that it was expecting messages in the CAN FD format with 64 bytes DLC.

    Regards,
    Tanoop