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.
Thanks!
Solved! Go to Solution.
Hi,
right click on project name -> Properties -> C/C++ Build -> Settings:
Hi,
I can reproduce the issue and can confirm that it is a bug in EWL C standard C library. Thanks for report!
Unfortunately S32DS for PA v2017.R1 is no more maintained and the bug will not be fixed for this S32DS version.
This bug is already fixed in S32DS for PA v2.1 and you can use this S32DS version.
If you need to use S32DS PA v2017 - you have couple options. You can Switch STD C library from EWL C to NewLIB in project properties.
Other possibility is use memcpy instead of memmove, memcpy works as expected.
Hi,
Can you tell me how can I switch STD C library from EWL C to NewLIB in project properties? Can you show me the process? Maybe some screenshots can be showed.
Hi,
right click on project name -> Properties -> C/C++ Build -> Settings:
Can someone reply my problem? It's really urgent.
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.
Thanks!!!
Can someone test this project? We would like to know if the issue is due to our incorrect usage or if memmove function itself has a bug in S32DS?
We are eagerly awaiting your response.
Hi,
I'm looking at you project right now, I'll be back later today with more info.