Hi there all.
Product link: https://industruino.com/shop/product/industruino-ind-i-o-d21g-2 Arduino Core: https://github.com/Industruino/IndustruinoSAMD
The Industruino is a Arduino Zero like industrial automation platform. So far we've spent over a year on software dev for this unit to drive some robotic test jigs in our factory. But we've hit a major snag.. I've murdered their bootloader and I can't seem to get a bootloader back into it.
Yer supposed to be able to get the bootloader onto it just using the Arduino IDE. The bootloader is loosely based on Arduino Zero SAM-BA bootloader with a added module for loading firmware by tftp using an additional ethernet module.
The actual act of using the "Burn Bootloader" function is what bricks these devices. The device is flashed successfully but ends up in a reboot loop.. I've only managed to get so far into debugging it with openocd... basically the bootloader starts, gets far enough through running to set it's USB PID and VID and start a animation with the backlight on it's LCD then after about 1.5 seconds it resets.
I can't catch the reset, figure out exactly what is happening. My suspicion is as this is an obscure product with it's very VERY out of date code. That it is somehow inherently broken. So I've got somewhat to the F*^& IT stage.
Now I think we can get away with not having any kind of SAM-BA support. Put the program code directly into 0x00000000 instead of above the bootloader at 0x4000 (Zero uses only up to 0x2000) and upload using the Atmel-ICE.. We're developing for this in a PlatformIO environment(which I also seem to have broken, but one problem at a time).. So I'm guessing I'm going to have to update the linker and programming scripts behind the scenes. Ideal goal would be to totally bypass Arduino and platformio and simply have 1 folder with all the source code and necessary binaries(gcc, binutils, etc) and incl Arduino core and all libs and simply be able to 'make' and get delivered a compiled binary ready for upload...
Additional question programming with openocd... when I try to program bootloader code in openocd it always fails giving me a NVM is protected error, but when I check the flash banks they are all listed as unprotected? it would greatly assist me if I could get past this problem,