This is a MicroPython Library to easily access the functionality of the STM32L4 Discovery kit IoT node, model B-L475E-IOT01A
Modified from the following tutorial
- git clone https://github.com/micropython/micropython.git
- Download and unzip the ARM toolchain somewhere.
- go to <micropython_dir>/ports/stm32
- make BOARD=B_L475E_IOT01A CROSS_COMPILE=/Path/where/you/uncompressed/the/toolchain/.../bin/arm-none-eabi-
That will compile the HEX files needed to flash the board. The next step however involves a Windows PC. This is because I had the hardest time getting my Mac to flash the STM32 over stlink or any other system, and all of STM's tools are primarily windows based.
- Transfer the HEX file to a Windows PC
- Install ST-Link Utility
- Run ST-Link Utility and Open the HEX file.
- Connect your B-L475E-IOT01A board to the PC
- Select TARGET > CONNECT from the ST-Link Utility menu.
- Once connected select TARGET > PROGRAM...
- Wait until complete, then eject the Board.
- Connect the Board to your Mac.
- ls /dev and look for something like tty.usbmodem1413 (it may have a different number, if so PLEASE use that number)
- screen /dev/tty.usbmodem1413 115200
- Press Enter a few times and you should see the Python REPL!
If you need to access the Flash File System, just plug in a second USB cable into the OTG port on the B-L475E-IOT01A board. You should then see a PYBFLASH drive appear on your system.
I have accidentially corrupted the Flash filesystem of the board more than once. To avoid this, make sure you EJECT the PYBFLASH drive before RESETTING the board or UNPLUGGING it.
Also I have had a few instances of the REPL locking up on me. In these cases I believe I just unplugged and re-pluggin in the board.
- Bluetooth® V4.1 module (SPBTLE-RF)
- Sub-GHz (868 or 915 MHz) low-power-programmable RF module (SPSGRF-868 or SPSGRF-915)
- Wi-Fi® module Inventek ISM43362-M3G-L44 (802.11 b/g/n compliant)
- Dynamic NFC tag based on M24SR with its printed NFC antenna
- 2 digital omnidirectional microphones (MP34DT01)
- Capacitive digital sensor for relative humidity and temperature (HTS221)
- High-performance 3-axis magnetometer (LIS3MDL)
- 3D accelerometer and 3D gyroscope (LSM6DSL)
- 3D Accelerometer (Complete)
- 3D Gyroscope (Complete)
- Temperature (Complete)
- Pedometer
- Significant motion / Inactivity / Tilt
- FIFO
- Single / Double Tap
- Timer
- 260-1260 hPa absolute digital output barometer (LPS22HB)
- Time-of-Flight and gesture-detection sensor (VL53L0X)
- 2 push-buttons (user and reset)
- Expansion connectors:
- Arduino™ Uno V3
- PMOD