You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some Arduino platforms (like the Uno) have a dedicated USB-serial chip, so the USB-serial device is consistently present throughout the program-run-reset cycle. However, others (like the Leonardo and Micro) use the same chip for USB-serial and for running Arduino programs, which means that on reset the device goes away (at least momentarily).
The one I'm using now is from Adafruit's "Bluefruit" line of nRF52-based Arduino-compatible boards.
Because the USB-serial device doesn't exist for a moment after programming (until the chip boots and the USB-serial device is recognized by the host), ardi attach-and-watch can fail:
% ardi attach-and-watch
ardi Using compile opts from build definition: blinky
ardi Using baud from build definition: blinky baud=9600
ardi Compiling... fqbn="adafruit:nrf52:cplaynrf52840" sketch=blinky.ino
Sketch uses 40596 bytes (4%) of program storage space. Maximum is 815104 bytes.
Global variables use 7140 bytes (3%) of dynamic memory, leaving 230428 bytes for local variables. Maximum is 237568 bytes.
ardi Compilation successful fqbn="adafruit:nrf52:cplaynrf52840" sketch=blinky.ino
ardi Uploading... build=. device=/dev/ttyACM0 fqbn="adafruit:nrf52:cplaynrf52840"
TOUCH: error during reset: setting DTR to OFF: protocol error
Upgrading target on /dev/ttyACM0 with DFU package /tmp/arduino-sketch-3015A9A7226BD79EC290418CB735FCEF/bluefruit.ino.zip. Flow control is disabled, Single bank, Touch disabled
########################################
########################################
Activating new firmware
Device programmed.
ardi Upload successful build=. device=/dev/ttyACM0 fqbn="adafruit:nrf52:cplaynrf52840"
ardi Watching blinky.ino for changes
ardi Attaching to port port=/dev/ttyACM0
ardi Failed to read from device baud=9600 error="no such file or directory" name=/dev/ttyACM0
Note that once the chip boots (mere milliseconds later), the serial device shows up and can be accessed just fine; a separate ardi attach afterward works:
% ardi attach
ardi Attaching to port port=/dev/ttyACM0
Hello!
Hello!
Hello!
...
Probably this is best dealt with by polling for the serial port to exist? Note that if the chip gets reset (e.g. someone hits a reset button) the serial port will wink out of existence for a moment, so it's probably best if after a serial read error "attach" returned to polling for the device? (That's secondary though.)
The text was updated successfully, but these errors were encountered:
Some Arduino platforms (like the Uno) have a dedicated USB-serial chip, so the USB-serial device is consistently present throughout the program-run-reset cycle. However, others (like the Leonardo and Micro) use the same chip for USB-serial and for running Arduino programs, which means that on reset the device goes away (at least momentarily).
The one I'm using now is from Adafruit's "Bluefruit" line of nRF52-based Arduino-compatible boards.
Because the USB-serial device doesn't exist for a moment after programming (until the chip boots and the USB-serial device is recognized by the host),
ardi attach-and-watch
can fail:Note that once the chip boots (mere milliseconds later), the serial device shows up and can be accessed just fine; a separate
ardi attach
afterward works:Probably this is best dealt with by polling for the serial port to exist? Note that if the chip gets reset (e.g. someone hits a reset button) the serial port will wink out of existence for a moment, so it's probably best if after a serial read error "attach" returned to polling for the device? (That's secondary though.)
The text was updated successfully, but these errors were encountered: