I encountered some problems while working with the contiki ELF-loader and hope that someone would be so kind to provide me more insight or some hints to solve these problems. In the following I try to keep the problem description short.
My aim is to:
Execute an ELF file on a T-Mote-Sky.
This ELF file contains a contiki process with a computation (linear regression of data samples over time).
Using "cooja" for simulation
Code specific information:
ELF file size about 2000 bytes
quite large computation of several unsigned-int-16 numbers:
for (i = 0; i < 10; i++) {
sum_x += records[i].index;
sum_y += records[i].energy;
sum_xx += ((uint16_t) records[i].index) * ((uint16_t) records[i].index);
sum_xy += ((uint16_t) records[i].index) * ((uint16_t) records[i].energy);
}
slope = ((size * sum_xy) - (sum_x * sum_y)) / ((size * sum_xx) - (sum_x * sum_x));
"records" is initialised and defined in the main process, which calls the elfloader, and is accessed via the extern definition
it works if I use constants for the computation
Problems:
if I try to use multiplication with "*" it leads to the error message:
Symbol not found: __MPY
if I try to use division with "/" it leads to a similar error message
- so my workaround is that the multiplications and divisions are based upon additions, and it works (in most cases)
Still, I get the error: "Segment not found:" as soon as I try to calculate the slope.
- I deduce its an issue with the memory size or trying to get data from the main process via extern, because calculating the slope works if I use constants only.
Many thanks in advance for your help and best regards,
Ca Way Le