Skip to content

Intermittent Firmware Upload issue from Linux #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nigelb opened this issue Jun 9, 2021 · 0 comments
Open

Intermittent Firmware Upload issue from Linux #4

nigelb opened this issue Jun 9, 2021 · 0 comments

Comments

@nigelb
Copy link

nigelb commented Jun 9, 2021

What platform are you using?

OS: Ubuntu 20.04.2 LTS
Arduino: 1.8.13
Arduino_Apollo3: 2.x.x

What version of the device are you using? Is there a firmware version?

SparkFun RedBoard Artemis ATP

How is the device wired to your platform?

USB-C Cable from PC to device.

How is everything being powered?

USB-C Cable from PC to device.

Are there any additional details that may help us help you?

Steps to reproduce?

For a while now (since sparkfun/Arduino_Apollo3#94 was resolved) I have had an issue where, intermittently, I would be unable to upload a firmware without disconnecting and then reconnecting the board from the PC.:

/home/user/.arduino15/packages/SparkFun/hardware/apollo3/2.1.0/tools/uploaders/svl/dist/linux/svl /dev/ttyUSB0 -f /tmp/arduino_build_772970/Serial.ino.bin -b 921600 -v 


Artemis SVL Bootloader
Script version 1.7

Phase:	Setup
	Cleared startup blip
Failed to enter bootload phase

Phase:	Setup
	Cleared startup blip
Failed to enter bootload phase

Phase:	Setup
	Cleared startup blip
Failed to enter bootload phase
Target failed to enter bootload mode. Verify the right COM port is selected and that your board has the SVL bootloader.

Ultimately I tracked the problem down after I realized that this only happens after I open the port with the Linux program screen as a serial monitor.

After some investigation I found that screen makes a number of changes to the OS settings for the port.
The relevant change can be reversed with the following command:

$> stty -F /dev/ttyUSB0 hupcl

At which point the the firmware can now be uploaded (without having to reconnect the device):

/home/user/.arduino15/packages/SparkFun/hardware/apollo3/2.1.0/tools/uploaders/svl/dist/linux/svl /dev/ttyUSB0 -f /tmp/arduino_build_772970/Serial.ino.bin -b 921600 -v 


Artemis SVL Bootloader
Script version 1.7

Phase:	Setup
	Cleared startup blip
	Got SVL Bootloader Version: 5
	Sending 'enter bootloader' command

Phase:	Bootload
	have 118568 bytes to send in 58 frames
	Sending frame #1, length: 2048
	Sending frame #2, length: 2048
	Sending frame #3, length: 2048
	Sending frame #4, length: 2048
	Sending frame #5, length: 2048
	Sending frame #6, length: 2048
	Sending frame #7, length: 2048
	Sending frame #8, length: 2048
	Sending frame #9, length: 2048
	Sending frame #10, length: 2048
	Sending frame #11, length: 2048
	Sending frame #12, length: 2048
	Sending frame #13, length: 2048
	Sending frame #14, length: 2048
	Sending frame #15, length: 2048
	Sending frame #16, length: 2048
	Sending frame #17, length: 2048
	Sending frame #18, length: 2048
	Sending frame #19, length: 2048
	Sending frame #20, length: 2048
	Sending frame #21, length: 2048
	Sending frame #22, length: 2048
	Sending frame #23, length: 2048
	Sending frame #24, length: 2048
	Sending frame #25, length: 2048
	Sending frame #26, length: 2048
	Sending frame #27, length: 2048
	Sending frame #28, length: 2048
	Sending frame #29, length: 2048
	Sending frame #30, length: 2048
	Sending frame #31, length: 2048
	Sending frame #32, length: 2048
	Sending frame #33, length: 2048
	Sending frame #34, length: 2048
	Sending frame #35, length: 2048
	Sending frame #36, length: 2048
	Sending frame #37, length: 2048
	Sending frame #38, length: 2048
	Sending frame #39, length: 2048
	Sending frame #40, length: 2048
	Sending frame #41, length: 2048
	Sending frame #42, length: 2048
	Sending frame #43, length: 2048
	Sending frame #44, length: 2048
	Sending frame #45, length: 2048
	Sending frame #46, length: 2048
	Sending frame #47, length: 2048
	Sending frame #48, length: 2048
	Sending frame #49, length: 2048
	Sending frame #50, length: 2048
	Sending frame #51, length: 2048
	Sending frame #52, length: 2048
	Sending frame #53, length: 2048
	Sending frame #54, length: 2048
	Sending frame #55, length: 2048
	Sending frame #56, length: 2048
	Sending frame #57, length: 2048
	Sending frame #58, length: 1832

	Upload complete

	Nominal bootload bps: 46841.17
nigelb added a commit to nigelb/Apollo3_Uploader_SVL that referenced this issue Jun 9, 2021
nigelb added a commit to nigelb/Apollo3_Uploader_SVL that referenced this issue Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant