I’m trying to make a test bench of a couple Seeeduino LoRaWAN boards (w/o GPS), and I have come across the following issue:
Once in a while, a board is unable to boot. It is visible by the ‘L’ LED rapidly flashing. Looking at the schematics, this is actually wired to the STM32L ‘SCK’ pin, which is in the RisingHF chip.
I’m not sure what the bootloader has to do with this, but it might be the reason for it not booting.
The chip is currently running 3.3.1 firmware.
Pressing the reset button once or twice makes it sometime get ‘alive’ and I’ll be able to flash it.
When the device is in this broken state, it does actually enumerate as a USB device. However, you are unable to put it in bootloader mode through the ard-reset-arduino with the --zero flag, like the Arduino IDE does.
I dont understand either! Its the only thing that I can use as identification that it doesnt work.
It is fairly common that it doesn’t work, actually. I can make a video, that might help? I dont understand how the SPI is related to the non-booting issue of the samd21
I tried to use ATMEL-ICE with the SAM connector to mini-squid pins, but i was unable to get openocd to detect the chip. I could replicate this on my SAM4S board, when the chip has the security bit set. I have then to erase the chip in order to flash it again. However, there is no erase pin that i can poke to erase the flash of these samd21 chips, or so it seems…
I finally was able to flash it. I used the atmel-ice sam jtag & swd adapter (the little pcb with the 20 pin plug), and then hooked it up as follows (on the right):
This finally made the programmer find the pcb and i was able to recover all pcbs
source [find interface/cmsis-dap.cfg]
# chip name
set CHIPNAME at91samd21g18
set ENDIAN little
# choose a port here
set telnet_port 0
source [find target/at91samdXX.cfg]
I recommend downloading and installing openocd from source so you have the latest version. You can find the official mirror here: https://github.com/ntfreak/openocd