This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connections between RPi and nano for flashing
#6
(2020-10-01, 06:00 AM)seandepagnier Wrote: I'm using an arduino over spi on the hat to receive rf signals as well as other functions.  This is not the same atmega as the motor controller.

Ok.  I got a bit confused because this command was in hat/arduino.py.

I looked into motor controller programming.  @seandepagnier, you probably know all this, so I'm half talking out loud for my own benefit, half for anyone else.

As you mentioned, if I burn optiboot into the ATmega, I'll be able to send new firmware over TX/RX with avrdude -c arduino.  The missing link is the reset signal.  I looked into avrdude, and there's no support for specifying a reset pin if you're using -c arduino.  I can see where such code could be added though.  

There are at least two terrible hacks people have done to get around this.  One uses strace to watch for the serial port ioctls that avrdude uses to pulse DTR/RTS, and when that happens, it twiddles a GPIO.  The other intercepts the serial traffic and listens for avrdude to send a particular string:

  https://github.com/deanmao/avrdude-rpi

They are both awful.

What I think I'll do is rely on the fact that optiboot waits one second before falling through.  I can see in the pypilot source that GPIO16 is being used to reset the ATmega.  I'll pulse RESET, then start avrdude over the serial port, and thus I'll hit the programming window.  Sounds feasible? 

(In other news, I need to program optiboot before I solder the ATmega onto the board.  I'm planning to use thisSmile

  https://www.thingiverse.com/thing:2615599
Reply


Messages In This Thread
RE: Connections between RPi and nano for flashing - by CapnKernel - 2020-10-01, 02:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)