LP-AM263: Issue with TCM i

Part Number: LP-AM263

Tool/software:

Hi

I'm having an issue with getting the SBL to work from TCM.

I started from the original sbl_ospi_multicore_elf example. The original code is not modified apart from the loop_forever function added at the top of the main().

I'd like to use TCM memory as much as possible to minimize SBL OCM usage to leave the most space to the application.

Therefore I modified TCMA region size to 64K and and TCMB region size to 192K.

MPU config is the following :

TCM A:

TCMB:

For now, I'm trying to put the stack segment in TCMA see below.

Plan will be to move .bss to TCMB.

When executing the code, the execution proceeds until this where the code calls for bootloader_InitCpu

Which in turn calls Bootloader_socMemInitCpu

Then get stuck in a while loop waiting for TCMA initialisation or triggers a reset.

Can you please advise on what causes the behaviour ?

My understanding if the TCMA & TCMB are already enabled for the Core0 ?

How would you recommend using TCMs for SBL ?

Thanks

Regards

Sebastien

  • SBL cannot be at any other location except 0x70002000 (default address). Please see the following link for more details on the same: Secondary Bootloader flow in AM26x devices.

    Regards,

    Sahana

  • Hi 

    I realize the post might be confusing.

    I'm not trying to get the code to work from TCM , I'm trying to minimize the footprint of the SBL in OCM.

    Therefore I'd like to push the stacks & bss to TCM.

    The code stays in OCM and starts at 0x70002000.

    Pushing the concept, I have another thread on trying the get part of the SBL work in XIP : e2e.ti.com/.../5537462

    Coming back to pushing the stacks to TCMA, my current project has .sysmem & .stack grouped with other stacks and the whole group running from TCMA. See extract from linker script.

    GROUP  :   {
        .irqstack : {
            . = . + __IRQ_STACK_SIZE;
        } align(8)
        RUN_START(__IRQ_STACK_START)
        RUN_END(__IRQ_STACK_END)
        .fiqstack : {
            . = . + __FIQ_STACK_SIZE;
        } align(8)
        RUN_START(__FIQ_STACK_START)
        RUN_END(__FIQ_STACK_END)
        .svcstack : {
            . = . + __SVC_STACK_SIZE;
        } align(8)
        RUN_START(__SVC_STACK_START)
        RUN_END(__SVC_STACK_END)
        .abortstack : {
            . = . + __ABORT_STACK_SIZE;
        } align(8)
        RUN_START(__ABORT_STACK_START)
        RUN_END(__ABORT_STACK_END)
        .undefinedstack : {
            . = . + __UNDEFINED_STACK_SIZE;
        } align(8)
        RUN_START(__UNDEFINED_STACK_START)
        RUN_END(__UNDEFINED_STACK_END)
        .sysmem : {
        } align(8)
        .stack : {
        } align(8)
        } > R5F_TCMA_64K  

    Core 0 & 1 work in lockstep. Only Core 0 is defined in the SBL project.

    The application that will be booted has Core 0 & 1 working in lockstep, Core 2 & 3 working as standalone. 

    The rest of the setup is identical to the example. I'm running into the issue described above.

    Is there any thing wrong in the approach ?

    Happy to share the project.

    Thanks in advance for your help.

    Regards

    Seb

  • Hi Seb,

    Therefore I modified TCMA region size to 64K and and TCMB region size to 192K.

    On the AM263x device, the sizes of TCM are as follows for the R5FSS0_CORE0.

    TCMA 64KB (Lockstep) 32KB (Dual Core)
    TCMB 64KB (Lockstep) 32KB (Dual Core)

    Do you mind sharing your CCS project. I'd like to import the same project, check the syscfg and linker and try to debug the same.

    Regards,
    Shaunak

  • Hi Seb,

    Ignore my previous response, it was made assuming that you are using AM263x-LP. From your other posts on the forum (and that AM263x does not have OSPI), I realized you are on AM263Px-LP (the title of the E2E mentioned AM263x instead of the AM263Px).

    The TCM Sizes are as follows for the R5FSS0_0 Core:

    Lockstep mode: TCMA (64KB) + TCMB (192KB)

    Dual Core mode: TCMA (32KB) + TCMB (96KB)

    Another thing you might have to check in the MAP file is if the .stack of your application will fit in the TCMA or not.

    I will be waiting for you to share the CCS project, then we can have a look further.

    Regards,
    Shaunak

  • UDS_sbl_ospi_multicore_elf_am263px-lp_r5fss0-0_nortos_ti-arm-clang_StacksInTCMA.zipMulticore_LedBlinkingApp_am263px-lp_system_nortos.zip

    Hi Shaunak

    Thanks for your feedback.

    See attached the project. As mentioned the project is jus the ospi example with .sysmem & .stack grouped with the exception handling stacks and direct to be in TCMA.

    When debugging I flashed both this bootloader (beware, there is the forever loop at the start of main) and a dummy multicore application that just flashes LED on the launchpad. 

    The bootloader will parse the image OK and will proceed to the CPU initialisation and this where the problem arises.

    I attached the .mcelf also.

    Thanks for looking into this. Your help is really appreciated.

    Regards

    Seb