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.

AWR2944: How to write a new .appImage file to flash over the serial interface while in qspi boot mode?

Part Number: AWR2944
Other Parts Discussed in Thread: UNIFLASH,

Hi team,

Here's an issue from the customer may need your help:

1)  A normal burn should switch to UART boot mode and requires 3 files UART_uniflash.release.tiimage, SBL_release.tiimage, appimage files. The first file, UART_uniflash.release.tiimage, is used to booting the two subsequent files to the fixed location in flash.

When in qspi boot mode, is it possible to only burn the .appimage file each time when update the firmware, leaving the SBL and UART_uniflash files unchanged? Or is it possible to switch boot mode through the registers without replacing the SOP? 

2) After the burn is complete, the AWR2944 needs to be reset to boot from flash again. How to implement a soft reset? And is there a reset method similar to the one mentioned in this doc

3) The burn process through the serial interface is slow and takes about 1 minute. Serial mode is interrupt mode and readmode is block, so you need to pause DPC and frame first and then restart after the burn is complete. How to achieve that? 

4) As mentioned in Q1, UART_uniflash.release.tiimage temporarily stores the .appimage file received from the serial port and writes it to flash by allocating a piece of memory in DSS L3. How to request memory on DSS through the MCU's program while the board is working? Is there any function that can see the current memory usage of the 2944? 

Could you help look into this case? Thanks.

Best Regards,

Cherry

  • Hello Cherry,

    1) Only through the SOP you can change the boot modes, no direct register writes.

    2) For AWR2944 you can refer the C:\ti\mmwave_mcuplus_sdk_04_03_00_01\mcu_plus_sdk_awr294x_08_04_00_22\examples\drivers\boot\sbl_qspi\awr294x-evm\r5fss0-0_nortos\main.c line 149 status = Bootloader_runSelfCpu(bootHandle, &bootImageInfo); where the soft reset is being performed.

    3) Currently this is the only available option provided, you can make the necessary changes depending on your use case. Please do go through the MCU_PLUS SDK examples and drivers to have a better understanding.

    4) You can refer the function Bootloader_socMemInitCpu available in C:\ti\mmwave_mcuplus_sdk_04_03_00_01\mcu_plus_sdk_awr294x_08_04_00_22\source\drivers\bootloader\soc\awr294x\bootloader_soc.c . This also shows the L3 initialization.

    Regards,
    Saswat Kumar

  • Hi Saswat Kumar,

    Thanks for your suppport.

    2) For AWR2944 you can refer the C:\ti\mmwave_mcuplus_sdk_04_03_00_01\mcu_plus_sdk_awr294x_08_04_00_22\examples\drivers\boot\sbl_qspi\awr294x-evm\r5fss0-0_nortos\main.c line 149 status = Bootloader_runSelfCpu(bootHandle, &bootImageInfo); where the soft reset is being performed.

    Calling the function Bootloader_runSelfCPU only resets the arm R5F. When the customer calls this function in a function defined in the CLI, the program cannot work properly and the function is located in the main program of SBL after the SBL boot .appimage file is complete.

    What customers want to do is they can re-run the SBL function and start running from RBL when receiving the CLI command.

    Also the customer referenced this doc, a reset can be performed using CLI commands in the SDK4.3.1 release, but is still not available in the SDK4.2.2 release. 

    Thanks and regards,

    Cherry

  • Hello Cherry,

    If you want to perform a reset to start from the RBL you will have to perform a soft reset from the software: 

    You can refer the TRM for the above mentioned section.
    Also use the latest SDK 4.3.0.1 for performing the warm reset as previous bugs related to the same have been fixed.

    Regards,
    Saswat Kumar

  • Hi Saswat Kumar,

    Receive the appimage file sent from the upper computer over the serial port in qspi mode, and use UART_uniflash.tiimage to burn the script in UART boot mode where the appimage file is received from the serial port using the xmodem protocol. However, this burn script is not available in qspi mode, is it ok to read files directly using the UART_read function? Is there a possibility of a file read error? 

    Could you help specify how to set up memory on L3 of DSS for temporary storage of appimage and then write to flash? The function you mentioned Bootloader_socMenInitCPU initializes the bank about L3 without allocating memory.

    The following memory requests in UART_uniflash.C:

    #define BOOTLOADER_UNIFLASH_MAX_FILE_SIZE (0x200000) /* This has to match the size of DDR section in linker.cmd */
    uint8_t gUniflashFileBuf[BOOTLOADER_UNIFLASH_MAX_FILE_SIZE__attribute__((aligned(128), section(".bss.dss_l3")));
    The function Bootloader_socCpuPowerOnReset (CSL_core_ID_C66SS0) is called in the main function of UART_uniflash.C. And then inside of that function, they have called the function Bootloader_socMenInitCPU mentioned above. Is this possible?

    When the customer attempts to allocate memory this way, the program gets stuck after calling the function Bootloader_socCpuPowerOnReset. Why is this? Is it required to shut down the DSP core before calling this function?
    Thanks and regards,
    Cherry
  • Hello Cherry,

    There is no direct code available for the download over UART in QSPI boot mode.
    We have the reference example of SBL_QSPI and SBL_UART_UNIFLASH. Customer can combine both to achieve download over UART in QSPI bootmode over SBL.
    I am not able to find any UART_uniflash.C in the SDK or ti resources. Could you check that once?

    Regards,
    Saswat Kumar

  • Hi Saswat Kumar,

    The customer now is able to reboot, but will receiving a 0x0A at startup when reading the appimage file sent from the serial port. After several tests, the character remains.

    And they have reviewed the appimage file, this 0x0A is not a character in it. Currently it can be fixed through reading one more character from the serial port and skipping the first character when writing flash.

    Will this happen by accident OR will it always happen? And how to avoid it? Doing so will cause errors in the appimage file written to flash, causing SBL to fail.

    The code is as follows:

    static int32_t MYRESETFUNCTION(int32_t argc,char* argv[])
    {
        uint32_t filesize = 0;
        if(argc<2)
        {
            return 0;
        }
        else
        {
            CLI_write("FILESIZE=%s\r\n",argv[1]);
            filesize = atof(argv[1]);
        }
        CLI_write("filesize = %d\r\n",filesize);
        CLI_write("COPY appimage file\r\n");
        //Read the appimage file from the serial port 
        uint32_t done = 0U;
        rlFrameStartStop(1,0x0000);   //Stops the transmission of the signal frame and now specifies a device map id of 1 
        ClockP_usleep(1000);//Wait for the current frame to complete and close the front end. 
        uint8_t *databuf1 = (uint8_t *)(0x88000000);
        UART_Transaction trans;
        while(!done)
        {
            UART_Transaction_init(&trans);
            trans.buf = databuf1;
            trans.count = filesize+1;   //Read space + 1 of 1M 
            if(!UART_read( UART_getHandle(1),&trans))
            {
                Bootloader_uniflashFlashFile(0,databuf1+1,filesize,0xA0000);//+1 is to skip the 0x0A received for each fix 
                UART_write(UART_getHandle(1),&trans);    //Prints the received data, dcb.fNULL = 0; 
                CLI_write("END OUT PRINT\r\n");
                done = 1;
            }
            else
            {
                CLI_write("RECEIVE ERROR\r\n");
            }
        }
        //Re-enter reboot mode 
        uint32_t baseAddr;
        volatile uint32_t *kickAddr;
        uint32_t i=0;
        //uint32_t value = 0;
        baseAddr = CSL_MSS_TOPRCM_U_BASE;
        kickAddr = (volatile uint32_t*)(baseAddr+CSL_MSS_TOPRCM_LOCK0_KICK0);
        CSL_REG32_WR(kickAddr,KICK0_UNLOCK_VAL);
        kickAddr = (volatile uint32_t*)(baseAddr+CSL_MSS_TOPRCM_LOCK0_KICK1);
        CSL_REG32_WR(kickAddr,KICK1_UNLOCK_VAL);
        uint32_t*regAddr = (uint32_t*)0x02140100;
        uint32_t dbg = *regAddr&0xFFFFF8FF;
        while(i<0xFFFF)
        {
            i++;
        }
        *regAddr = dbg;
        return 0;
    }

    Thanks and regards,

    Cherry

  • Hi,

    May I know is there any update? 

    Thanks and Regards,

    Cherry

  • Hello Cherry,

    Could you please proobe the UART lines and check if the 0x0A is visible on the probe log?

    Regards,
    Saswat Kumar