emgre / cc3200-rs

Rust support crate for the Texas Instruments CC3200 SimpleLink™ microcontroller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

General links

CC3200

PAC (Peripheral Access Crate)

  • SVD File Format: Cortex Microcontroller Software Interface Standard (CMSIS) XML format to describe the peripherals of a microcontroller
  • svd2rust: Generate Rust code from SVD files to easily access registers
  • msp432p401r: Texas Instruments MSP432 generated code using svd2rust
  • dslite2svd: Energia (an Arduino fork for TI devices) has a custom XML format to describe the peripherals. This project transform the files into standard SVD files. Although Energia supports the CC3200, the included XML does not have the peripherals listed, only very generic information is available. However, it has some peripherals for the CC3220S and CC3220SF.

HAL (Hardware Abstraction Layer)

Cortex-M

Debugging

Requirements on Windows:

Debugging in the command line

  • In a first terminal, openocd -f cc3200.cfg
    • This starts the OpenOCD. It communicates with the MCU and acts as a GDB server
    • Keep this running at all time. If you need to restart it, you might have to disconnect and reconnect the board.
  • In a second terminal, cargo run.
    • This compiles the code and start a GDB client properly initialized for debugging.
    • The MCU will break on main.
    • Have a look at cc3200.gdb file to see what initialization is required.
    • You can run cargo run --release to debug the release version of the program.

Debugging in Visual Studio Code

Requirements:

The .vscode directory contains task definitions and launch configurations for both Debug and Release.

  • Launch openocd: openocd -f cc3200.cfg and keep it running.
  • In VS Code, select one of the two debugging target and click the start button.
    • It will build the target, start and initialize a GDB session, upload the code and break on main.
    • It also offers a "Cortex Peripherals" view extracted from the SVD files where you can read and edit all the peripheral registers.

Flashing the final program

  • Generate the binary file to flash: cargo objcopy --release --bin cc3200-example -- -O binary cc3200.bin
  • Put jumper J15 to set SOP pins to FLASH mode
  • Connect the CC3200 to your computer
  • In Uniflash 3.4:
    • Start a new configuration of "C32xx Serial(UART) Interface"
    • Set the COM port to the one of the CC3200 (you can find it in Windows Device Manager)
    • In "System Files" > /sys/mcuimg.in, set the "Url" to the binary file created, tick the "Update" and "Verify" boxes.
    • In "CC31xx/CC32xx Flash Setup and Control", click "Format".
  • Disconnect the CC3200.
  • Remove jumper J15 to let it run automatically when powering up.
  • Reconnect the CC3200 and enjoy your program running!

About

Rust support crate for the Texas Instruments CC3200 SimpleLink™ microcontroller

License:MIT License


Languages

Language:Rust 99.9%Language:GDB 0.1%Language:Shell 0.0%Language:RPC 0.0%Language:Logos 0.0%