HOW TO simplification NHS3100 Tlogger project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOW TO simplification NHS3100 Tlogger project

953 Views
xiangxuejiao00
Contributor III

I download the latest version of nhs3100 SDK, and download the tlogger project to my demo board with nothing changed .

Memory region Used Size Region Size %age Used
Flash30: 15564 B 30 KB 50.66%
SRAM8: 2980 B 8176 B 36.45%

After download the program ,there are only  15156 bytes left for data storage .with these memory ,there are only 82464 temperature data can store .

If I set the meameasurement interval 1 second , with these left storage ,3100 just can work one day .

so ,I want to know ,is there any methods to simplify the tlogger project ?

I need more memory left after download the program .

who can help me ?

tks

Tags (1)
4 Replies

597 Views
matt_li0716
Contributor I

mostly, temperature changes slowly. so you can just record the difference of samples. 

eg. 1st  sample = 0x1234, 2nd sample =0x1298, 3rd = 0x1350, you can record as 

             0x1234,

0x1298-0x1234, (1 byte)

0x1350-0x1298, (1 byte)

0 Kudos

597 Views
driesmoors
NXP Employee
NXP Employee

Hi,

I'm unsure how to reach to that 82464 number. It also sounds already quite high. What's your target?

You can store more measurement data by removing code:

  • If you don't need the functionality of the event module, you can strip it down a bit, reducing code space requirements, and also decreasing the assigned EEPROM memory.
  • If you don't need the text capabilities, you can remove the code that creates custom text messages at startup, inserted in the initial NDEF message.
  • If you adapt the communication messages, you can read out compressed data. That gives you both a speed-up when reading out all data, and means you don't nee to retain the decompression code in the compress module.

Or by more agressive compiling:

  • Link-time optimization is not turned on. By carefully and selectively enabling this option on a file-by-file basis, you can achieve code reduction at link time. Do not enable this for the whole project at once - it will provide a useless binary.

Or by optimizing your compression:

  • The compress module is just one example of lossless compression. You can tweak its parameters and gain a bigger compression ratio, or you can replace it with a better algorithm of your choosing.
  • You can play with the resolution of the storage of each measurement: do you need 11 bits per sample? Perhaps a remapping before storing can already reduce it with 1 or 2 bits; perhaps a lossy compression further reduces your storage needs.
  • Have a look at the hints given in <SDK>/docs/DataStorage.pdf.

Good luck,
Best regards,
Dries.

0 Kudos

597 Views
xiangxuejiao00
Contributor III

Thanks ,

I use the SDK project ,and  let the 3100 work until storage is full ,and get 82464 temperature .

My boss order  me to simplify the project as possible as I can !

I have read your answer ,it is so useful to me .

One more question ,

1、if I set 8 bits per sample ,how can I store one temperature more than 256?

2、how to  turned on  Link-time optimization ?can you describe more detail about this  agressive compiling?

0 Kudos

597 Views
driesmoors
NXP Employee
NXP Employee

Hi,

This can be done when taking your use case specifications into account.

For example, your use case envisions temperatures between -17°C up to 50°C, and requires a resolution of 0.5°C for freezing temperatures, and 1°C for positive temperatures.

So your full temperature range is then, say, [-20°C, 55°C].

  • From -20°C until 0°C there are 41 possible values: -20, -19.5, -19, ... -1, -0.5, 0
  • Above 0°C there are 55 possible values: 1, 2, 3, 4, ..., 54, 55.

This gives a total of 96 different values. Every temperature value you measure can thus be mapped to an integer value between 0 and 95. This requires 7 bits for storage. You still have some integers left to indicate extreme temperatures that are not covered by your full use case-specific temperature range.

The code can be adapted to follow this sequence:

  • measure temperature
  • map value to a number in the range [0..95]
  • store the 7-bit number

Another option is to store the difference between successive temperatures only. Depending on your thermal resistance, you can check what the maximum possible temperature change is between two measurements. Perhaps this is only 10 degrees. Then you need to find a system that can store full temperatures once in a while, and store differences most of the time. 

Last, a word of caution. The compression library used in the demo application will not yield the same compression ratio for all data sets: depending on the temperature changes experienced, the compression may be better - or much worse.

Kind regards,
Dries.