Using the memmove function provided by the libc99 library gives an error result in S32 DS USING 5744

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

Using the memmove function provided by the libc99 library gives an error result in S32 DS USING 5744

Jump to solution
279 Views
zhaoning
Contributor II

Hi NXP experts,

Recently we are using mpc5744 with S32 Design Studio for Power Architecture Version 2017.R1 to compile the project. Now we are facing a memmove function problem.

The project in the attachment is modified based on "hello world" and can reproduce the issue we encountered. We defined a 40-byte array of type U8 as the data source, used 0x4001268e as the data destination, called the memmove function to copy data, but found that the last 6 bytes of the destination data were not copied correctly. Upon analyzing the standard C code, we discovered that the issue might be related to the macro replacement of deref_auto_inc in __copy_long_mem.c. The memmove.o included in libc99.a should have enabled #define deref_auto_inc(p) *++(p), but it was incorrectly enabled as #define deref_auto_inc(p) *(p)++. We want to confirm if this issue is caused by a bug in the default lib library provided by s32DS or an default method we have usd.

We also found in the map file that the memmove function is not compiled from the C source code but rather uses library functions from libc99.a. This means that we cannot solve this problem by modifying the C source code, is that correct? How should we go about resolving this issue then?

We are in urgent need of your help. Project is attached.

Thanks!!! 

zhaoning_0-1713524575116.png

 

zhaoning_1-1713524575149.png

 

zhaoning_2-1713524575128.png

 

zhaoning_3-1713524575125.png

 

zhaoning_4-1713524575249.png

 

zhaoning_5-1713524575135.png

zhaoning_6-1713524625706.png

 

 

 

 

Thanks!

0 Kudos
Reply
1 Solution
266 Views
jiri_kral
NXP Employee
NXP Employee
0 Kudos
Reply
1 Reply
267 Views
jiri_kral
NXP Employee
NXP Employee
0 Kudos
Reply