How to: Standby mode on S32K3 using NXP MBDT

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to: Standby mode on S32K3 using NXP MBDT

How to: Standby mode on S32K3 using NXP MBDT

Introduction

 

The following article shows a basic configuration for S32K3 that allows the MCU to transition from RUN mode to a Standby mode.

 

Prerequisite software

 

The following software tools were used to develop and deploy the application onto the S32K3 board.

 

Prerequisite hardware

 

The application is developed for the following hardware*:

  • X-RD-K344BMU (MCU: S32K344-Q257)
  • Debug probe (used to deploy the example and to connect the FreeMASTER application to the board)
  • 12V power supply
  • Jumper Wire

 

Configuration project

 

In this chapter, I show most important settings that must be to allow the MCU to enter standby mode and to be able to wake up and switch to RUN mode again. For more details, please download the files attached and consult the configuration project.

Pins configuration

Two pins must be configured for this application:

  • Signal wkpu,14  (of WKPU peripheral) to the PTB17.
    • Direction: Input
    • Pull Select: Pullup
    • Pullup Enable: Enabled
  • Signal gpio, 65 (of SIUL2 peripheral) to the PTC1.
    • Direction: Output

 

SorinIBancila_0-1768495197748.png

 

Figure 1. Configuration Pins tab - Dio_Pins_MBDT Functional Group

 

Clocks configuration

A new Functional Group must be created for the Standby Mode. This can be done from the Clocks tab (as shown in the image below).

SorinIBancila_1-1768495588172.png

 

Figure 2. Configuration Clock tab - Create new Functional Group

 

Peripherals configuration

Dio component

SorinIBancila_2-1768495758362.png

 

Figure 3. Configuration Dio Component - DioGeneral

 

SorinIBancila_3-1768495793846.png

 

Figure 4.  Configuration Dio Component - DioChannel Wkpu_DioChannel

 

SorinIBancila_4-1768495810080.png

 

Figure 5.  Configuration Dio Component - DioChannel Green_Led_DioChannel

 

Port configuration

The Port configuration must match the settings configured in the Pins tab (check Pins Configuration chapter).

SorinIBancila_5-1768496114620.png

 

Figure 6. Configuration Port component - PortPin Wkpu_PortPin

 

SorinIBancila_6-1768496160497.png

 

Figure 7. Configuration Port component - PortPin Green_Led_PortPin

 

Mcu configuration

A new McuModeSettingConf must be created. It is going to be used to switch to STANDBY mode.

SorinIBancila_0-1768496372309.png

 

Figure 8. Configuration Mcu component - McuModuleConfiguration -> McuModeSettingConf

 

A new McuClockSettingConfig must be created. The MCU will use to this clock tree when it is in standby. All the settings in this newly created McuClockSettingConfig must match the settings made in Clocks tab.

 

SorinIBancila_1-1768496567805.png

 

Figure 9. Configuration Mcu component - McuModuleConfiguration -> McuClockSettingsConfig

 

Make sure that for the new McuClockSettingsConfig, in the configuration tab, the Functional Group created in Figure 2 is selected.

 

SorinIBancila_3-1768496798654.png

 

Figure 10. Configuration Mcu component - McuModuleConfiguration -> McuClockSettingsConfig -> Configuration

 

 

ICU configuration

 

SorinIBancila_4-1768496907799.png

 

Figure 11. Configuration Icu component - IcuConfigSet -> IcuChannels

 

Note! The first 4 Hardware Channel are internally routed. For the evaluation board that I used, the PTB17 corresponds to the WAKE_14. In the configuration project, the hardware channel must be set to CH18 (to offset the first 4 internally routed hardware channel).

 

SorinIBancila_7-1768497314930.png

 

Figure 12. Offset internally routed hardware channels

 

SorinIBancila_5-1768496989125.png

 

Figure 13. Configuration Icu component - IcuConfigSet -> IcuWkpu -> IcuWkpuChannels

 

SorinIBancila_6-1768497048517.png

 

Figure 14. Configuration Icu component - IcuConfigSet -> IcuHwInterruptConfigList

 

Model configuration

 

The Simulink model used to switch from RUN mode to STANDBY mode can be seen in the picture below. It can also be found in the achieve attached to this article.

The application executes the following tasks at each steps:

  • Toggle the LED to visually tell if the board is running or in standby mode
  • Increment a variable
  • Check if the enter_standby variable is set to 1. If true, the sequence to enter standby mode is executed.

SorinIBancila_9-1768497588515.png

 

Figure 15. Simulink Model S32K3_Standby_GPIO_Wkpu

 

SorinIBancila_11-1768497753974.png

 

Figure 16. Enter Standby mode routine

 

SorinIBancila_12-1768497853446.png

 

Figure 17. Custom code to enter standby mode

 

Validation

 

To validate the application, the FreeMASTER tool is used to connect to the board and initiate the sequence to enter standby mode. To connect the board, I used the debug probe.

SorinIBancila_14-1768498313050.png

 

Figure 18. Connect FreeMASTER tool to the board using debug probe

 

If everything is properly configured, the FreeMASTER should now be connected to the board. In the Variable Watch, the value of the counter variable is increased each second. 

To enter standby mode, the value of the enter_standby variable must be set to 1. If the sequence to enter standby mode is correctly executed, the value of the counter shouldn't be updated anymore and the LED should stop blinking. Also, the board is disconnected from the FreeMASTER board.

To exit standby mode, use the jumper wire to connect the PTB17 to a GND pin. The LED should start blinking.

 

Conclusion

 

In this article, I presented a basic implementation that allows the S32K344 to enter standby mode. The configuration presented here doesn't maximize the power savings, as the user should take care of putting the pins in a floating state, disable all unnecessary clocks and many more. For further details, please consult the S32K3 reference manual.

 

This application was based on the examples found in this article: S32K3 Low Power Management AN and demos. Kudos @Shuang!

添付
評価なし
バージョン履歴
最終更新日:
金曜日
更新者: