Hi,
I am currently using the Arduino SDUBoot
library allowing me to change sketches on the fly via an SD card on my Adafruit Feather M0 whilst being able to keep the standard boot loader.
All works fine, provided that I export the binary from Arduino IDE. For some reason, the firmware.bin file produced by PlatformIO does not load into the flash and I cannot determine why. The PIO sketches only work if directly built/uploaded, and not via SD card. Only the exported bin files from Arduino IDE work correctly.
Test Case:
SD Card: MS-DOS (FAT32)
Hardware setup - default SPI bus, but the SD CS is on hardware pin 8 (A2)
- Upload the SDUBoot project to Feather via USB. Connect SD card to SPI bus and CS to hardware pin 8 (A2)
- Format SD card to MS-DOS FAT32
- Copy
FIRMWARE.bin
fromBlink_ArduinoIDE
and insert SD card - Press reset on board and the LED should flash 250ms on/250ms off
- Remove SD card and copy
FIRMWARE.bin
fromBlink_PIO
- Press reset on board and see how LED speed doesnāt change (LED should flash 1s on/1s off) and how file doesnt get deleted from SD card
- Copy
FIRMWARE.bin
fromFade_ArduinoIDE
and insert SD card - Press reset on board and the LED should fade on and off slower than the boot loader fade
All I can assume is that PIO is doing something differently under the hood as the binary files seem a lot smaller than those from Arduino IDE. Then again, Iāve been staring at a screen for a long time, so I hope I am not missing something stupid.
Hoping someone has one of these boards and can help figure out whatās going on, as itās extremely frustrating having to keep messing around with two different IDEās.