cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a log and store it

pmppires
Associate II

Hey!

I would like to create a log and store it so i could access the information later, for example for a device the monitors how many people go in or out a store and at what times.

It would be helpful to store it in a sd card or the boards memory itself so i could just connect it to a computer and check the time

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @pmppires​,

I suggest you take a look at some of the SD Card examples in the cube firmware on how to create, read and write files using FatFS on SD cards. See if you can find whate you're looking for in that respect - Then we can move on to maybe displaying some of that in a TouchGFX application.

It sounds to me like you will be having some tasks sampling various sensors to detect people (maybe just one sensor). You will then communicate this event to the GUI task through an OS Message queue which we will pick up in Model::tick() and then write to the log file on the SD card. In the same event, you can update your application to display this new value.

Check the sticky in this forum for how to integrate your application with hardware peripherals.

Let me know!

/Martin

View solution in original post

1 REPLY 1
Martin KJELDSEN
Chief III

Hi @pmppires​,

I suggest you take a look at some of the SD Card examples in the cube firmware on how to create, read and write files using FatFS on SD cards. See if you can find whate you're looking for in that respect - Then we can move on to maybe displaying some of that in a TouchGFX application.

It sounds to me like you will be having some tasks sampling various sensors to detect people (maybe just one sensor). You will then communicate this event to the GUI task through an OS Message queue which we will pick up in Model::tick() and then write to the log file on the SD card. In the same event, you can update your application to display this new value.

Check the sticky in this forum for how to integrate your application with hardware peripherals.

Let me know!

/Martin