MIMX8ML8 SDK optimized memcpy routine bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIMX8ML8 SDK optimized memcpy routine bug

408 Views
bjoern_almqvist
Contributor I

I had trouble getting RPMsg-Lite to run continuously on the i.MX8M Plus Cortex-M7 (FreeRTOS, MCUXpresso SDK 2.16.000, arm-gnu-toolchain 13.3) with a 1 ms request/response cycle to Linux. After a variable number of cycles the communication froze hard and the M7 stopped servicing the incoming messages.

I added a SysTick watchdog that samples the interrupted program counter when the app stopped. During a freeze it consistently showed the M7 stuck in the size_ge_16 burst loop in fsl_memcpy.S, with the link register pointing back into rpmsg_queue_recv, inside env_memcpy(data, msg.data, msg.len) while copying a received payload out of the vring buffer.

It looks like a latent alignment bug in the optimized memcpy routine, exposed by the specific alignment of the rpmsg shared-memory buffers it’s asked to copy. (I did not isolate the exact faulty instruction.)

Swapping to the standard libc memcpy fixed it for me, i.e. changing the SDK_MISC_OVERRIDE_MEMCPY define to 0.

Is this something that is logged and fixed in later SDK versions?

0 Kudos
Reply
1 Reply

329 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @bjoern_almqvist 

Hope you are doing very well.

 

The structure of the SDK regarding to the RPMSG has not any change from that Version.

Actually, in that case it is a good and functional workaround.

 

RPMSG is commonly used to send flags and short messages instead of big amount of data in the buffer, then M and A cores can access to the shared memory.

 

Best regards,

Salas.

0 Kudos
Reply