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: Debugging the Bootloader with SDK 08.06

Part Number: MCU-PLUS-SDK-AM243X

Hello,

I am currently updating our SDK from 08.04 to 08.06.

At first we have a mix of Sitaras with gp and hs-fs around in our development. I am currently only using a gp-device before trying this with hs-fs.

I tried to debug the Bootloader but in conctrary to SDK 08.04 we used before I connot debug the bootloader anymore.

The setup is as followed:

- Bootloader flashed on device
- device powered up and running
- connect via CCS
- load Bootloader-image (.elf)

Before the update you just could move to the line after Bootloader_socWaitForFWBoot() and continue running and it worked.
Now this does not work anymore. Every communication via the SciClient hangs in a loop waiting for an Sci-message. So at Sciclient_boardCfgPm or Bootloader_socOpenFirewalls or Bootloader_socNotifyFirewallOpen and so on.

So I thought maybe the issue is located in combination with the SysFw?
Since It already works when booting from flash I guess the SysFw is successfully loaded and thus should be reachable.

We use the updated SysFw.bin from the SDK at /source/drivers/sciclient/soc/am64x_am243x and the boardcfg-blob from /source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin

We use Cmake but here is the snippet we use for SBL-image-generation for GP-devices:


Are there any new additional steps that need to be done?

Best regards

Felix

  • Hi Felix,

    Let me check the same and come back to you. I am assuming you are using combined boot mode for both the device types. 

    Best Regards,
    Aakash

  • Hi Felix,

    What is the type of bootloader which is being used here ? Also, is the security handover done in the device or not ?

    If the security handover is done, the device cannot claim some of the SYSFW services mentioned here - http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/security_handover.html?highlight=handover

    Hope it helps.

    Best Regards,
    Aakash

  • Hey Aakash,

    we are using the SBL_OSPI as a base and modified the code for our update-/fw-image-architecture. We also followed the makefiles there to set the right settings for the created images and so on. So yes we are using the new combined bootflow.

    In fact I did not change anything instead adding the latest changes from the SBL_OSPI-example which is after Bootloader_socWaitForFWBoot where the checks for reset-isolation are done, but it's not even coming that far. The rest is still the same. The migration guide in the sdk-documentation just mentions to use this Bootloader_socWaitForFWBoot and sign the image different which we already did so I'm not sure what to do more.

    Currently somehow it does not even boot from flash anymore and hangs all the time waiting for the DMSC. I will have a look into the security handover but I am honestly not sure what to do with this. We never did any security handover on purpose. If there is anything then it is done inside the SDK-functions?

    In fact we are always stuck here (pls note we changed the bootconfig to our own needs, that's why it's displayed here):

    So there is no security handover directly done by us and I am not sure how I can influence this.

    Best regards

    Felix

  • so in addition, this happens with all other images loaded afterwards. E.g. the uart uniflash-image also hangs waiting for an sciClient-message. When "resetting" the device to no-boot and initializing it with our modified launch-script, which in fact also just loads the same SysFw, I can load the bootloader image and it works just fine. 

    but here we also use a ccs-init-elf-file from /tools/ccs_load/am243x/sciclient_set_boardcfg.release.out which is done after the SysFw-load. does this contain a different board-config?

    So it seems to be problem with the created flashed image. Somehow the new Sysfw-file or board-cfg inside the SDK is not working with our gp-devices anymore.

    I also checked the security-handoff but as I undertand for GP this is not relevant. I guess we are not using the gBoardConfigLow_security but the gBoardConfigLow. Did the boardcfg_blob.bin maybe change? we are just taking directly this one. Since a pin-routing was fixed in the new SDK, we just did update the boardcfg without any changes and thus we thought that the present blob does not need to be recompiled. Could this be the issue here?

    Best regards

    Felix

  • Hey Aakash,

    as I understood the boardcfg is part of the image on the flash together with the SysFw and the SBL. And all those are loaded by the RBL. At least the bootflow-migration guide tells: https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/BOOTFLOW_MIGRATION_GUIDE.html

    Since I have no impact on the RBL, how can I skip the board-cfg?

    The SBL debug currently works in such sense that I can load the bootloader-image including SysFw, the board-cfg and our SBL onto the Flash but then it won't start up after repowering and if I connect i hangs inside the Bootloader_socWaitForFWBoot.

    Sorry for the confusion: the behaviour changed in contrary to the first post. The device cannot boot from flash anymore at all.

    Best regards

    Felix

  • So I tried rebuilding the board-cfg like described in the documentation https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/RESOURCE_ALLOCATION_GUIDE.html#autotoc_md420

    The board_cfg-blob stays the same. But then I just checked the rm directly inside the c-file and saw this change:

    The TISCI_HOST_ID_MAIN_0_R5_0 is a secure context. Could this be an issue? Anyway I changed it back to the right settings and it still won't start and hangs in waiting for boot notification. Also there are a lot of secure-context-host-ids, I hope this is fine.

    Also I tried having a look at it with the respart-tool but Unfortunately it does not work, there are some erros with "unable to move cache" since access-permissions are not working.

    I am clueless how to proceed currently. And since the sciclient_set_boardcfg.release.out under tools/ccs_load/am243x does work via the launch-scripts, I am confused since I thought it loads the same board-config that is part of the flashable boot-image. But here seems to be a difference.

    Best regards

    Felix

  • Hey Aakash,

    to identify the problem I tried reverting the used sysfw and board-cfg when creating the sbl-package to our 08.04-implementation.

    Unfortunately also this combination does not proceed after waitForFWBoot()!

    So probably neither the SysFw nor the board-cfg are the problem.

    To track it down I used the loop_forever but still I cannot proceed, any other function using the sciClient hangs by waiting for a response.

    Somehow the Cmake-Screenshot of the first post disappeared. This is our sbl-image-creation derived from the make-files:

    It's mainly the same from the make-files of the SBL_OSPI-example. Has something changed in the signing-scripts that can cause this behaviour? I checked the scripts but for the relevant parts there doesn't seem to be any changes.

    I will try to revert the sciclient-folder tomorrow and see if that works, since there are some new message-ids and struct-entries. If this helps then probably the sysfw is not compatible with the sciclient-source inside the SDK for gp-devices?

    Best regards

    Felix

  • Hey Aakash,

    so finally I think I found at least what influences the problem. I cannot say why this is happening but:

    It seems it doesn't matter what SysFw or board-cfg I use. As soon as I drop the SysCfg and use our own drivers for initializing our bootloader, it won't work.
    I don't know why exactly because the waitForFWBoot() is called before all the other stuff is initialized by SysCfg. I also ensured that the MPUs and CaheP_Init is set up before.

    What in fact happens is that the register at 0x4a600000 does not get the Bit 0 set to 1. As soon as I load an image with a Bootloader configured with SysCfg - same SysFw and boardcfg! - it magicaly works and this bit gets set and the Bootloader can proceed. I tested this with the loop_forever() at start of main().

    I cannot find more information about that inside the TISCI-documentation. It only says "Flags and sequences desired are very specific to processor and SoC involved. Please refer to appropriate documentation for accurate sequencing and status information."

    Where can I find this documentation?

    Or do you maybe know what happens before what I could've missed?

    Best regards

    Felix

  • Hi Felix,

    Let's have a debug session for the same. It seems like there are a lot of items there were tried by you and still I am not able to comprehend what went wrong here. If we could take a look at your experimentations, then it would really speed up the debug.

    Best Regards,
    Aakash

  • Hey Aakash, great idea, I did send you a message.

  • Hey Aakash,

    I found the problem. It's about the MPU setting for those 2GB starting from 0x00000000. They MUST be Shareable. It wasn't in my setting and that's why the 0x4a600000 never got set to 0x1.

    So therefore we do not need a dabug-session. and it's solved.

    Best regards

    Felix

  • Hey Aakash,

    unfortunately this was just a short state. Somehow after reflashing it again does not get set to 1.... Not sure why it workes for that short amount of time in between now.

    So probably debug will still be needed.

    Best regards

    Felix

  • Hi Felix,

    Let's have a debug session after your return. Send me the meeting invite for the same.

    Best Regards,
    Aakash

  • Hey Aakash,

    right before the start of may vacation it suddenly worked without any changes. I just uploaded an "old" bootloader to check what's going on different there and  after reinstalling the "new" bootloader it also worked properly.

    Can you think of any reason for this? Is there some non-volatile-memory used for the SysFw or anything?

    Best regards,

    Felix