
Hi, I am having some issue with several instances of ALLOC_CACHE_ALIGN_BUFFER in (at least): - common/env_mmc: env_relocate_spec - disk/part_dos: test_part_dos
U-boot (ls1021atwr) is build in SPL mode, SPL part is in Secure World, u-boot is in Normal World. In the SPL part, there is no problem, MMC access are fine. In the normal world, I experience what I think is stack corruption:
At these locations, calls to the MMC to read partition info mostly read 0 or garbages. Garbage looks like stack overflow/corruption. For example, in the first function, checking the CRC of u-boot's env stored in the MMC fails because the buffer is correct until the last kb where there is values instead of zeroes, which looks like RAM addresses and data.
I tried several fix, but I still don't understand what's happening: - I tried to allocate the buffer where MMC data is read into the head -> it works fine - I tried to allocate more room to these buffer on the stack -> sometimes it works, but not always.
Maybe it's my compiler (NXP's SDK 1.9, based on yocto) which is buggy, I don't know. I can provide some custom dump of memory if necessary, but the buffers at these locations are quite huge I'm afraid.
Best regards, Vincent