Program two independent Arduino sketches into Teensy 3.1

Status
Not open for further replies.

embedded-creations

Well-known member
I came up with some very minor Arduino/Teeensyduino modifications and code to add to a sketch to allow compiling two independent Arduino sketches - each at a different non-overlapping section of Flash - which can be combined into one .hex file and programmed into the Teensy 3.1. You can jump from one sketch to the other after a reset.

I needed this to be able to run an Arduino sketch that has a USB Serial connection to the computer for normal use, and an occasional USB-MSD connection to the computer (using a uTasker, not Arduino project) for loading new files. I think being able to have two independent USB functions without loading a new sketch is the biggest use case for this technique, but I'm interested to see how other people use it.

The code and instructions on how to modify Arduino/Teensyduino are here:
https://github.com/pixelmatix/JumpToAppWithOffset

The example blinks an LED quickly a couple times, then jumps to a second application, which blinks an LED slowly, so you can see that both sketches are being run. This technique has also been used in a more complicated case, jumping to a uTasker project from our Aurora LED art display sketch.

The Arduino/Teensyduino modifications can also be used to compile an Arduino application that can be run from a bootloader, like the uTasker bootloader.

I will share more about the uTasker USB-MSD application later. I think this could be useful for a lot of projects, e.g. being able to load .wav files to a microSD card on the Teensy Audio board without needing to pull the microSD card or even reprogram the Teensy.
 
Status
Not open for further replies.
Back
Top