[Tinyos-help] NetProg will only boot to Golden Image (Bug Fix)

Anderson, Roberta D. Roberta.Anderson at ngc.com
Fri Sep 30 06:06:32 PDT 2005

I am just starting to look into changing the sector sizes, so I am not
too familiar with the code yet.  So far the only place I have seen the
sector size defined is under apps/TestDeluge/FormatFlash/FormatM.nc as
the constant VOLUME_SIZE, and then there is a check against that in
It seems the reset of gestureCount is to clear it when reprogramming the
new image so as not to go into the golden image. gestureCount is
incremented in the startup sequence of the bootloader TOSBootM.nc, and
when it reaches the defined threshold the mode is forced into the golden

Bobbie Harrington
Roberta.anderson at ngc.com 

-----Original Message-----
From: tinyos-help-bounces at Millennium.Berkeley.EDU
[mailto:tinyos-help-bounces at Millennium.Berkeley.EDU] On Behalf Of Thomas
J Stevens
Sent: Thursday, September 29, 2005 3:55 AM
To: tinyos-help at Millennium.Berkeley.EDU
Subject: [Tinyos-help] NetProg will only boot to Golden Image (Bug Fix)

Dear All,

As mentioned in my previous post, in
tinyos-1.x/tos/lib/Deluge/DelugeStorageM.nc there are the lines:

  command uint32_t DelugeStorage.imgNum2Addr(imgnum_t imgNum) {
    if (imgNum == DELUGE_GOLDEN_IMAGE_NUM)
    return call

I have confirmed that the last line:

return call

should read

return call

This is only in the case when all sectors are allocated to 64k and I'm
certain that there is a cleaner way of doing this.  In fact, it would be
appropriate to at least use the constant which defines the sector size -
but I have not found that yet.  Anyone know where that is?

  command uint32_t DelugeStorage.imgNum2Addr(imgnum_t imgNum) {
    if (imgNum == DELUGE_GOLDEN_IMAGE_NUM)
    return call

Hope this help some of you having trouble with
NetProg.programImgAndReboot(#) - and kudos to those who initially wrote
this amazing code!  :)

Oh, I'd still love an answer to the following question:

In tinyos-1.x/tos/lib/Deluge/NetProgM.nc the guts of
NetProg.programImgAndReboot(imgnum_t newImgNum) there are the following
      args.imageAddr = call Storage.imgNum2Addr(newImgNum);
      args.gestureCount = 0xff;
      args.noReprogram = FALSE;
      call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &args,
sizeof(args)); ...

What is the effect of setting  args.gestureCount to 0xff?

Best Regards,
Thom Stevens

Sr. Systems Engineer
Advanced Programs
Raytheon Missiles

520.545.9608 (desk)
520.545.9678 (facs)
520.906.9706 (mobile)
5209069706 at mmode.com [non-proprietary email ONLY]
There are 10 kinds of people in this world: Those who understand binary,
and those who don't.

Tinyos-help mailing list
Tinyos-help at Millennium.Berkeley.EDU

More information about the Tinyos-help mailing list