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

Thomas J Stevens tjstevens at raytheon.com
Thu Sep 29 00:55:15 PDT 2005


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 TOSBOOT_GOLDEN_IMG_ADDR;
    return call
StorageRemap.physicalAddr[DELUGE_IMAGES[imgNum].imageNum](0);
  }

I have confirmed that the last line:

return call StorageRemap.physicalAddr[DELUGE_IMAGES[imgNum].imageNum](0);

should read

return call
StorageRemap.physicalAddr[DELUGE_IMAGES[imgNum].imageNum](imgNum*65536);

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 TOSBOOT_GOLDEN_IMG_ADDR;
    return call
StorageRemap.physicalAddr[DELUGE_IMAGES[imgNum].imageNum](imgNum*65536);
  }

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
lines:
...
      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.



More information about the Tinyos-help mailing list