Fix ArduinoISP sketch for Uno WiFi Rev2 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using bit banged SPI, which the sketch did when compiled for any architecture other than AVR, a
SPISettings
class was declared by the sketch. At the time the sketch was written, it was reasonable to expect this would not cause a name collision, since SPI.h is not#include
d when doing bit banged SPI. However, since then aSPISettings
class has been declared in ArduinoCore-API's HardwareSPI.h, causing the ArduinoISP sketch to not compile for any board whose core uses ArduinoCoreAPI (currently Arduino Mega AVR Boards, "Arduino nRF528x Boards (Mbed OS)", and "Arduino Mbed OS Boards (nRF52840 / STM32H747)"):Although it's easy enough to fix the name collision (#3), it seemed a better idea to simply use hardware SPI when compiling for the megaAVR architecture.
After this change, I was able to use the Uno WiFi Rev2 as an "Arduino as ISP" programmer with "Burn Bootloader" and "Upload Using Programmer". It is necessary to use the Tools > Programmer > Arduino as ISP (ATmega32U4).
Unfortunately, I found that, although the sketch compiles, I still can't use the Nano Every as an "Arduino as ISP" programmer. It is able to read the chip signature and read and write fuses, but there are
avrdude: stk500_recv(): programmer is not responding
errors while writing the program to flash.I found that the same issue occurs if I use the Nano Every and Nano 33 BLE with the bit banged SPI code (after fixing the name collision), while the Uno WiFi Rev2 works fine with the bit banged SPI.