SK-AM64B: Problem flashing example

Part Number: SK-AM64B
Other Parts Discussed in Thread: UNIFLASH, , SYSCONFIG

Tool/software:

Hi,

I'm trying to follow the SDk user guide to flash an already build example. My example is hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64. 

The code run in debug and in release from CCS, my CCS is uptodate, the SDK version is 11.01.00.17.

I flash using the instructions from: https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/GETTING_STARTED_FLASH.html

my flash config file contains the following lines:

--flash-writer=sbl_prebuilt/am64x-sk/sbl_uart_uniflash.release.hs_fs.tiimage

#--operation=flash-phy-tuning-data

--file=sbl_prebuilt/am64x-sk/sbl_ospi.release.hs_fs.tiimage --operation=flash --flash-offset=0x0

--file=<workspace_ccstheia>/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64/Release/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64.appimage.hs_fs --operation=flash --flash-offset=0x80000

The flash operation run without problem, but when I'm trying to run the code from the board, after setting up the board to boot in  OSPI mode the serial console show only this:

DMSC Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
DMSC Firmware revision 0xb
DMSC ABI revision 4.0

What is wrong?

Kind regards,

Andrea Tosetto

  • Hi Andrea,

    Are you testing this on a TI EVM? If yes, I can test this at my end to see if I can reproduce this issue.

    Best Regards,

    Meet.

  • Hi Meet,

    I'm testing it on a SK-AM64B board. If you need more information please ask.

    Thank you very  much.

    Andrea

  • Hi Andrea, I am also observing this issue at my end, I will test further and update you.

  • Hi Andrea,

    Hello World example on A53 and SBL OSPI use the same UART instance, this issue seems to be due to both of them trying to access the same UART, you can use a different UART Instance(like USART1) for the A53's Hello World example to resolve this issue.

  • Hi Meet,

    I tried to change UART to USART1 from example.sysconfig file. but now i cannot see the code output to the console (I'm monitoring both COM6 and COM5 - CP2015 USB to UART Bridge).

    Should I change also other parameters in the sysconfig file?

  • Try to change it to MCU_UART0, you will be able to observe the logs on COM6 if you use this UART.

    Are you able to observe at least the boot logs on COM5?

  • Now I've changed the UART to MCU_UART0 on the debug log in the sysconfig:

      

    I run the code from CCS and I can see the output. But when I flash it to the board, after changing the boot mode to OSPI, I can see: 

    DMSC Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    DMSC Firmware revision 0xb
    DMSC ABI revision 4.0

    On COM6 and nothing on COM5!

  • I run the code from CCS and I can see the output.

    So, when you load the program from CCS it works as expected, this confirms the issue with SBL and A53 application using the same UART, could you share the logs for this as well.

    Are you changing the UART instance for SBL or for the A53 Hello World application? Please share your hello_world appimage as well as .out with me.

  • Yes, I can run the hello world and also other examples just following the getting started guide. 

    I'm changing the UART of the console log in the sysconfig file:

    I would like to share files and logs but: 

    How can I add file to this forum? (I tryied Insert-> Image/Video/FIles but I cannot link my files)

    Is there a specific log file that I can share to you?

    Regards,
    Andrea

  • Hi Andrea,

    Please allow me 1-2 days to test this at my end.

    Best Regards,

    Meet.

  • Hi Meet, have you tested my code?

  • Hi Andrea,

    Apologies for the delay. The expert is currently out of office. He will get back to you once he is back.

    Thanks,
    Shreyansh

  • Hi Andrea,

    Can you try the steps suggested in the  [FAQ] AM62X/AM64X : [FAQ] Debugging SBL boot in RTOS SDK  and debug the SBL application to see whether it is stuck somewhere or not?

    Regards,

    Tushar 

  • Hi Tushar,

    thank you for he suggestion, but up unfortunatelly I'm not able to use gmake, my PC run windows 11 and I didn't find a way to run gmake! Do you have some suggestions or alternatives?

    Regards,
    Andrea

  • Hi Andrea,

    Are you getting some error? If yes, please share the error logs.

    I'm not able to use gmake,

    Is gmake installed on your system?

    Regards,

    Tushar

  • Hi Tushar,

    now I found a way to install gmake (make) from this site "https://gnuwin32.sourceforge.net/packages/make.htm"

    I move into the MCU plus root folder and launch this: make -s -C .\examples\drivers\boot\sbl_ospi\am64x-sk\r5fss0-0_nortos\ti-arm-clang PROFILE=debug

    this is the output of the command:

    process_begin: CreateProcess(NULL, C:/ti/ccs2020/ccs/utils/cygwin/mkdir -p obj/debug/, ...) failed.
    make (e=2): Impossibile trovare il file specificato.
    make: *** [obj/debug/] Error 2

    Regards 

    Andrea

  • Hi Andrea,

    Looks like you don't have CCS v20.2 installed on your system. If you are using a different version of CCS then update the CCS install directory path in imports.mak file in the SDK root directory.

    Please install all the dependency tools to build the example.

    Regards,

    Tushar

  • Thank you Tushar! Your suggestion works, 've to manage other changes in the imports.mak file but now it compiles! 

    Then I move to the next steps, I do not have any experience in debugging with HIL!! 

    Regards,

    Andrea 

  • Hi Andrea,

    Thanks for confirmation.

    I do not have any experience in debugging with HIL!! 

    sorry, I didn't understand the above. What is HIL?

    The FAQ provided above has the steps on how to debug SBL example. You can follow the same steps.

    Regards,

    Tushar

  • I tried, I modify the sbl with a while loop, the make command output said there are no error:

    I didn't use the sbl_null like in the example but the one I use for the hello world example. 

     Boot image: am64x:r5fss0-0:nortos:ti-arm-clang C:/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/drivers/boot/sbl_ospi/am64x-sk/r5fss0-0_nortos/ti-arm-clang/sbl_ospi.debug.hs_fs.tiimage Done !!!

    I flash the image and setup the boot mode to ospi. 

    Then I connect the board but it is not clear to me how to procede for Connect to CCS and single step

    Could you please help me?

    Many thanks 

    Regards.

  • Hi Andrea,

    If you are using the SBL_OSPI binary for flashing, you need to modify the sbl_ospi example as mentioned in the above FAQ.

    After modification flash the modified SBL_OSPI binary to the SOC, and keep the EVM in OSPI boot mode after flashing.

    Power on the SOC and connect to R5F0-0 core, then load symbol using the flashed ospi_sbl binary. Once loaded change the loop variable to exit from the loop.

    Use CCS debugging technique to debug the example step by step. To debug using CCS, please refer CCS_LAUNCH.

    You can also refer ccs_debug-debugging-the-application.  

    Regards,

    Tushar

  • Hi Tushar,

    Thank you very much for your suggestions, I found how to proceed with debugging the OSPI SBL. 

    I can execute until the line:

    status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);
     
    The output on the COM6 is:
    DMSC Firmware revision 0xb
    DMSC ABI revision 4.0

    ...

    Now, how can I do to proceed in deugging?

    Kind regards,

    Andrea

  • Hi Andrea,

    Have you checked what is the value of status returned by the Bootloader_parseMultiCoreAppImage API?

    If it is returning failure, have you step into the API to see from where it is failing?

    Regards,

    Tushar

  • Just an Update to my message: 

    today teh first time I debug the sbl I fou nd that it stopped to this line (71):

    Bootloader_socResetWorkaround();
    if I continue and then pause the debugger I found that the program is freezed by and infinite loop at 
      int32_t Sciclient_waitForBootNotification(void)
    at line 661: 
    while ((CSL_REG32_RD(Sciclient_secProxyThreadStatusReg(rxThread)) &
                 CSL_SEC_PROXY_RT_THREAD_STATUS_CUR_CNT_MASK) == 0U) {;}

    The call stack is:
    Sciclient_waitForBootNotification() 0x7001692Csciclient.c661:9
    Bootloader_socWaitForFWBoot() 0x70020736bootloader_soc.c1102:5
    main() 0x70002DE2main.c69:10
    bypass_auto_init + 0x4 () 0x70021E70boot_armv7r_asm.S278:0

    The second time I run the code (stop debug relauch "Start Project-less Debug e go on the same steps as before) it didn't stop there,

    it stop in line 1370 of bootloader.c inside the function Bootloader_parseMultiCoreAppImage:

    status = config->fxns->imgReadFxn(&mHdrStr, sizeof(Bootloader_MetaHeaderStart), config->args);

    if I continue and then pause the debugger I found that the program is freezed by and infinite loop at HwiP_user_data_abort_handler_c.

    The call stack is:

    HwiP_user_data_abort_handler_c() 0x700212F4HwiP_armv7r_handlers_nortos.c393:5
    HwiP_data_abort_handler_c() 0x700212ACHwiP_armv7r_handlers_nortos.c374:1
    HwiP_data_abort_handler + 0x30 () 0x700213A0HwiP_armv7r_handlers_nortos_asm.S140:0

  • Looks like you are loading the binary incorrectly.

    After flashing you need to connect to the R5F0-0 core and click on Load Symbol instead of Load Program. From above it looks you are doing Load Program.

  • Hi,

    yes I do "load Symbols" and I point to the debug.out file.

  • I am sharing my project which I am using and is supposed to work on your setup also.

    Please modify the path of SBL and Hello World example in default_sbl_ospi.cfg file with the below provided project's binary path.

    Hello-World - hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64.zip

    SBL OSPI - sbl_ospi_am64x-sk_r5fss0-0_nortos_ti-arm-clang.zip

    After using the above projects you should be able to see the logs on Application/User UART. Open all the 4 UART ports and check for the logs.


  • Hi Tushar,

    I mark your suggestion as This do not resolve the issue but mow I cannot reply to the last topic anymore, in any case I write here my reply:

    Thank you for the files, I tested it but it doesn't work again, same results, I connect 4 COM ports,
    1 - COM6 USB to UART Bridge Standard COM
    2 - COM5 USB to UART Bridge Enhanced COM
    3 - COM11 XDS110 Application/UserUART
    4 - COM12 XDS110 Auxliary Data Port

    Only from the COM6i read something when I reboot the board:

    DMSC Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    DMSC Firmware revision 0xb
    DMSC ABI revision 4.0

    Since we have 2 board and no one can work, maybe is something wrong in the procedure I use to connecto to the board.

    So, i recap my procedure in order to get if there are errors in the steps aI done:

    1) Flashing the application - following the example oin software-dl.ti.com/.../GETTING_STARTED_FLASH.html
    a)Set boot mode to UART
    b)check if the board print "C" on UART (COM6)
    c)from a command promt, in the "tools/boot" folder I run python uart_uniflash.py -p COM6 --cfg="cfg file"

    Here is the cfg file:
    "
    # First point to sbl_uart_uniflash binary, which function's as a server to flash one or more files
    --flash-writer=sbl_prebuilt/am64x-sk/sbl_uart_uniflash.release.hs_fs.tiimage
    # Now send one or more files to flash or flashverify as needed. The order of sending files does not matter
    # When sending bootloader make sure to flash at offset 0x0. ROM expects bootloader at offset 0x0
    --file=C:/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/drivers/boot/sbl_ospi_am64x-sk_r5fss0-0_nortos_ti-arm-clang/sbl_ospi.Debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    # When sending application image, make sure to flash at offset 0x80000 (default) or to whatever offset your bootloader is configured for
    --file=C:/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64/Debug/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64.appimage.hs_fs --operation=flash --flash-offset=0x80000
    # send the XIP image for this application, no need to specify flash offset since flash offset is specified within the image itself
    --file=C:/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64/Debug/hello_world_am64x-sk_a53ss0-0_freertos_gcc-aarch64.appimage_xip --operation=flash-xip
    "

    d) At the end the flashing process comes out with a success!

    2) Running the application - following this: software-dl.ti.com/.../GETTING_STARTED_FLASH.html
    a) Power OFF
    b) setup OSPI/xSPI boot mode
    c) connect all the COM port to 4 different teraterm windows (but it is the same using CCS)
    d) power on

    There is something wrong with this?

     

  • Can you please confirm the path of binary provided in the cfg file above is updated properly?

    I can see the appimages are still coming from the SDK. Have you not updated the path of binary with the provided files?

    Also you do not need to flash the xip appimage. you can comment or remove this command from the cfg file.

  • YEs I can confirm that the cfg point to the files you send me last week. I placed then in the SDK folder.

    I comment the last line (xip) and flash again but the result is the same. 

  • Can you try once after disabling the UART logs from A53 example and see what logs are you getting on the console from SBL binary?

  • I suppose I can do it, but I don't know how to disable UART logs, could please point me to a procedure?

  • Disable the UART log option in the example.syscfg file and rebuild the application.

  • Thank you, I follow your instructions, rebuild, and then here is the output:


    DMSC Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    DMSC Firmware revision 0xb
    DMSC ABI revision 4.0

    Regards,

    Andrea

  • Hi,

    Tushar is currently out of office, if there is a pending follow up from him, you can expect it by end of next week.

    Thanks,

    Vaibhav

  • Looks like the SBL example has not run successfully on the device. You should get output similar to what is shown here.