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: Disable Bootloader scratch memory - BOOTLOADER_SCRATCH_MEM_ENABLE define

Part Number: MCU-PLUS-SDK-AM243X


Tool/software:

Hello,
I am using AM243x MCU+ SDK 11.01.00 with SysCfg 1.22 on AM243X-LP. Debug build of my application has reached a "critical mass" where it barely fits available RAM memory. I have noticed that my bootloader (largely based on examples\drivers\boot\sbl_ospi_multi_partition\am243x-lp) has started failing so I was debugging the issue and noticed that in SDK in Bootloader_verifyMulticoreImage() (source\drivers\bootloader\bootloader.c line 595) due to scratch memory being enabled, the whole image is copied to RAM for image verification, which is problematic for me.

First of all, did I miss a setting in SysCfg for disabling scratch memory for bootloader?

I went ahead and set BOOTLOADER_SCRATCH_MEM_ENABLE to 0 in SDK in source\drivers\bootloader.h, recompiled the SDK and no change has occurred. So, I did more digging and in my SysCfg generated files in my bootloader source files (ti-arm-clang\generated\ti_drivers_config.c), gBootloaderConfig array is filled with Bootloader_Config initializations that use BOOTLOADER_SCRATCH_MEM_ENABLE for enableScratchMem member. Therefore, the following code in SDK in bootloader.c 595:

// config->enableScratchMem is set to BOOTLOADER_SCRATCH_MEM_ENABLE by SysCfg
if(config->enableScratchMem == BOOTLOADER_SCRATCH_MEM_ENABLE){

has a little bit of 0U == 0U or 1U == 1U going on, which I found amusing to be honest when I found out Slight smile

This seems like a bug to me unless I missed something. I have workarounds, such as compiling SDK and my bootloader with different BOOTLOADER_SCRATCH_MEM_ENABLE values or better changing the above if statement to config->enableScratchMem == 1U. This is all assuming disabling scratch memory is intended to be possible right?

Cheers,
Vaclav