解決済! 解決策の投稿を見る。
Hello MF,
Thanks for your patience and sorry for delay. The SPT assembler is based on GNU assembler (GAS) which does not support macro expansion in operands. Luckily the SPT tools has support for preprocessor (same as GNU C preprocessor) so we can use #define to achieve what you need:
#define __mod .mod24
add.immed .noshift __mod WR_4, (OR_0_0_0), WR_19
-> Expands to after preprocessor stage ->
add.immed .noshift .mod24 WR_4, (OR_0_0_0), WR_19
The SPT assembly file needs to use .pspt extension. I assume you are using S32DS which automatically applies the preprocessor as part of the SPT build chain, so just make sure you are on the latest version of S32DS for PowerArch from NXP.com for the most up-to-date SPT tools.
Regards,
Gary
Hello MF,
Thanks for your patience and sorry for delay. The SPT assembler is based on GNU assembler (GAS) which does not support macro expansion in operands. Luckily the SPT tools has support for preprocessor (same as GNU C preprocessor) so we can use #define to achieve what you need:
#define __mod .mod24
add.immed .noshift __mod WR_4, (OR_0_0_0), WR_19
-> Expands to after preprocessor stage ->
add.immed .noshift .mod24 WR_4, (OR_0_0_0), WR_19
The SPT assembly file needs to use .pspt extension. I assume you are using S32DS which automatically applies the preprocessor as part of the SPT build chain, so just make sure you are on the latest version of S32DS for PowerArch from NXP.com for the most up-to-date SPT tools.
Regards,
Gary
Thanks!
Now we are using the GreenHills compiler.
Now successfully pass the compile and link, next step is to do the test.
You are welcome, thanks for the kudos.
Even when using GreenHills as the toolchain for PowerArch development the SPT assembler is still the same tool as integrated with S32DS and used with NXP GCC so the same technique should still work.
Granted there may be slight differences between the GCC C pre-processor and the GHS version but I don't expect the behaviour of basic macro definition to be different. Let us know if your test is successful.
- Gary
Hello Gary,
I am meng Fei's colleague. At present, we found that we used GHS to compile SPT assembly, and the object speed could not be output during the test, but the direct link to LIBRsdk_SPt_kernels_gcc_s32r274.a could work normally. I would like to ask two questions:
1. Is there any example of S32R274 SPT working properly after compiling with GHS?
2. Check whether the script in the following directory is correct
Hello wuxingdelonglong,
Can you check the SPT peripheral registers to see if there is some issue with the kernel being executed? My initial idea is that the SPT code is not correctly aligned in memory, please align on 16 bytes.
1. There is no difference between S32R274 usage of SPT in a GHS compiled application vs MPC5775K. Plus the SPT code is already assembled and part of the C lib, it should be a simple case of linking against this lib and using the exported symbols (i.e. SPT function labels) in your C code. Make sure your SPT driver is writing the correct start address of the SPT functions to SPT_PG_START_ADDR register.
2. Which script specifically do you mean? I checked the project and it looks okay, is there some error when you attempt to build it? Please let me know.
Thanks,
Gary
Hello Gary,
My test is successful, the SPT can work under GHS compiler. (Just the primary test, I can see the object can be detected, and range changes. So I guess It works.)
Hello,
Let me talk to application engineer first.
I will come back to you ASAP.
Best regards,
Peter