Hello,
I jump into this quite old topic because I found the same issue while trying to use libc (instead of libc_nano) in a project of ours. While it is true that the USB SRAM is, by default, mapped to a Device memory (and, as such, does not support unaligned access), the LPC55s69 reference manual states that:
[start of quote]
Note: USB SRAM is mapped in the so-called “Peripheral” Memory Region of both CPU0
and CPU1. The “Peripheral” memory region (which extends from 0x4000_0000 to
0x5FFF_FFFF) is considered as “Device” type by default and USB SRAM is located from
0x4010_0000 to 0x4010_3FFF. “Device” memory regions do not allow “unaligned”
accesses by default. However, by using the Memory Protection Unit (MPU), the “Memory
Type” of an address space (except for the last 0.5 GB of the 4G space) can be modified.
[end of quote]
So, I started looking at ARM documentation for the ARMv8-M MPU and I ended up with a viable solution that allows using non-aligned accesses with USB SRAM. One region of the MPU, mapped to USB SRAM, shall be programmed as Normal memory, as follows:
ARM_MPU_SetMemAttr(0, 0x44); // Normal memory, non-cacheable (inner and outer)
ARM_MPU_SetRegion(0, ARM_MPU_RBAR(0x40100000, ARM_MPU_SH_NON, 0, 1, 1), ARM_MPU_RLAR(0x40104000, 0));
ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk | MPU_CTRL_HFNMIENA_Msk);
This way, the fault on memcpy does no longer occur and the USB driver (msc, in my case), works like a charm.
My two cents...
Stefano