Hi,
I tried to export my S32DS project to IAR EWARM by referring to the link below.
HOWTO: Export S32DS Project to IAR EW (S32K14x/S32K11x)
If I did not select SDKs, I was able to debug successfully.
However, if I select a SDK, a stack pointer alignment error occurs when debugging starts.
I set "alignment = 8" in the icf file but no improvement.
The project is not modified from the one generated by S32DS, do I need to make any changes?
My development environment is as follows.
S32DS: Version: 3.5 Build id: 230728 (Update 4)
IAR EWARM: Ver.8.50.9.33462
I hope you could help me.
解決済! 解決策の投稿を見る。
Thank you for your reply.
I looked into the alignment issue and found the following problem with the IAR compiler.
Apparently, there is a problem with the startup code written in assembler.
This problem may be solved by using C for startup code.
Thank you.
Thank you for your reply.
I looked into the alignment issue and found the following problem with the IAR compiler.
Apparently, there is a problem with the startup code written in assembler.
This problem may be solved by using C for startup code.
Thank you.
Hi Mick,
I am also facing same issue. I created a project with S32k3 and RTD. Complied with IAR and when i start debugging stack alignment issues comes up.
I tried accessing this link "https://www.iar.com/knowledge/support/technical-notes/general/run-time-error-in-newly-migrated-proje... ", but its showing page not found.
Can you help me out.
Thank you
Suraj Prem
Hi,
can you please share more details? Is there some error message? Normally is stack pointer stored on very first 4 bytes after boot header - not sure exact address for K311, for K344 it is 0x401000 and address of stack beginning is taken from linker script file.
Hi,
you are using S32K1xx linker script file with S32K3xx and the stack pointer address is taken from boot header instead of correct SP address. Please use correct linker script file.
Hi Suraj,
The link seems to have expired.
I think you can check the contents of the link in the archive.
Thank you!
Hi,
I'm not familiar with IAR, but in my opinion there is no issue with alignment - the stack pointer address seems invalid for some reason.
Hi to all i don't know if this is the same problem, but when i compiled an empty project from nxp design studio ide, with iar toolchain, and importend into iar IDE, the problem i faced (live wathcing directly the memory with the pemicro debugger) is that the vector table was misaligned ahead by 0x40 bytes: in fact i did find the vector table @0x00400840 instead of 0x00400800 or something similar; due to fact that the first 32 bit value into the vector table is the starting SP this was a big and bloking issue; i did managed a bit the assembler code generated from nxp ide (mainly Vector_Table.s) and then the vector table back to the right place, and the issue disappeared; hope this could help you
i have to cross check and find differencies between native asm file generated by nxp ide and my changes: an easy way to check if the issue is the same i faced is to watch the memory area where the vector table is supposed to be located (in my case with an s32k324 derivative it was @0x0400800) and the 'real' place where it was linked (in my case if i remeber good @0x0400840). If this is the same matter as this thread, i can try to merge the differencies and post them here. Let me know
If into he SCB->VTOR register you are seeing your v_table address (0x7D 4800) and if watching this memory address content, you can see that here there are the correct vector table values, it seems that your issue is different from mine