Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Good morning. I am trying to work on a small project for the Stellaris LM4F120 board, and as part of the project, I have a need to read the stack variable. (I'm constructing a small context switcher for demonstration purposes.) I obtained a segment of code from the web as follows: static inline void * rd_stack_ptr(void){ void * result=NULL; asm volatile ("MRS %0, msp\n\t" "MOV r0, %0 \n\t" : "=r" (result) ); return result; } Essentially, what the code is supposed to do is copy the stack pointer into the c variable "result" and return it. However, I am getting errors as follows:
  2. Thanks for the info. Worked fine. Now if I can just figure out the inline assembly I need to get working elsewhere.
  3. Good morning. I'm starting up working with the Launchpad LM4F120 evaluation kit and CCS, and I'm running into an issue I would like to resolve. I have some code that I am porting from another processor, and there is a segment of code similar to the following. (Note: It's simplified) temp = interruptstate; DISABLE_INTERRUPTS(); . . other code . interruptstate = temp In essence, the code stores the current interrupt state, and then restores it to the previous state upon exit (allowing the code to be used in critical sections, etc. without the danger of inadvertently turn
  • Create New...