A sensor demo project for STM32F401 Discovery board in conjunction with a BlueNRG module.
The BlueNRG app allows you to access the sensor data directly from the mobile device over Bluetooth Low Energy.
The STM32F401 Discovery creates a GATT (Generic Attribute Profile) vendor characteristic, and several services including the one reporting Accelerometer data. The mobile phone (BlueNRG app) connecting the board, aquires Accelerometer data, and visualizes it with a 3D cube.
Audio playback and record
- Play an audio. Device CS43L22 By default, it plays “audio.wav” that is on the USB Mass Storage (LED6 toggle). A click on the board pauses the audio playing(LED6 on ).
- Record and play an audio. Device MP45DT02 After the USER button is pressed, it starts recording in the USB Mass Storage (LED3 toggle). When the recorded wave length is around 30 seconds or interrupted by pressing the USER button.
Two devices are needed:
The connection between F401CDiscovery and BlueNRG board is 5-wire SPI, which is a standard 4-wire SPI with an additional IRQ pin. The IRQ pin is for BlueNRG module to notify F401CDiscovery to receive packets.
- GNU toolchain The latest release (4.8 currently) of GNU Tools for ARM Embedded Processor is known to work.
- Flash tool Either openocd or stlink works.
- BlueNRG app (see below)
- (optional) LightBlue, BLE Utility Great BLE utilities for BLE developers.
BlueNRG app is available for both Android and iPhone:
Download, Build and Run
Clone the project:
git clone https://github.com/winfred-lu/stm32f4-bluenrg.git
Build the project:
make clean make make flash
Start the BlueNRG app and connect.