For CCS I found this intrinsics to be able to get the SP in C:
"unsigned short _get_SP_register(void);"
Is it the same intrinsics in IAR?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
For CCS I found this intrinsics to be able to get the SP in C:
"unsigned short _get_SP_register(void);"
Is it the same intrinsics in IAR?
Hi Tony,
Thank you so much for sharing your code.
Highly appreciated.
In the MSP430FG4619 family we have around 1% that resets, most likely because of stack overflow or DCO / FLL error so I would like to monitor the stack pointer.
Or maybe it’s a DCO / FLL failure?
May I ask what dos this code do?
How can this be erased by mistake?
if (CALBC1_8MHZ != 0xff){ // erased by mistake?
BCSCTL1 = CALBC1_8MHZ; // Set DCO to factory calibrate 8MHz
DCOCTL = CALDCO_8MHZ;
Med venlig hilsen/ Regards
Steffen kristensen
Embedded Systems Director
Larsen & Brusgaard
Steffen Kristensen said:In the MSP430FG4619 family we have around 1% that resets, most likely because of stack overflow or DCO / FLL error so I would like to monitor the stack pointer.
If you are using a modern version of the IAR tools, you can use the new "stack usage" feature. It calculates the amount of stack that an application is using, so that you can be certain that you don't run out of stack. This is done by the linker using stack usage information the compiler provides.
Of course, there are some limitations to this system. It doesn't handle function pointers, multithreading, or assembly libraries without "cfi" directives.
You can enable this in "Options -> Linker -> Stack Usage" and inspect the result in the linker map file.
-- Anders Lindgren, IAR Systems
**Attention** This is a public forum