You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have changed the CS pin in asmfunc.S to get it running on the Ethernet Shield 2 where the CS pin for the SD access is 4 (PG5). I am happy about your work and the update process is functioning.
The EEPROM address seems to be hardcoded in stk500boot.c:1147.
if(boot_state == 2){
if(eeprom_read_byte(0x1FF) == 0xF0){
pf_mount(&Fatfs); /* Initialize file system */
if(pf_open("firmware.bin") == FR_OK){
DWORD fa; /* Flash address */
WORD br; /* Bytes read */
uint8_t i = 0;
sendchar(0x0d);
sendchar(0x0a);
for (fa = 0; fa < 0x3E000; fa += SPM_PAGESIZE) { /* Update all application pages */
PROGLED_PORT ^= (1<<PROGLED_PIN); // turn LED ON
delay_ms(50);
flash_erase(fa); /* Erase a page */
memset(Buff, 0xFF, SPM_PAGESIZE); /* Clear buffer */
pf_read(Buff, SPM_PAGESIZE, &br); /* Load a page data */
if(br) flash_write(fa, Buff); /* Write it if the data is available */
}
sendchar(0x0d);
sendchar(0x0a);
check = 0;
eeprom_write_byte (0x1FF, 0xFF);
Suggest to use a #define for better control. Or is the EEPROM erased anyway?
The text was updated successfully, but these errors were encountered:
stk500boot.c needs to be compiled and loaded as bootloader into your atmega2560. This way you can adjust to your liking. There is a short discription on how to compile.
I did already (see CS pin change), but I just wanted to point out the (easy) change of the EEPROM address as there sometimes is data in the EE.
Thank you
I have changed the CS pin in asmfunc.S to get it running on the Ethernet Shield 2 where the CS pin for the SD access is 4 (PG5). I am happy about your work and the update process is functioning.
The EEPROM address seems to be hardcoded in stk500boot.c:1147.
Suggest to use a
#define
for better control. Or is the EEPROM erased anyway?The text was updated successfully, but these errors were encountered: