Code Monkey home page Code Monkey logo

stm32f407vet6-rust-examples's Introduction

STM32F407VET6 Rust Examples

This repository contains simple examples for STM32F407VET6 micro-controllers.

Board

The board can be purchased from AliExpress for about 10$, click here

Specifications:

  • STM32F407VET6 ARM Cortex M4
  • 168MHz, 210 DMIPS / 1.25 DMIPS / MHz
  • 1.8V - 3.6V operating voltage
  • 8MHz system crystal
  • 32.768KHz RTC crystal
  • 2.54mm pitch pins
  • JTAG/SWD header
  • 512KByte Flash, 192 + 4 KByte SRAM
  • 3x SPI, 3x USART, 2x UART, 2x I2S, 3x I2C
  • 1x FSMC, 1x SDIO, 2x CAN
  • 1x USB 2.0 FS / HS controller (with dedicated DMA)
  • 1x USB HS ULPI (for external USB HS PHY)
  • Micro SD
  • Winbond W25Q16 16Mbit SPI Flash
  • RTC battery CR1220
  • 1x 10/100 Ethernet MAC
  • 1x 8 to 12-bit Parallel Camera interface
  • 3x ADC (12-bit / 16-channel)
  • 2x DAC (12-bit)
  • 12x general timers, 2x advanced timers
  • AMS1117-3.3V: 3.3V LDO voltage regulator, max current 800mA
  • Micro USB for power and comms
  • Red power LED D1
  • Red user LED D2 (PA6) active low
  • Red user LED D3 (PA7) active low
  • 2x jumpers for bootloader selection
  • Reset button, Wakeup button, 2x user buttons K0 (PE4) and K1 (PE3)
  • 2x24 side pins + 2x16 bottom pins + 1x4 ISP pins
  • 2x16 FMSC LCD Interface
  • NRF24L01 socket
  • M3 mounting holes
  • Dimensions: 85.1mm x 72.45mm

Modifications:

  • change HSE_VALUE from 8000000 to 25000000
  • change PLL_M from 8 to 25

The above details have been picked up from here.

Reference Manual : click here

Examples

LED

This code is to blink the D3 LED on the board.

To build the release binary :

cargo build --release --example leds

In one terminal start openocd :

openocd

In another terminal start setup gdb to run launch the application :

arm-none-eabi-gdb -x openocd.gdb target/thumbv7em-none-eabi/release/examples/leds

Button

The code prints the button status onto the console via semihosting.

To build the release binary :

cargo build --release --example buttons

In one terminal start openocd :

openocd

In another terminal start setup gdb to run launch the application :

arm-none-eabi-gdb -x openocd.gdb target/thumbv7em-none-eabi/release/examples/buttons

External interrupts via GPIO ports

This is a little more complicated and fun example. The board has 2 user buttons and 2 user LEDs. The code configures each button to trigger on being pressed, and the interrupt handler toggles a button.

To build the release binary :

cargo build --release --example leds

In one terminal start openocd :

openocd

In another terminal start setup gdb to run launch the application :

arm-none-eabi-gdb -x openocd.gdb target/thumbv7em-none-eabi/release/examples/leds

Note that the gdb configuration has been passed to gdb. But the application is not started on the board, run continue command in gdb to resume execution.

References

License

Licensed under the MIT License.

stm32f407vet6-rust-examples's People

Contributors

kanishkarj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tinylabs warpv

stm32f407vet6-rust-examples's Issues

some other examples for F407VET6

Hi, I thought you might be interested, I made this example for the same board:
https://github.com/nebelgrau77/Conway-s_Game_of_Life_Rust/tree/STM32F407_seamless

and also ported another one from an F103 example:
https://github.com/nebelgrau77/STM32Fx_OLED_whitenoise/tree/STM32F407_trueRNG

You're welcome to fork/use/recycle :) Also if you know how to use RTC please let me know, this board is perfect for time-related projects but the API is much different from the STM32F1xx and I haven't figured out how to deal with the built-in RTC yet.

Michal/nebelgrau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.