Re: [Tinyos-help] question aout the TOSBootM

2008-05-17 Thread jiwen zhang
Hello :

2008/5/17 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:

> Hi!
>
> On Fri, 16 May 2008, jiwen zhang wrote:
>
> Hello Razvan ME :
>>
>> 2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>
>> Hi!
>>>
>>> Sorry for responding so late. I had a rather busy day. :|
>>>
>>> On Thu, 15 May 2008, jiwen zhang wrote:
>>>
>>>  hello Razvan ME :
>>>
  that is to say the version of
 http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git is same with
 http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , i can choose one
 to
 download ?


>>> Please take a look at how git works. A quick introduction is here:
>>>   http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
>>> and the manual is here:
>>>   http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
>>>
>>> The first link is the real git location. You can download the sources
>>> with
>>> by doing this:
>>>   git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>> You can also use the native git protocol instead of http:
>>>   git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>>
>>> The second link [1] you mention is just a way to see in a nice way the
>>> status of the tree.
>>>
>>> [1] http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git
>>>
>>>
>>
>>  *If i have downloaded the source tree , for example , on the day of
>>> 2008.5.16 , and then two days later , i want to update the source tree ,
>>> do
>>> i must download the whole source tree ?  or there is a way that i only
>>> need
>>> to update some files that have been modified ?*
>>>
>>
> You just need to do 'git pull' inside the tinyos-2.x to get the latest
> version.

i tried , it takes very long time .
i find it is very slow to download the tinyos-2.x.git now . (some days ago ,
it is much faster.) , is it the problem of  server ? -:)

>
> --
> Razvan ME
>



-- 
zhang jiwen
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] question aout the TOSBootM

2008-05-17 Thread jiwen zhang
Hello :

2008/5/17 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:

> Hi!
>
> On Fri, 16 May 2008, jiwen zhang wrote:
>
> Hello Razvan ME :
>>
>>  2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>
>> Hi!
>>>
>>> Sorry for responding so late. I had a rather busy day. :|
>>>
>>> On Thu, 15 May 2008, jiwen zhang wrote:
>>>
>>>  hello Razvan ME :
>>>
  that is to say the version of
 http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git is same with
 http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , i can choose one
 to
 download ?


>>> Please take a look at how git works. A quick introduction is here:
>>>   http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
>>> and the manual is here:
>>>   http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
>>>
>>> The first link is the real git location. You can download the sources
>>> with
>>> by doing this:
>>>   git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>> You can also use the native git protocol instead of http:
>>>   git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>>
>>> The second link [1] you mention is just a way to see in a nice way the
>>> status of the tree.
>>>
>>> [1] http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git
>>>
>>>
>>
>> *If i have downloaded the source tree , for example , on the day of
>>> 2008.5.16 , and then two days later , i want to update the source tree ,
>>> do
>>> i must download the whole source tree ?  or there is a way that i only
>>> need
>>> to update some files that have been modified ?*
>>>
>>>  i just a newer  to deluge , and know little to it , it is difficult for
>>> me
>>>
 to modify deluge to make it support programme the specified motes -:)


>>> I don't have much time right now but I will update the manual to include
>>> all the details that will explain what you need to do to reprogram the
>>> mote
>>> selectively.
>>>
>>
>> *Do you mean that "Deluge support to reprogramme the motes selectively at
>> present"  if i do according to the manual that you will update?*
>>
>
> The default behavior of Deluge is to try to make all the motes run the same
> program. By changing the DelugeP.nc you can use change this behavior. The
> manual will explain the DelugeP.nc so you can change it to suit your needs.
>

*Are you writing the manual now ? how long can you finish it ? i am looking
forwarder for it !!  -:)*

>
> --
> Razvan ME
>



-- 
zhang jiwen
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] question aout the TOSBootM

2008-05-16 Thread Razvan Musaloiu-E.
Hi!

On Fri, 16 May 2008, jiwen zhang wrote:

> Hello Razvan ME :
>
> 2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>
>> Hi!
>>
>> Sorry for responding so late. I had a rather busy day. :|
>>
>> On Thu, 15 May 2008, jiwen zhang wrote:
>>
>>  hello Razvan ME :
>>>  that is to say the version of
>>> http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git is same with
>>> http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , i can choose one to
>>> download ?
>>>
>>
>> Please take a look at how git works. A quick introduction is here:
>>http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
>> and the manual is here:
>>http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
>>
>> The first link is the real git location. You can download the sources with
>> by doing this:
>>git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>> You can also use the native git protocol instead of http:
>>git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>
>> The second link [1] you mention is just a way to see in a nice way the
>> status of the tree.
>>
>> [1] http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git
>>
>
>
>> *If i have downloaded the source tree , for example , on the day of
>> 2008.5.16 , and then two days later , i want to update the source tree , do
>> i must download the whole source tree ?  or there is a way that i only need
>> to update some files that have been modified ?*

You just need to do 'git pull' inside the tinyos-2.x to get the latest 
version.

--
Razvan ME
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] question aout the TOSBootM

2008-05-16 Thread Razvan Musaloiu-E.
Hi!

On Fri, 16 May 2008, jiwen zhang wrote:

> Hello Razvan ME :
>
> 2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>
>> Hi!
>>
>> Sorry for responding so late. I had a rather busy day. :|
>>
>> On Thu, 15 May 2008, jiwen zhang wrote:
>>
>>  hello Razvan ME :
>>>  that is to say the version of
>>> http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git is same with
>>> http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , i can choose one to
>>> download ?
>>>
>>
>> Please take a look at how git works. A quick introduction is here:
>>http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
>> and the manual is here:
>>http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
>>
>> The first link is the real git location. You can download the sources with
>> by doing this:
>>git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>> You can also use the native git protocol instead of http:
>>git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>
>> The second link [1] you mention is just a way to see in a nice way the
>> status of the tree.
>>
>> [1] http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git
>>
>
>
>> *If i have downloaded the source tree , for example , on the day of
>> 2008.5.16 , and then two days later , i want to update the source tree , do
>> i must download the whole source tree ?  or there is a way that i only need
>> to update some files that have been modified ?*
>>
>>  i just a newer  to deluge , and know little to it , it is difficult for me
>>> to modify deluge to make it support programme the specified motes -:)
>>>
>>
>> I don't have much time right now but I will update the manual to include
>> all the details that will explain what you need to do to reprogram the mote
>> selectively.
>
> *Do you mean that "Deluge support to reprogramme the motes selectively at
> present"  if i do according to the manual that you will update?*

The default behavior of Deluge is to try to make all the motes 
run the same program. By changing the DelugeP.nc you can use change this 
behavior. The manual will explain the DelugeP.nc so you can change it to 
suit your needs.

--
Razvan ME
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] question aout the TOSBootM

2008-05-16 Thread jiwen zhang
Hello Razvan ME :

2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:

> Hi!
>
> Sorry for responding so late. I had a rather busy day. :|
>
> On Thu, 15 May 2008, jiwen zhang wrote:
>
>  hello Razvan ME :
>>  that is to say the version of
>> http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git is same with
>> http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , i can choose one
>> to
>> download ?
>>
>
> Please take a look at how git works. A quick introduction is here:
>http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
> and the manual is here:
>http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
>
> The first link is the real git location. You can download the sources with
> by doing this:
>git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
> You can also use the native git protocol instead of http:
>git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>
> The second link [1] you mention is just a way to see in a nice way the
> status of the tree.
>
> [1] http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git
>


> *If i have downloaded the source tree , for example , on the day of
> 2008.5.16 , and then two days later , i want to update the source tree , do
> i must download the whole source tree ?  or there is a way that i only need
> to update some files that have been modified ?*
>
>  i just a newer  to deluge , and know little to it , it is difficult for me
>> to modify deluge to make it support programme the specified motes -:)
>>
>
> I don't have much time right now but I will update the manual to include
> all the details that will explain what you need to do to reprogram the mote
> selectively.

*Do you mean that "Deluge support to reprogramme the motes selectively at
present"  if i do according to the manual that you will update?*

>
>
>  i want to know are you working for the function above ? how long can you
>> finish it approximately? (maybe it is difficult to evaluate -:) . i want
>> to
>> use the function -:) i wish you can realize it in future .
>>
>
> Depending exactly on what you want to achieve it might not be too hard to
> implement. :-)
>
> --
> Razvan ME
>
>
> 2008/5/15 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>
>> Hi!
>>>
>>> On Thu, 15 May 2008, jiwen zhang wrote:
>>>
>>> Hello Razvan ME :
>>>
  what is the difference between the version of //
 hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git and
 http://hinrg.cs.jhu.edu/git/?p=deluge/tinyos-2.x.git , and
 http://hinrg.cs.jhu.edu/git/?p=razvanm/tinyos-2.x.git ? which should i
 download ?


>>> You should checkout the deluge tree using one the the following commands:
>>>   git clone git://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>> or
>>>   git clone http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git
>>>
>>> The razvanm tree contains something else, a work-in-progress simulation
>>> of
>>> the cc2420. :D
>>>
>>>  another question :
>>>
  are you developing the deluge that can reprogramme the specified motes
 not all the motes in the network ? what is the difficulty ? how long can
 you finish it approximately?


>>> You can achieve this by putting some some inside inside Deluge T2.
>>> Basically you need to change in DelugeP.nc the way the mote reacts on the
>>> dissemination updates.
>>>
>>> --
>>> Razvan ME
>>>
>>>
>>> 2008/5/13 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>>

 Hi!

>
>
> On Sun, 11 May 2008, jiwen zhang wrote:
>
> Hello Razvan ME:
>
>
>> 2008/5/9 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>>
>> Hi!
>>
>>
>>> On Wed, 7 May 2008, jiwen zhang wrote:
>>>
>>> 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)
>>

Re: [Tinyos-help] question aout the TOSBootM

2008-05-12 Thread Razvan Musaloiu-E.
Hi!

On Sun, 11 May 2008, jiwen zhang wrote:

> Hello Razvan ME:
>
> 2008/5/9 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:
>
>> Hi!
>>
>> On Wed, 7 May 2008, jiwen zhang wrote:
>>
>> 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 ?
>>>
>>
>> You are almost right: what you call pages are called sections.
>>
>>
>> 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 == 0x ) {
>>>  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 == 0x ) {
>>>  call ExtFlash.stopRead();
>>>  return FAIL;
>>> }
>>>
>>> i am not sure, can someone give me an explain ?
>>>
>>
>> The secLength will be zero because the image is padded with zeros. If the
>> image is an exact number of pages the reprogramming might fail. I'll try to
>> reproduce this bug tomorrow.
>> is it to say that when reading to the end of the image , the secLength of
>> the page is setted to zero , so the programme can jump out ?
>
> what is the meaning of "If the image is an exact number of pages the
> reprogramming might fail" ? and what is the bug you say in your emial ? i
> can't find the bug :-)

In order to generate the bug you need to craft an image which doesn't need 
any padding. These happens in lines 177-179 in tos-build-deluge-image:

171  all_data = []
172  for (addr, data) in all:
173all_data += encode(addr, 4) + \
174encode(len(data), 4) + \
175data
176  all_data += encode(0, 4) + encode(0, 4) # Add the marker for the end 
of an image
177  padding = [0] * (DELUGE_BYTES_PER_PAGE - len(all_data) % 
DELUGE_BYTES_PER_PAGE)
178  if len(padding) < DELUGE_BYTES_PER_PAGE:
179all_data += padding
180  all_data = deluge_crc(all_data)
181  ident['size'] = DELUGE_IDENT_SIZE + len(all_data)
182  sys.stdout.write(int2byte(deluge_ident(all_data)) + int2byte(all_data))

I did exactly that and, as expected, the programImage failed. The exit 
from that loop was on the secLength == 0x condition. In just 
committed a fix for this case in deluge branch from here:
git://hinrg.cs.jhu.ed

Re: [Tinyos-help] question aout the TOSBootM

2008-05-11 Thread jiwen zhang
Hello Razvan ME:

2008/5/9 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:

> Hi!
>
> On Wed, 7 May 2008, jiwen zhang wrote:
>
> 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 ?
>>
>
> You are almost right: what you call pages are called sections.
>
>
> 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 == 0x ) {
>>  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 == 0x ) {
>>  call ExtFlash.stopRead();
>>  return FAIL;
>> }
>>
>> i am not sure, can someone give me an explain ?
>>
>
> The secLength will be zero because the image is padded with zeros. If the
> image is an exact number of pages the reprogramming might fail. I'll try to
> reproduce this bug tomorrow.
> is it to say that when reading to the end of the image , the secLength of
> the page is setted to zero , so the programme can jump out ?

 what is the meaning of "If the image is an exact number of pages the
reprogramming might fail" ? and what is the bug you say in your emial ? i
can't find the bug :-)

>
> --
> Razvan ME
>
>
> 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
Tinyos-help@millennium.berkeley.edu
https://

Re: [Tinyos-help] question aout the TOSBootM

2008-05-08 Thread Razvan Musaloiu-E.
Hi!

On Wed, 7 May 2008, jiwen zhang wrote:

> 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 ?

You are almost right: what you call pages are called sections.

> 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 == 0x ) {
>   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 == 0x ) {
>   call ExtFlash.stopRead();
>   return FAIL;
> }
>
> i am not sure, can someone give me an explain ?

The secLength will be zero because the image is padded with zeros. If the 
image is an exact number of pages the reprogramming might fail. I'll try 
to reproduce this bug tomorrow.

--
Razvan ME

> 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
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] question aout the TOSBootM

2008-05-07 Thread jiwen zhang
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 == 0x ) {
   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 == 0x ) {
   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
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] question aout the TOSBootM

2008-05-06 Thread jiwen zhang
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
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] question aout the TOSBootM

2008-05-06 Thread Razvan Musaloiu-E.
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
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] question aout the TOSBootM

2008-05-06 Thread jiwen zhang
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 ?
I am using Tinyos2.x .
thank you !!
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help