TWR-K21D50M lowpower MQX Patch for v4.0.2

File uploaded by Derek Snell Employee on Aug 28, 2013
Version 1Show Document
  • View in full screen mode

Rev0.1 - 8/28/2013


This is an update to the previous patch TWR-K21D50M lowpower Patch


In MQX v4.0.2, most of the issues reported in the earlier patch have been fixed in the BSP.  But the lowpower example for this board still fails to enter LLS mode because of a conflict with the SPI peripheral.  There is only a minor edit in one file needed to fix the example.


  1. User_config.h
    • MQX_ENABLE_LOW_POWER macro enabled.  Required for LPM driver and lowpower example.
  2. Disabled SPI0 peripheral before entering a stop mode
    • lowpower example was aborting the stop mode entry, and never entered stop mode.  The issue was caused by the SPI0 peripheral preventing the entry to LLS mode.  Modified _lpm_set_cpu_operation_mode() in lpm_smc.c to disable SPI0 clock gate before entering a stop mode, and re-enabled after waking up.  If SPI0 peripheral is required in a stop mode, register the SPI driver with the LPM driver to properly configure when LPM changes operation mode to a stop mode.  Refer to LPM documentation for details.  Replace the file \Freescale_MQX_4_0_2\mqx\source\io\lpm\lpm_smc.c with the attached.