Ftdi upload fails with error : (22, 'Invalid argument')

Expected, since the fuse settings that are burned with the bootloader are different in the 16MHz and 8MHz variant (clock divider settings etc.). So likely the bootloader may have reacted at double or half the clock speed, but it’s still more correct to just flash thet bootloader with the correct fuse settings.

I’ve never seen a description like this. Usually they’re just the number in MHz in these cases. Maybe “Am” is just a marking from the vendor that maps in their datasheets to 16MHz…

1 Like

And just as a summary post that encapsulates the answers better:

  • If doing a regular serial upload, no need to change the upload_protocol, the default arduino value for it (which gets passed onto avrdude) already does that
  • chips must have the correct bootloader burned into them to be programmable via the serial interface
  • bootloader must be programmed via an ISP capable programmer, e.g., an USB TinyASP. The upload_protocol must be changed in accordance to the documentation and the used programmer.
  • special care must be taken to select the right board = ... for the given hardware, e.g., with resepect to the used crystal speed (8MHz vs 16MHz)
1 Like