-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
place mac to SRAM instead of flash #397
Conversation
This example doesn't work when mac is placed to flash (using nano v3 with old bootloader)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, ether.begin
seems to assume macaddr
is in RAM:
Lines 31 to 38 in 420dd84
uint8_t EtherCard::begin (const uint16_t size, | |
const uint8_t* macaddr, | |
uint8_t csPin) { | |
using_dhcp = false; | |
#if ETHERCARD_STASH | |
Stash::initMap(); | |
#endif | |
copyMac(mymac, macaddr); |
Lines 13 to 15 in 420dd84
void EtherCard::copyMac (uint8_t *dst, const uint8_t *src) { | |
memcpy(dst, src, ETH_LEN); | |
} |
Perhaps it would be best to overload ether.begin
with support for passing a MAC in PROGMEM
, but at least this makes it work for now...
@nuno-silva Line 91 in 420dd84
|
No need for an additional argument :) The overloaded begin method would just need to read the uint8_t array from flash to a temporary buffer in the stack/RAM and call the regular |
I could implemented it, but I have no setup to test it at the moment. |
Better solution is in #398 |
fixes njh#397 (ntpClient example)
This example doesn't work when mac is placed to flash (using nano v3 with old bootloader)