-
-
Notifications
You must be signed in to change notification settings - Fork 398
GPIO-based DTR reset needed for upload on Raspberry Pi/UP2 board etc. #34
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
Comments
Anyone have any opinion on this? |
I'm not very practical with these boards but, there is no really other way to associate GPIO 4 to DTR of ttyAMA0? Doing that would fix the problem from the root. I'm also wondering if this should be fixed on the uploader instead of hardcoding in the CLI. There is a way to autodetect the gpionumber? Is the Arduino IDE able to upload? |
Hi @cmaglie I have just gone thru the CLI code, and realized that the CLI is literally just a CLI and still needs all of the build tools for any give platform such as avrdude to perform the upload. I had not dug far enough into the CLI code to realize that it is not a replacement for the toolchain. So there are 2 techniques used in order to deal with the DTR being a separate pin when programming an Arduino from for example a Raspberry Pi or UP2 board.
It seems useful to be able to do the ioctrl strace hack for the user based on command flags passed into the |
Hi @deadprogram , |
That looks very cool @facchinm thanks for the reply. The board I am wanting to flash is the GrovePi. This is the script that does it using a patched avrdude: https://github.com/RobertLucian/GrovePi/blob/master/Firmware/grovepi_firmware_update.sh Pinging @RobertLucian will this allow replacing the custom patched avrdude you are maintaining for @DexterInd for the mainline version? |
@deadprogram I'm gonna have a look at this stuff - it's been a while since we looked into |
I flash Arduino boards from an RPI all the time using the linuxgpio programmer. Just connect your pi to the Arduino using SPI and it works great. |
Closing since discussion has been stale for a while, feel free to re-open if latest messages didn't work. |
I'm still running into this The board I'm using is an Arduino zero compatible, Mechaduino board. Is there some additional piece of software am going to need to upload to this board? |
print troubleshooting info, added broker port, general cleanup
Support multiple PROJECT_PATH arguments
Nearly 4 years later what is the conclusion on this? How do I control a DTR line from arduino-cli? Has the suggested solution been implemented? For portability is it possible to have arduino-cli triggering a reset command rather than gpio direct control maybe? Then the user would write this reset command. @deadprogram how did you sort this in the end? |
First of all, thanks for working on this project, I have been wanting a Golang-based CLI for the Arduino toolchain for the longest time.
It would appear that in order to upload code to an Arduino that is connected directly to the
ttyAMA0
serial port via the pins on a Raspberry Pi, UP2 board or other board, a GPIO pin-based DTR reset needs to be implemented.Such like an implementation could be an additional flag named something like
gpioreset
that is conditional similar to what https://github.com/arduino/arduino-cli/blob/master/commands/upload/upload.go#L212 does, but that pulls the GPIO pin high/low similar to https://github.com/platformio/platformio-core/pull/687/files#diff-9df12ed969b3177c694a1020f4de5cc8R82 but of course allowing a specific GPIO pin to be specified.For example:
would use GPIO4 to perform the reset before attempting the upload.
Any thoughts on this?
The text was updated successfully, but these errors were encountered: