---------- Forwarded message ----------
From: jiwen zhang <[EMAIL PROTECTED]>
Date: 2008-5-7 16:53
Subject: Re: question aout the TOSBootM
To: "Razvan Musaloiu-E." <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], tinyos-help <
[email protected]>
Hello all :
when i read the file TOSBootM.nc , there are some things i can' t
understand !
1. The external flash is divided into three slots , *i want to know the
size of every slot ? are they identical ?*
from reading the TOSBootM , i think the *structure of every slot *is that
:
for example , slot 0 :
----------------------------------------------------
DELUGE_IDENT_SIZE (128 Bytes)
----------------------------------------------------
DELUGE_CRC_BLOCK_SIZE(256 Bytes)
-----------------------------------------------------
PAGE 0
PAGE 1
...........
...........
and *PAGE structure* is that :
---------------------------------------------
Internal flash Address (4 Bytes)
---------------------------------------------
Page length(4 Byte)
--------------------------------------------
Effective Image data()
-------------------------------------------
Am i right ? i am not sure the page structure , if i am not right , can
someone give me an explain ?
2. Question about the function of programImage(ex_flash_addr_t startAddr)
.....
.....
while ( secLength ) {
pageAddr = newPageAddr = intAddr / TOSBOOT_INT_PAGE_SIZE;
call ExtFlash.startRead(curAddr);
// fill in ram buffer for internal program flash sector
do {
// check if secLength is all ones
if ( secLength == 0xffffffff ) {
call ExtFlash.stopRead();
return FAIL;
}
buf[(uint16_t)intAddr % TOSBOOT_INT_PAGE_SIZE] = call ExtFlash.readByte();
intAddr++; curAddr++;
if ( --secLength == 0 ) {
intAddr = extFlashReadAddr();
secLength = extFlashReadAddr();
curAddr = curAddr + 8;
}
newPageAddr = intAddr / TOSBOOT_INT_PAGE_SIZE;
} while ( pageAddr == newPageAddr && secLength );
call ExtFlash.stopRead();
call Leds.set(pageAddr);
// write out page
if (call ProgFlash.write(pageAddr*TOSBOOT_INT_PAGE_SIZE, buf,
TOSBOOT_INT_PAGE_SIZE) == FAIL) {
return R_PROGRAMMING_ERROR;
}
}
i don't know *how the programme jump out the while cycle*. because the
condition of jumping out the while cycle is that "secLength <= 0" , but in
the while , there is some sentences :
if ( --secLength == 0 ) {
intAddr = extFlashReadAddr();
secLength = extFlashReadAddr();
curAddr = curAddr + 8;
}
*so when secLength == 0 , it will be given a new value (which is the next
page size ?) , how does it jump out ?*
*is it possible that it jump out from here ? :*
if ( secLength == 0xffffffff ) {
call ExtFlash.stopRead();
return FAIL;
}
i am not sure, can someone give me an explain ?
2008/5/7, jiwen zhang <[EMAIL PROTECTED]>:
>
> Hello :
> thank you very much for your reply, Razvan ME.
> i have found it .
>
>
>
>
> 2008/5/7, Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>
>> Hi!
>>
>> On Tue, 6 May 2008, jiwen zhang wrote:
>>
>> Hello all :
>>> Recently , i an researching the deluge, and find a problem in TOSBootM.
>>> In the function programImage(ex_flash_addr_t startAddr) , there is a
>>> sentence
>>> #if defined(PLATFORM_TELOSB)
>>> if (intAddr != TOSBOOT_END) {
>>> #elif defined(PLATFORM_MICAZ) || defined(PLATFORM_IRIS)
>>> if (intAddr != 0) {
>>> ....
>>> ....
>>>
>>> I can't find where TOSBOOT_END is defined . if i am using the platform
>>> telosb , maybe it does't work .
>>> can someone give me an answer ?
>>>
>>
>> TOSBOOT_END is defined in tinyos-2.x/tos/lib/tosboot/Makefile.
>>
>> --
>> Razvan ME
>>
>> I am using Tinyos2.x .
>>> thank you !!
>>>
>>>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help