Skip to content

kersny/chibios-stm32f3discovery

Repository files navigation

STM32F3Discovery ChibiOS Demo with Gyro and USB-CDC

An amalgamation of ChibiOS demo projects designed to run on the STM32F3Discovery board. Demonstrates reading from the onboard L3GD20 gyroscope over SPI and output through the ChibiOS USB-CDC driver. Once ChibiOS supports I2C on the STM32F3, the goal is to read from the LSM303DLHC and implement IMU/AHRS algorithms.

Setup

Requires an arm-none-eabi- set of gcc tools, I use CodeSourcery Lite. If you use

git clone --recursive https://github.com/kersny/chibios-stm32f3discovery.git

to clone, or

git submodule update --init

after cloning, it will pull down the matching version of ChibiOS and should then be buildable.

Build

make

Program

I use stlink, with the board plugged into the USB ST-LINK port.

{sudo} st-flash write build/stm32f3discovery-demo.bin 0x8000000

Use

Connect to the USB USER port.

{sudo} cat /dev/ttyACM0

You should see 9 floating point values corresponding to the x, y, and z values from the gyroscope, accelerometer, and magnetometer.

Debug

Again, with stlink.

In one terminal:

{sudo} st-util

And another:

arm-non-eabi-gdb build/stm32f3discovery-demo.elf

And then within GDB:

> target extended-remote :4242
...
> load
...

And you can debug with GDB as you would expect.

About

Simple demo of gyroscope and usb-cdc on STM32F3Discovery with ChibiOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published