title: CPSID i assembly instruction not supported by Cortex M0
body: <p>I'm developing code for a Cortex M0 using FreeRTOS and eclipse with the AC6 plugin. At the end of my tasks, I'm using an assert to determine if the watermark of my task is greater than the specified task size. The macro I use for my assert looks like this:</p>
  
  <pre><code>#define HMI_DBG_ASSERT(x) if ((x) == 0) {taskDISABLE_INTERRUPTS(); \
                    HAL_GPIO_WritePin(ASSERT_LED_GPIO_Port, ASSERT_LED_Pin, GPIO_PIN_SET); \
                    for( ;; );}
  </code></pre>
  
  <p>My tasks look like this:</p>
  
  <pre><code>for(;;)
  {
      //some
      //code
      uxHighWaterMark = uxTaskGetStackHighWaterMark( NULL );
      HMI_DBG_ASSERT(uxHighWaterMark &gt;= WDG_STACK_SIZE_WATERMARK_WORD);
  }
  </code></pre>
  
  <p>This compiles and works perfectly! My issue is that I'm working on common code with another developer, and he used a macro that is almost identical to mine:</p>
  
  <pre><code>#define CMN_DBG_ASSERT(x) if ((x) == 0) {taskDISABLE_INTERRUPTS(); \
                    HAL_GPIO_WritePin(ASSERT_LED_GPIO_Port, ASSERT_LED_Pin, GPIO_PIN_SET); \
                    for( ;; );}
  </code></pre>
  
  <p>When I call this macro, my compiler returns the following error:</p>
  
  <pre><code>selected processor does not support `cpsid i' in Thumb mode
  </code></pre>
  
  <p>the "taskDISABLE_INTERUPTS();" macro is defined by FreeRTOS, and calls the following assembly instruction:</p>
  
  <pre><code>__asm volatile( " cpsid i " )
  </code></pre>
  
  <p>I find it weird that my compiler doesn't complain with my other macro, but with this one it does. Also, I tried using my HMI_DBG_ASSERT in the .c file where my CMN_DBG_ASSERT is called, and I get the same error. I made sure that my code includes the file correctly and my inclusion path in eclipse is specified. </p>
  
  <p>Cortex-M wiki says that "CPSIE and CPSID also don't exist because ARM instruction set is missing from Cortex-M. Other CPS instructions still exists in the Cortex-M."</p>
  
  <p>ARM's website does have a specification for the CPSIE and CPSID in their documentation for Cortex-M0:</p>
  
  <p><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/BABHBAAB.html" rel="nofollow">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/BABHBAAB.html</a></p>
  
  <p>In any case, the macro has been called before and it worked fine, it's just really weird that my compiler is only complaining now. A colleague of mine using IAR Cortex-M edition tried using the macro and it worked fine... I'm starting to think its another strange eclipse problem.</p>
  
  <p>Can anybody shed some light on the issue I'm having?</p>