Challenges Using R4 as ISP for ATtiny85

Is there something baked in to IDE or cmd format to bridge between R4 and ATtiny85?

I'm trying to create my own opensauce 2025 badge by programming an ATtiny 85. There's not a lot of information on it. I was able to burn the bootloader. the main holdup was selecting Arduino as ISP(ATmega32U4) as programmer instead of Arduino as ISP.

Now I'm trying to push the .hex file using the command window but getting sync errors. GPT says that's because UNO R4 is not AVR-based (it uses Renesas RA4M1)

The chatbot is correct.

For programming AVR devices, nothing beats the Pololu AVR ISP programmer V2.1, plus you get an extra USB-UART serial adapter thrown in.

Hi @jp3lister. You should be able to do this, no problem. The process of flashing the .hex to the ATtiny85 is no different in any meaningful way (in this context) from burning the bootloader, so if you were able to burn the bootloader successfully then you are all set to flash the .hex file. Most likely the error you encountered is caused by a misconfiguration of your command.

Please try this:

A. Generate Model Command

Arduino IDE has an "Upload Using Programmer" feature, where it uploads a sketch to a target using an ISP programmer. Since you want to upload a precompiled hex file instead of a sketch from source code, this feature is not directly useful for your project. However, it is indirectly useful in that Arduino IDE automatically generates the correct command for uploading a hex file via the ISP when you use the feature. That same command can be used to upload any arbitrary precompiled hex file from the command line.

So you are going to perform an "Upload Using Programmer" operation with an arbitrary sketch, not because you want that sketch to run on the ATtiny85, but instead solely to obtain the upload command generated by Arduino IDE:

  1. Start Arduino IDE.
  2. Select File > Examples > 01.Basics > BareMinimum from the Arduino IDE menus.
    A bare minimum sketch will open in a new Arduino IDE window.
  3. Connect the UNO R4 WiFi board to the ATtiny85 target, just the same as you did when you burned the bootloader.
  4. Connect the USB cable of the UNO R4 WiFi board to your computer.
  5. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  6. Check the box next to Show verbose output during: ☐ upload.
  7. Click the "OK" button.
    The "Preferences" dialog will close.
  8. Select the ATtiny85 board from Arduino IDE's Tools > Board menu, just the same as you did when you burned the bootloader.
  9. Make any additional configurations of the submenus of the "Tools" menu, just the same as you did when you burned the bootloader.
  10. Select the port of the UNO R4 WiFi board from Arduino IDE's Tools > Port menu.
  11. Select Tools > Programmer > Arduino as ISP (ATmega32U4)" from the Arduino IDE menus.
  12. Select Sketch > Upload Using Programmer from the Arduino IDE menus.
    An upload operation will begin, during which the sketch will be compiled, and then uploaded to the ATtiny85 via the "Arduino as ISP" programmer.
  13. Wait for the "Upload Using Programmer" operation to finish successfully.
  14. Examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. There you will find the avrdude command Arduino IDE used to upload to the ATtiny85 the .hex file it generated by compiling the "BareMinimum" sketch.
    • You may need to scroll up in the panel to see the command.
    • For example, on my computer the command looks like this:
      "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf" -v -pattiny85 -carduino -PCOM8 -b19200 -D "-Uflash:w:C:\Users\per\AppData\Local\arduino\sketches\E7F2D954F41D1B7D13413D18D293A59F/BareMinimum.ino.hex:i"
      
  15. Select the full text of the command.
  16. Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
    This will copy the selected text to the clipboard.

B. Adjust Model Command

  1. Open a new text file in any text editor.
  2. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the copied text into the text editor.
  3. Replace the path in the -Uflash:w:<hex path>:i flag of the command with the path of the .hex file you wish to upload to the ATtiny85.
    For example, if I wanted to upload the file at C:\Users\per\Documents\SomeHex.hex, I would modify the command I obtained like so:
      "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf" -v -pattiny85 -carduino -PCOM8 -b19200 -D "-Uflash:w:C:\Users\per\Documents\SomeHex.hex:i"
    
  4. Select the full text of the updated command in the text.
  5. Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
    This will copy the updated command to the clipboard.

C. Run the Command

  1. Open a command line terminal, just as you did before.
  2. Paste the command you copied during the above "B. Adjust Model Command" procedure.
  3. Press the Enter key.

The .hex file should now be uploaded to the ATtiny85.

This is no problem. It is true that the "Arduino as ISP" programmer can only be used with targets of the AVR architecture, there is no such restriction on which boards can be used as the programmer. Therefore, although you could not use an "Arduino as ISP" programmer to program the UNO R4 WiFi board as a target, the UNO R4 WiFi board can be used as an "Arduino as ISP" programmer targeting an ATtiny85.

You're a legend! in case it helps anyone else below are the command lines I used to flash and update the fuses for the opensauce 2025 badge

"C:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -pattiny85 -carduino -PCOM3 -b19200 "-Uflash:w:E:\badge/os_2025.hex:i"

"C:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -pattiny85 -carduino -PCOM3 -b19200 -Ulfuse:w:0xE2:m

"C:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Jacob\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -pattiny85 -carduino -PCOM3 -b19200 -Uhfuse:w:0x5F:m