Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 4.7 KB

Firmware_update_instructions.md

File metadata and controls

103 lines (77 loc) · 4.7 KB

Torquetuner Firmware Update Guide (firmware version: 20221020)

First time firmware upload instructions

Modified from the T-Stick firmware update instructions INSTALL ALL DEPENDENCIES AND REAL ALL OBSERVATIONS BEFORE UPLOAD !

Flash Moteus Board

Recompiling the Moteus firmware:

  1. Install OpenOCD on your device.
  2. Clone moteus: https://github.com/IDMIL/Moteus/tree/RotaRep branch.
  3. In the moteus directory, build the moteus firmware:
tools/bazel build --config=target //:target --verbose_failures
  1. (optional) test tools/bazel test --config=target //:target

Setup flash with debug USB stick:

  1. Connect the power cable to power input of the controller (with the power supply unplugged from the wall).

  2. Connect the canfd connector to the controller.

  3. Connect the fdcanusb to the usb port of the PC.

  4. You may now plug the power supply into the wall.

  5. A green light on the controller should now appear.

  6. Connect the USB stick to the board using the JST ZH-6 and plug in the USB stick into the computer.

  7. Flash with debug USB stick: ./fw/flash.py

Upon succesful flash, the following lines will be output:

** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
...
shutdown command invoked

Note: if you encounter the error message:

Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.223809
Error: init mode failed (unable to connect to the target)

check the different connections related to the power supply.

  1. Install tview using pip: pip install moteus-gui
  2. Launch Moteus GUI: python -m moteus_gui.tview --devices=1
  3. In the Moteus GUI, check the I2C state and status:
d i2c.state
d i2c.status

For now state should be READY or LISTEN and status ERROR or BUSY (with no other i2c device connected).

Flash TinyPico Board

Install PlatformIO

  1. To download and install PlatformIO, follow the instructions at https://platformio.org/platformio-ide. We recomment using PlatformIO under Visual Studio Code, but you can also choose another editor.

Clone the Torquetuner repository

  1. Clone this repository using git clone https://github.com/IDMIL/TorqueTuner.git. Alternatively, you can download the repository as a zip file at https://github.com/IDMIL/TorqueTuner. Take note of the folder location.

Open software project and flash it to the Torquetuner

  1. Open the Torquetuner software folder in VSC/PlatformIO. You can get help on how to use PlatformIO at https://docs.platformio.org/en/latest/core/quickstart.html
  2. Open the config.json file in the Data folder to make changes before uploading.
  3. If it is the first time flashing, you may see an error pointing to the ESP32 inet.h file. The file requires manual fixing. Check the issue at mathiasbredholt/libmapper-arduino#3

When ready, you need to flash both the firmware and the filesystem image. Choose the proper platform accordingly (tinypico) and use the PlatformIO menu to flash the image to the Torquetuner.

Test Torquetuner

After flashing, you can use the VSC/PlatformIO serial monitor to check if the Torquetuner module is booting properly. You should see Torquetuner booting process.

You can also interact with the controller using the following commands:

  • 'reboot' to reboot

Other Documentation

Torquetuner connection guide – v1.0

How to build a Torquetuner Module

Firmware information

Torquetuner V1 - TinyPico - USB - WiFi Input Devices and Music Interaction Laboratory (IDMIL)