Razvan Musaloiu-E. wrote:
Thanks for the help.
> You are talking about verifyImage, right? The check is in the for loop:
>
> 94 for ( i = 0; i < numPgs && crcTarget == crcTmp; i++ ) {
> ^^^^^^^^^^^^^^^^^^^
>
Very unobservant of me. Thanks.
>> 2) The ProgFlashM.nc in the avr subdirectory seems to be doing a busy
>> wait which attempts to rww_enable the memory each time. This seems to be
>> different to the sample code I can find in
>> http://linux.die.net/man/3/boot_page_fill I've tried a version of
>> ProgFlashM.nc that corresponds to the example given in boot.h but
>> without success.
>>
>>
>
> The boot.h from AVR might need to be updated to work with 1281. Could you
> try a newer version? The file from with avr-libc.
>
I've tried the following code, copied from the boot.h documentation.
However, no write. This leads me to suspect that I'm somehow running
into some memory protection issue, which is where I'll look next. So:
per ardua ad astra!
command result_t ProgFlash.write(in_flash_addr_t addr, uint8_t* buf,
in_flash_addr_t len) {
uint16_t* wordBuf = (uint16_t*)buf;
uint32_t i;
if ( addr + len > TOSBOOT_START )
return FAIL;
eeprom_busy_wait();
boot_page_erase( addr );
boot_spm_busy_wait();
for ( i = 0; i < len; i += 2 )
boot_page_fill( addr + i, *wordBuf++ );
boot_page_write( addr );
boot_spm_busy_wait();
boot_rww_enable();
return SUCCESS;
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help