RaspberryPi4 Bullseye RFM69Pi Upload issue

Working on the new emonSD image here. It all seems to be working fine apart from upload to the RFM69Pi adapter board which it probably fails 95% of the time.

Mostly with errors of the form:

avrdude-original: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x0d

avrdude-original: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x0a

avrdude-original: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x5b

I’ve tried fixing the core_freq and making sure bluetooth and console are disabled on ttyAMA0 but to no avail. I’ve also tried the latest version of avrdude v7.0 but cant get autoreset to work with that.

Before I open an issue on the avrdude github does anyone here have any pointers on what I might be missing to get this to work? I cant find references elsewhere that match this problem exactly so a little bit mystified as to what Im doing wrong.

1 Like

Could the RST pin be floating? Previously it was more tolerant to that, perhaps?

Same for different models of Pi?

Clutching at straws :slight_smile:

Thanks @borpin your suggestion made me think to add a little delay in the autoreset script before setting the reset pin high and that seems to have sorted it

def reset():
    time.sleep(0.1) # added in here
    GPIO.setup(PIN, GPIO.OUT)

The only problem being of course that this delay would break upload on older images… and there’s no overlap in a delay amount that works for both.

Actually changing:

def reset():
  GPIO.setup(pin, GPIO.OUT)
  GPIO.output(pin, GPIO.HIGH)
  time.sleep(0.32)
  GPIO.output(pin, GPIO.LOW)

to:

def reset():
  time.sleep(0.2)
  GPIO.setup(pin, GPIO.OUT)
  GPIO.output(pin, GPIO.HIGH)
  time.sleep(0.35)
  GPIO.output(pin, GPIO.LOW)

Seems to work for both, it’s very time sensitive it seems

1 Like