Problem generation ehex file

jhendrix

Active member
About a year ago I did whatever I needed to do to get .ehex files to be generated. I have been doing this for about a year and have released several versions of my firmware in .ehex format.
Yesterday I was cleaning up some of my directories and I moved my project folder to a different location (still in my Documents folder, just a little less crowded directory). I also updated my .gitignore and removed the files in my .pio and .vscode directories to clean up my git repo.
I then discovered that when I did a build, the .ehex file was no longer being generated.
I still have my key.pem file in the project root directory (which is where it has been all along). I also copied it to the src directory, so it's next to main.cpp, and I also tried copying it to the output directory, so it's next to my .hex file and it still doesn't generate the .ehex file.
I even launched the arduino IDE to see where it's sketchbook location is and put it in there, still no luck.
If I run the teensy_secure encrypthex command by hand, it works

I'm running the latest version of vscode with platformIO.
Any idea what I did, or need to do to get a build to also create the .ehex file?
Here is the output from my build.

PLATFORM: Teensy (5.0.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.159.0 (1.59)
- tool-teensy @ 1.159.0 (1.59)
- toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft

Building in release mode
Linking .pio\build\cockpit\firmware.elf
Calculating size .pio\build\cockpit\firmware.elf
Checking size .pio\build\cockpit\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
teensy_size: Memory Usage on Teensy 4.0:
teensy_size: FLASH: code:235868, data:863948, headers:9172 free for files:922628
teensy_size: RAM1: variables:253440, code:206800, padding:22576 free for local variables:41472
teensy_size: RAM2: variables:12416 free for malloc/new:511872
Building .pio\build\cockpit\firmware.hex
And I love that sparkfun now sells teensys, makes it real easy to get quantity discounts.
 
I have a copy of my key.pem file in the {Documents}/Arduino directory. When I start the arduino IDE, it shows the sketchbook location as that directory. I am using vscode, so I don't know if it's using the same builder.
 
If you are using only PlatformIO, you may need to run Arduino IDE 1.8.19 at least once, even if you don't actually compile any programs. Arduino IDE will automatically create the sketchbook folder and setting data which teensy_secure reads to discover where your sketchbook folder is located. Just having a {Documents}/Arduino folder is not enough. You must also have setting data which Arduino IDE wrote, because teensy_secure does not have the folder name {Documents}/Arduino hard-coded. It reads the Arduino IDE settings data to find that location.
 
Last edited:
To explain a bit further, Arduino IDE 1.8.x and 2.x.x store settings data quite differently. Older versions of teensy_secure (1.59 and earlier) only know how to read the settings data from Arduino IDE 1.8.x. We also only had the GUI support for teensy_secure for Arduino IDE 1.8.x until quite recently.

If you use 1.60-beta3, the GUI also exists in Arduino IDE 2.x.x and teensy_secure from 1.60-beta3 looks for both Arduino IDE 1.8.x and 2.x.x settings to learn the sketchbook folder location.
 
Back
Top