Address SPI Communication Problem on ATMega2560 #38
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 the Arduino Mega platform with the W5500 shield, there is contention between the LED signal and the SCK signal. On the Mega, the LED is mapped to digital pin 13. On the Uno, 13 is the SCK signal, but on the Mega these signals are routed to different headers altogether.
The shield still works in sketches because the SPI signals are also routed to the ISCP header, which is connected to the shield.
The logic in the bootloader is that if the SCK pin and LED pin definitions don't match, the LED pin will be initialized and will blink in the bootloader's main polling loop. On the Mega 2560, the SCK pin definition and LED pin definition do not match, meaning this logic was included.
Because of the routing of the signals, LED pin (Digital 13) and SCK are actually shorted together, so blinking the LED is causing contention on the SCK line.
For now, LED blinking is disabled on the ATMega2560. With this change, we can successfully upload binaries to the device over Ethernet.
Fixes #37