SAMR21-Xplained Pro can't network without EDBG


I’m trying to power the SAMR21-Xplained pro with a 3.7V battery. I have two of them: one acting as border router and using the EDBG USB port with a linux laptop, the other is running coap with sensors and a periodic sleep-wakeup.

I’ve found that if I don’t use the EDBG port, I cannot ping the battery-powered node or send coap replies to my linux. GNRC_networking doesn’t work either. I’ve tried using the TARGET USB port as well and the 5V0_IN pins too. In these two cases the current is lower (since debugger is in sleep mode) and I can see the current going down when I set the low power mode and up again when waking up in the code, so that confirms it is running, but I still cannot ping or send messages.

I’ve also tried setting DEVHELP=0 in the makefile, but it did not seem to have an impact.

I want to be able to power my node through the external power header pins and have networking work.

Is there something specific to RIOT that could be preventing this, or is it the debugger that enables networking in the first place?



IIRC EDBG is used to set the pre-programmed MAC address of the radio. Maybe @benpicco, as the implementor as that part of the driver, can offer some help here.

Indeed, that could be related - maybe I2C hangs when EDBG is not powered? Maybe the retry count is also set too high.

You can try deleting eui_provider_params.h from the board’s include/ directory to see if that helps. If it does, try reducing the tries count in that file until you have found an acceptable number, this could then be PRed.

Deleting the eui_provider.params.h got ping and coap to work from external power sources.

It looks like if I delete the file and re-flash muliple times the resulting address stays the same, so at least that is a plus.

But changing the tries did not seem to have an effect.

If I reduce it too much, and then unplug and replug the usb into EDBG it ends up not receiving the address at all.

It seems like if I use another power source the EDBG never gets turned on, but it is required to be on to get the MAC address identifier in the first place?