Export Raw Data

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

Export Raw Data

Jump to solution
1,957 Views
Skyrise
Contributor II

Hi, 

I'm trying to do some power consumption measures on my LPC55S69 with the MCU Link Pro debugger. I want to export those measures on my computer and display them on octave (same as matlab) but the problem is that the .bin generated with all the data is in a specific format that I can't understand. 

Basically, I understood that there is a header of 22 bytes with for example, the magic number which is 4 bytes long. The problem is that I don't know the type of variable that is coded is it a float, fixed, int, uint? And this is the problem with all the variable in this file. The doc that I have is linked to this post. 

If someone could help me with this it would be nice, 

Thank you.

LOMBARD Loris 

0 Kudos
1 Solution
1,478 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

that's really good news!

I did update my article on https://mcuoneclipse.com/2023/07/30/data-converter-for-mcuxpresso-energy-measurement-data/ with the latest findings.

I hope others will benefit from this too.

View solution in original post

0 Kudos
16 Replies
1,939 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

I'm working right now on a converter program (work in progress):

ErichStyger_0-1690482870155.png

 

In short: You will need to do some byte swapping. The data items need to be multiplied/divided as in the documentation explained. The 64bit timestamp and average values are IEEE64 encoded, and here again you need to do byte swapping and then multiply/divide.

I have not sorted out the 'log' for the min-avg-max sequence.

0 Kudos
1,887 Views
Skyrise
Contributor II

Hi, @ErichStyger 

Thanks to your explanations and your screen I managed to "almost" plot my signal. I think the problem is that sometimes I have incorrect values which is due to this number of summary values that I don't manage to understand at which frequency they are in the binary file...

I linked to this message my signal which is between 0.03 and 0.035 and as you can see there is a lot of incorrect values which are due to those summary values. 

 

0 Kudos
1,883 Views
ErichStyger
Senior Contributor V

I'm struggling with the same issue as you (frequency of summary records). I need to read the data in the context of a university research project I'm doing with an external partner. Give me some time to clean-up the source code, so I can make it available?

0 Kudos
1,879 Views
Skyrise
Contributor II

Did you find the source code of the debug plot for the power measurement in MCUXpressoIDE ? Because I didn't manage to find it. 

Basically, for me it works between around 1-256 values with a base of 16. 

I link to you a screen of my signal. That's the best number of values I can get without any troubles...

0 Kudos
1,854 Views
ErichStyger
Senior Contributor V

I have started implementing it based on the information in the reference manual (you mentioned above) and looking at the data in the file.

0 Kudos
1,833 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

just in case, I have published my work-in-progress on GitHub here:

https://github.com/ErichStyger/mcuoneclipse/tree/master/MCU-Link/EnergyMeasurement

 

Erich

Tags (1)
0 Kudos
1,784 Views
Skyrise
Contributor II

Hi, @ErichStyger ,

 

I appreciate it thank you.

I'll let you know if I find something interesting for the frequency of the avg measures. 

0 Kudos
1,779 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

Check getNofSummaryItems() in the code I have put on GitHub. This works for me.

I'm in the process of writing a blog article with details about it.

Erich

0 Kudos
1,672 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

I posted an article with source code here:

https://mcuoneclipse.com/2023/07/30/data-converter-for-mcuxpresso-energy-measurement-data/

I hope it is useful for you.

0 Kudos
1,665 Views
Skyrise
Contributor II

Hi, @ErichStyger 

Thank you for your work, you're awesome ! 

1,654 Views
ErichStyger
Senior Contributor V

Thank you! Just keep in mind: as noted in the article, the us counting has not been sorted out completely. If I count the us time, I only get up to about 60% of the total sample time. Still investigating this.

Is the source code useful for you?

0 Kudos
1,650 Views
Skyrise
Contributor II

 @ErichStyger of course it is useful for me, I didn't try it yet because I don't have access to my computer right. As soon as I can I'll try it out !

You mean you only recover 60% of the signal or it is just the timestamp which is not correct ? 

0 Kudos
1,509 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

please check out the latest sources on GitHub. I worked on the timestamp thing today, and have applied a fix with some other timestamp improvements. Data looks correct on my side now.

0 Kudos
1,488 Views
Skyrise
Contributor II

Hi, @ErichStyger 

I just tried your code and it works fine for me now. 

Thank you once again for your work !

1,479 Views
ErichStyger
Senior Contributor V

Hi @Skyrise ,

that's really good news!

I did update my article on https://mcuoneclipse.com/2023/07/30/data-converter-for-mcuxpresso-energy-measurement-data/ with the latest findings.

I hope others will benefit from this too.

0 Kudos
1,642 Views
ErichStyger
Senior Contributor V

I'm not clear from the documentation how the time stamps are constructed. It believe the timestamp is the time needed for the 'base' number of samples, but not sure. So in essence, the time stamps are not absolute values (as I would expect them), but relative ones.

Adding up the time of the time that way I get a total data time of around 1200 ms instead of the expected 1700 ms as shown in the IDE. Maybe I'm missing something?

So how do you read or understand the timestamp data?

0 Kudos