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.

MCU-PLUS-SDK-AM243X: SBL with USB

Part Number: MCU-PLUS-SDK-AM243X


Hi,

I am developing SBL with USB DFU download.

I used sbl_uart example project, I removed all serial download code, and I added USB download code. It created the tiboot3.bin file and I copied this file to SD card. 

I am using AM243x-EVM hardware with SD boot mode. When turn power on the board, it starts the USB module and waits for the downloading image from PC.

I created a downloadable image with hello_world project. It created hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage file after building project. I downloaded this .appimage file via USB.

My SBL USB successfully downloaded .appimage via USB. It calls below bootloader APIs without errors.

1. Bootloader_parseMultiCoreAppImage()

2. Bootloader_loadSelfCpu() for both Core0 and Core 1

Finally, it calls Bootloader_runSelfCpu() but bootloader doesn't run downloaded hello_world application.

Here is debug log for your reference:

USB download status=0, fileSize=38000
INFO: Bootloader_loadSelfCpu:203: CPU r5f0-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_loadSelfCpu:203: CPU r5f0-1 is initialized to 800000000 Hz !!!
Calling Bootloader_runSelfCpu()
INFO: Bootloader_runSelfCpu:213: All done, reseting self ...

Please help to debug why bootloader is not running downloaded application.

  • Hi Chaehee,

    Few pointers to help you debug.

    • Did Bootloader_parseMultiCoreAppImage() return SystemP_SUCCESS ?
    • What is the value of bootImageInfo.cpuInfo[CORE_ID].clkHz ? Do you use bootImageInfo.cpuInfo[CORE_ID].clkHz = Bootloader_socCpuGetClkDefault(COREID);Call this before Bootloader_loadCpu
    • Now what is the order for the call of Bootloader_loadCpu API ? I suggest you to call Bootloader_loadCpu for R50_1 before R50_0. Try Bootloader_loadCpu instead of Bootloader_loadSelfCpu. Although Bootloader_loadSelfCpu should work fine too.
    • Call Bootloader_runCpu for R51_0 first and then call Bootloader_runSelfCpu for R50_0

    I hope that helps.

    Best Regards,

    Aakash K

  • Hi Aakash,

    Yes, Bootloader_parseMultiCoreAppImage() returns SystemP_SUCCESS. 

    I used same code as sbl_uart example project and below is part of code. You can find out value from the debug log.

    /* Set clocks for self cluster */
    bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0);
    bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_1);

    As I mentioned, I used sbl_uart example project code. I just replaced UART to USB for downloading application image. After downloading application image, load and run code is same (no changes). Can you confirm sbl_uart example project is validate on your side?

    I will try your suggestion of the load API and will let you know.

    Thanks,

    ChaeHee

  • Hi Aakash,

    Now what is the order for the call of Bootloader_loadCpu API ? I suggest you to call Bootloader_loadCpu for R50_1 before R50_0. Try Bootloader_loadCpu instead of Boot

    I changed the calling Bootloader_loadCpu API order (R50_1 and R50_0) but R50_1 call failed because there is no image for R50_1.

    I changed the calling Bootloader_loadCpu API (no order change, R50_0 and R50_1). It also failed because of the same CPU. I think I have to use Bootloader_loadSelfCpu API.

    Call Bootloader_runCpu for R51_0 first and then call Bootloader_runSelfCpu for R50_0

    I think R51_0 is typo. So, I called R50_1 first and then call Bootloader_runSelfCpu for R50_0. But it is not running downloaded application.

    Can you answer my question below?

    Can you confirm sbl_uart example project is validate on your side?

    Best regards,

    ChaeHee

  • Hi Chaehee,

    Yes, the sbl_uart example is functional.

    Understanding your problem.. Your SD Boot has a custom sbl which configures the USB in CDC mode which allows serial communication. You are using the same XMODEM protocol in sbl_uart example to transfer the .appimage which also sounds correct (and its works too).

    Are you checking the logs of hello world on correct serial port ?

    Best Regards,
    Aakash Kedia