AnsweredAssumed Answered

_lwsem_post problem on 32Bit SPI slave ISR

Question asked by Tom Junkans on Apr 16, 2013
Latest reply on Aug 11, 2015 by José Antonio Martínez Iglesias


  • Running a K20dx256 using CW10.3 / MQX4.0
  • I have a 32 bit SPI slave generating an interrupt when the RX buffer is not empty (RFDF bit in SPI2_SR)
  • Everything works fine until I _lwsem_post in the SPI ISR then _lwsem_wait in a task. When I do this I get a 'ivINT_Hard_Fault'. No fun...
  • When I replace the ISR with a simple loop that reads the RFDF bit in SPI2_SR, the _lwsem_post & _lwsem_wait work fine. This makes me think it is the way I handle the SPI RFDF interrupt. But the interrupts work fine without the lw semaphore. ???
  • I built my own 32Bit SPI slave driver because MQX and PE don't support 32Bit slave interrupts. This works great without the lwSem stuff, but I need a semaphore.

If anyone has a clue or idea as to what my problem is, please fire away.


Thanks in advance.