Hi all, I’m trying to speed up how fast I can iterate firmware (make a change, build, flash, and test). The problems I’m facing at the moment are:
I flash via serial or DFU which requires me to go to the device, hold down some button combination, and go back to flash. This is quite cumbersome. Is there a way to eliminate the need for physical interaction with the device while flashing?
I am using the serial interface to log debug messages. Since the serial interface is shared with the programming interface I need to disconnect and reconnect my serial terminal with each iteration as well. Also quite annoying.
You can force the electron into DFU mode by setting the baud rate of the serial interface. Check out the Serial tutorial. For the issue with log interface vs. Programming interface, you could use a uart to ttl serial adapter and output your logs to the serial or serial1 ports. The advantage to that adapter is that the serial interface would not drop during a device reboot.
Yes, I had almost the exact same response as ninjatill typed out when he posted.
DFU mode can be entered by connecting at 14400 baud, then disconnecting. If the device is running 0.8.0, there is also a USB control request interface that offers many new options.
One solution to the shared port problem is to do your debugging using one of the other serial ports on the Electron and a FT232 USB to TTL serial adapter. One really nice thing about this: your serial terminal won’t disconnect even when the device reboots!
Thanks, I’ll take a look at the baud rate forcing DFU mode. I’m using serial 1 for a peripheral already but it looks like the Electron has a serial 4 available which I will try
Here’s a powershell script that will flash the application automatically by DFU over USB in case it helps someone. Note: COM port needs to be customized