Tool/software:
Hello,
we once had a similar issue with the OSPI-driver: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1269230/mcu-plus-sdk-am243x-alignment-problems-with-gpmc-psram-in-ospi-in-release-builds/4914983?tisearch=e2e-sitesearch&keymatch=%2520user%253A453845#4914983
here the generated arm-ldm command was the problem, which was generated when using -Oz. It seems to be exactly the same case now:
as you see the bufPtr points at 0x7001565B, which is not an aligned address. In the next assembly line the ldm command would be issued, which uses r3, which holds this odd value.
but as you can also see the calling function in the mcspi-driver does a uint32_t* cast on a uint8_t-aligned address:
if we use only -Os for the driver library we won't have any problems.
Btw. we still use the old drivers before the lld-introduction, because the change was too big to simply implement. However the exact same code is present in the current SDK and thus I see this as a general issue.
Regards
Felix