AnsweredAssumed Answered

How to access the stack pointer from C?

Question asked by László Monda on Apr 18, 2017
Latest reply on May 5, 2017 by László Monda

Hi there,

 

It was trivial to access the stack pointer from C for AVRs. The following code worked:

void __attribute__ ((__section__ (".init3"), __naked__)) move_sp(void) {
    SP -= sizeof(wormhole_t);
    message_ptr = (wormhole_t*)(SP + 1);
}

How can I access the stack pointer for the MK22FN512VLH12?

 

Thanks in advance!

- Laci

Outcomes