TWR-K21D50M MQX v4.0.2 VLPS

Showing results for 
Search instead for 
Did you mean: 

TWR-K21D50M MQX v4.0.2 VLPS

No ratings

TWR-K21D50M MQX v4.0.2 VLPS

Rev0.1 - 8/28/2012

Adding to the patch at TWR-K21D50M lowpower MQX Patch for v4.0.2, this updates the MQX BSP and lowpower example to add VLPS mode.

The example works the same as the default lowpower example, except after waking from LLS, the application immediately enters VLPS.  It uses the LPTMR to wake after 10 seconds, and returns to RUN mode and restarts the example.  Because the transition is immediate from the user perspective, the user will press the switch to enter LLS mode, after 10s the MCU will wake, turn on the blue LED, enter VLPS, wait another 10s, wake, turn off the blue LED, return to RUN mode and resume printing to the terminal.  There is no text printed to the terminal between LLS and VLPS to show a quick transition.

This patch covers several files to enable VLPS mode in the twrk21d50m BSP, and modifies the lowpower example. The lowpower example is provided to demonstrate the MQX Low-Power Manager (LPM) driver, and change low-power modes on the K21 board.  The BSP in the release provided does not include support for VLPS.

To use this patch, copy the patch directory into the MQX v4.0.2 root directory.  The patch will over-write some existing files in the MQX installation.  The changes addressed by this patch include the following:

  1. User_config.h
    • MQX_ENABLE_LOW_POWER macro enabled.  Required for LPM driver and lowpower example.
  2. LowPower Example main.c
    • Modified as described above to add transition into VLPS mode
  3. bsp_cm.c
    • Added case for VLPS mode for clock mode transition
  4. init_lpm.c
  5. init_lpm.h
    • Added mode LPM_OPERATION_MODE_VLPS to enumeration LPM_OPERATION_MODE
  6. init_sci.c
    • Added settings for mode LPM_OPERATION_MODE_VLPS to the _bsp_sciX_operation_modes arrays for all the UARTs in the BSP
  7. lpm_smc.c
    • Disabled SPI0 clock gate when entering stop mode, otherwise stop entry is aborted.  Re-enabled clock gate 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.
    • Disabled the SysTick interrupt for the 5ms RTOS tick before entering stop mode, and re-enabled after waking up.  Without this, the example was entering VLPS mode fine without the debugger, but with the debugger the SysTick interrupt was causing VLPS entry to abort. 
Tags (2)
Version history
Revision #:
1 of 1
Last update:
‎08-28-2013 02:12 PM
Updated by: