Hi KristoZ
now that is quite odd.
First off, if you are using the USBtinyISPv3 then you don't need the bootloader on the 1284p. So that's one thing you don't have to worry about. You're writing direct to the 1284p hardware using the ISP function of the chip.
[As an aside FYI, if you do like the bootloader for its monitor capability, then use avrdude with -D option, then it won't erase the chip (and the bootloader you've previously written) before rewriting it to programme your sketch. Worth trying out if you've got new hardware, or a debugging issue and you want to see exactly what is being written to your device.]
If you want to put the bootloader back, because you've compiled your own variant for example, then you can use the instructions in the arduino production_firmware directory as your guide.
Code: Select all
### stk500v2 Bootloader for 1284P at 20MHz ###
> avrdude -cavrisp2 -pm1284p -u -Uflash:w:stk500boot_v2_goldilocks.hex:a -Ulfuse:w:0xd7:m -Uhfuse:w:0xd8:m -Uefuse:w:0xfc:m -Ulock:w:0xf:m
To address your issue let's try these commands for the USBtinyISPv3, with it plugged into the 1284p ISP plug. Check the cable is orientated correctly. If it doesn't work, flip the connector around and try again.
Code: Select all
> avrdude -cusbtiny -pm1284p
> avrdude -cusbtiny -pm1284p -u -Uflash:w:stk500boot_v2_goldilocks.hex:a -Ulfuse:w:0xd7:m -Uhfuse:w:0xd8:m -Uefuse:w:0xfc:m -Ulock:w:0xf:m
From the command line:
The first line will just check that avrdude can speak to the 1284p. If you don't get a good looking result from this first line, then there are problems with your avrdude installation, your powering of the Goldilocks, or some other connectivity problem. You need to sort this out first.
Adafruit USBtinyISP AVRDUDE Tutorial
The second line will programme the bootloader from within the production_firmware folder. This is useful to check that there are no issues with the USBtinyISP, as the bootloader programming exercises all of the flash memory, as it is written at the top of the memory.
Ok, if you got past this step, then it is just a matter of educating the Arduino IDE that you're using the USBtinyISP. You can do this in the Tools menu, by selecting the correct Programmer. Then you should be able to programme any sketch that fits in the 1284p.
Please let us know how you go.
Edit: It suddenly occurred to me about an old problem. That might be affecting you. It is to do with the chip delay calculation for the 1284p. There is a bug in avrdude that has never been fixed. See Step 3 in
freeRTOS and libraries for avr ATmega But, only do this if you're not getting happy face above already.