lpi2c_vlps#
Overview#
This example describes how to use kinetis SDK drivers to implement LPI2C transmit and receive in the VLPS (very low power STOP mode) with async DMA. The LPI2C module is designed to have ability to work under low power module like STOP, VLPW and VLPS. It can use DMA to transmit the data from or to application user buffer without CPU interaction.
It uses LPI2C to access the on board accelerometer sensor to read the Accelerometer X, Y, Z data every 500ms. CPU would keep in VLPS low power mode, except for some trigger events and data output to LPUART0.
Supported Boards#
EVK-MCIMX7ULP
Hardware requirements
Micro USB cable
MCIMX7ULP-EVK board
J-Link Debug Probe
5V power supply
Personal Computer
Board settings
No special settings are required.
Please note this application can’t support running with Linux BSP!
Prepare the Demo
This should be run together with uboot.
Build the project and generate the .bin file.
Copy the .bin file to <sdk_dir>/tools/imgutil/evkmcimx7ulp folder and rename to sdk20-app.bin.
In the folder <sdk_dir>/tools/imgutil/evkmcimx7ulp, run “mkimage.sh ram or mkimage.sh flash” (see readme in the <sdk_dir>/tools/imgutil )to create bootable image.
Prepare an SD card with the prebuilt U-Boot image and copy the sdk20-app.img generated into the SD card. Then, insert the SD card to the target board. Make sure to use the default boot SD slot and check the dip switch configuration
Open a serial terminal with the following settings to connect to Cortex-A:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Connect 5V power supply to the board, switch SW1 to power on the board.
Hit any key to stop autoboot in the terminals, then enter to U-Boot command line mode. Then write the image and run it from QSPI Flash with the following commands:
sf probe
sf erase 0x0 0x20000
fatload mmc 0:1 0x62000000 sdk20-app.img
sf write 0x62000000 0x0 0x20000
Open a serial terminal with the following settings to connect to Cortex-M:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Switch the SW1 to re-power the board.
Hit any key to stop uboot autoboot in the Cortex-A terminals.
Running the demo
Disconnect any debugger to run this demo in case the sequence of entering sleep mode is interrupted. When the example runs successfully, you can see the similar information from the terminal as below.
LPI2C_VLPS demo start...
Enter VLPS mode aborted!
X: 2, Y: -148, Z: 2107
X: -2, Y: -97, Z: 2086
FRDM-KE15Z
Hardware requirements
Micro USB cable
FRDM-KE15Z board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Press the reset button to begin running the demo.
Running the demo
Disconnect any debugger to run this demo in case the sequence of entering sleep mode is interrupted. When the example runs successfully, you can see the similar information from the terminal as below.
LPI2C_VLPS demo start...
X: 2, Y: -148, Z: 2107
X: -2, Y: -97, Z: 2086
FRDM-KE17Z
Hardware requirements
Micro USB cable
FRDM-KE17Z board
Personal Computer
Board settings
Make sure the FXOS8700CQ(U12) on the board is installed to run this demo. No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Press the reset button to begin running the demo.
Running the demo
Disconnect any debugger to run this demo in case the sequence of entering sleep mode is interrupted. When the example runs successfully, you can see the similar information from the terminal as below.
LPI2C_VLPS demo start...
X: 2, Y: -148, Z: 2107
X: -2, Y: -97, Z: 2086