Skip to content

Hardware Abstraction Layer for MSP432P401R microcontroller

License

Notifications You must be signed in to change notification settings

msp432-rust/msp432p401r-hal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

msp432p401r-hal crates.io

Hardware Abstraction Layer for MSP432P401R microcontroller

Currently under development:

  • Watchdog
  • GPIO
  • Clock
  • PCM
  • Flash Control
  • TimerA
  • Timer32
  • PWM (TimerA)
  • Port MAP
  • ADC
  • DMA
  • RTC
  • SPI - EUSCI
  • I²C - EUSCI
  • UART - EUSCI
  • Cap. Touch IO
  • CRC32
  • AES256
  • Shared Reference (REF A)
  • Comparator
  • LCD Control
  • FPU
  • Random Seed
  • Reset Controller
  • System Controller
  • Power Supply System
  • Cortex M4 Periph

Running the examples

Make sure you have OpenOCD and GNU ARM Embedded toolchain installed and up-to-date

$ brew install openocd --HEAD

Setup Rust nightly and add the ARM build platform target:

$ rustup default nightly
$ rustup target add thumbv7em-none-eabihf

Clone and compile the project:

$ git clone https://github.com/msp432-rust/msp432p401r-hal.git
$ cd msp432p401r-hal
$ example=hello_world
$ cargo build --example $example

Open a OpenOCD server and leave it open in a terminal:

$ openocd

On a separate terminal, open the GDB client:

$ arm-none-eabi-gdb -q target/thumbv7em-none-eabihf/debug/examples/$example
$ (gdb) target extended-remote :3333
$ (gdb) load
$ (gdb) monitor arm semihosting enable
$ (gdb) continue