Hi,

Ok, I have finally found it (bug report) !

The problem was into Deluge initialization process. One of the first
task that Deluge does is to check if the images are valid.
It is checked by computing the CRC of each page and comparing it to
the transmitted CRCs.

In DelugeMetadataP module, on line 127, there is a call to
BlockRead.computeCrc.

    call BlockRead.computeCrc[currentVolume](calcPageAddr(),
DELUGE_BYTES_PER_PAGE, 0);

This call was returning an EINVAL error and without any error code
verification the Deluge module was just stopped into the CRC check
loop and storageReady event was never sent, neither the radio
initialized.

The EINVAL is caused by the calcPageAddr() in the same module on line 75 :

  uint32_t calcPageAddr()
  {
    return DELUGE_IDENT_SIZE + DELUGE_CRC_BLOCK_SIZE + currentPage *
DELUGE_BYTES_PER_PAGE;
  }

The calculation of this sum is cast to an Integer since
DELUGE_BYTES_PER_PAGE is an integer.
When my current page equal to 30, there is an integer overflow and the
method returns 0xFFFF82E0 instead of 0x000082E0.

A working fix for this could be casting DELUGE_BYTES_PER_PAGE to
uint32_t but there is maybe a cleaner fix (I am kind a beginner in C
and embedded systems).

  uint32_t calcPageAddr()
  {
    return DELUGE_IDENT_SIZE + DELUGE_CRC_BLOCK_SIZE + currentPage *
(uint32_t)DELUGE_BYTES_PER_PAGE;
  }

Regards,
Fabrice Dossin


On 23 August 2010 10:14, Fabrice Dossin <[email protected]> wrote:
>
> Yes, it is. As a proof when I flash my app on the mote as the golden image it 
> works like a charm...
> I just need this to link it to my app, no ?
> components DelugeC;
> DelugeC.Leds -> LedsC;
> Regards,
> Fabrice
>
>
> On 21 August 2010 03:33, Chieh-Jan (Mike) Liang <[email protected]> wrote:
>>
>> Hi,
>>
>> Is your Blink app wired to DelugeC component?
>>
>> Mike
>>
>> On Aug 20, 2010, at 10:32 AM, Fabrice Dossin wrote:
>>
>> > Hi,
>> >
>> > I am currently investigating for integrating Deluge T2 into my app.
>> > I have a strange behavior :
>> > When I program the motes with my program as the golden image it does boot 
>> > correctly and I can propagate a Blink image or another to the mesh.
>> > But when I flash the mote with Blink and propagate my app trough the air, 
>> > my app never start...
>> >
>> > The Boot.booted event is sent but I never receive the startDone event from 
>> > ActiveMessageC that is automatically started by Deluge.
>> > The program is blocked somewhere between these.
>> > If I manually activate ActiveMessage, Deluge never take my propagated 
>> > images so it should be freezed somewhere into the deluge initialization 
>> > process.
>> >
>> > Does someone have a clue for me on where to search ?
>> > I am developing on IRIS motes.
>> >
>> > Kind regards,
>> > Fabrice
>> >
>> > _______________________________________________
>> > Tinyos-help mailing list
>> > [email protected]
>> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to