Skip to content

Code for my engineering thesis project aimed to help visually impaired people detect obstacles.

License

Notifications You must be signed in to change notification settings

BlankTiger/visio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visio

Code for my engineering thesis project.

Idea is to help visually impaired people in detecting obstacles in their surroundings via haptic feedback. To accomplish this, vibration motors forming a matrix on users hand are formed to provide a low resolution image through touch. Signal is generated by a Time of Flight (ToF) sensor.

To build this project I used:

  • Arduino Nano RP2040 Connect
  • VL53L1X ToF sensor
  • Pca9685 PWM signal generator
  • 16 vibration motors
  • SSD1306 OLED display for debugging
  • 3D printer to print cases for components
  • a lot of patience..

Table of Contents

  1. Getting Started
  2. Programming
  3. Acknowledgements

Getting Started

Before trying any of the binaries, please ensure you have the latest nigthly version of Rust installed, along with the right target support:

rustup self update
rustup update nigthly
rustup target add thumbv6m-none-eabi

You may also want to install these helpful tools:

# Useful to creating UF2 images for the RP2040 USB Bootloader
cargo install elf2uf2-rs --locked
# Useful for flashing over the SWD pins using a supported JTAG probe
cargo install probe-run

Programming

Follow these steps to get this code onto your microcontroller.

Loading a UF2 over USB

Step 1 - Install elf2uf2-rs:

$ cargo install elf2uf2-rs --locked

Step 2 - Make sure your .cargo/config contains the following (it should by default if you are working in this repository):

[target.thumbv6m-none-eabi]
runner = "elf2uf2-rs -d"

The thumbv6m-none-eabi target may be replaced by the all-Arm wildcard 'cfg(all(target_arch = "arm", target_os = "none"))'.

Step 3 - Boot your RP2040 into "USB Bootloader mode", typically by rebooting whilst holding some kind of "Boot Select" button. On Linux, you will also need to 'mount' the device, like you would a USB Thumb Drive.

Step 4 - Use cargo run, which will compile the code and started the specified 'runner'. As the 'runner' is the elf2uf2-rs tool, it will build a UF2 file and copy it to your RP2040.

$ cargo run --release --bin visio

Loading with probe-run

The Knurling project has a tool called probe-run. This is a command-line tool which can flash a wide variety of microcontrollers using a wide variety of debug/JTAG probes. It is based on a library called probe-rs. Unlike using, say, OpenOCD, probe-rs can autodetect your debug probe, which can make it easier to use.

Step 1 - Install probe-run:

$ cargo install probe-run

Step 2 - Make sure your .cargo/config contains the following:

[target.thumbv6m-none-eabi]
runner = "probe-run --chip RP2040"

Step 3 - Connect your USB JTAG/debug probe (such as a Raspberry Pi Pico running this firmware) to the SWD programming pins on your RP2040 board. Check the probe has been found by running:

$ probe-run --chip RP2040 --list-probes
The following devices were found:
[0]: J-Link (J-Link) (VID: 1366, PID: 0101, Serial: 000099999999, JLink)

There is a SEGGER J-Link connected in the example above - the mesage you see will reflect the probe you have connected.

Step 4 - Use cargo run, which will compile the code and start the specified 'runner'. As the 'runner' is the probe-run tool, it will connect to the RP2040 via the first probe it finds, and install your firmware into the Flash connected to the RP2040.

$ cargo run --release --bin visio

Loading with picotool

As ELF files produced by compiling Rust code are completely compatible with ELF files produced by compiling C or C++ code, you can also use the Raspberry Pi tool picotool. The only thing to be aware of is that picotool expects your ELF files to have a .elf extension, and by default Rust does not give the ELF files any extension. You can fix this by simply renaming the file.

Also of note is that the special pico-sdk macros which hide information in the ELF file in a way that picotool info can read it out, are not supported in Rust. An alternative is TBC.

Acknowledgements

About

Code for my engineering thesis project aimed to help visually impaired people detect obstacles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages