Custom partition table make slow boot

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Custom partition table make slow boot

Postby urbanze » Sat Mar 24, 2018 6:01 pm

fly135 wrote:Can you create a fat file system in a 1M partition and save your data there instead? Then you won't get the last delay on boot.

John A
NVS is already well implemented in the project, I do not intend to use another file system, however you gave me an idea that second I will check...

The LOG sits on the large NVS partition with output pins states before restart.

I will create separate partitions for this and start the partition with states of the output pins before the LOG, so I can quickly load the states of the pins before the reset, soon after the configuration of the output pins, start the partition with LOG....

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Custom partition table make slow boot

Postby urbanze » Sat Mar 24, 2018 11:10 pm

I did simple tests and it worked! I returned the default partition of nvs with 24K and created a new one with 1MB.

The main partition starts quickly and I want to keep useful values at boot of system, like the states of the output pins before restart. In the 1MB partition, the internal event log will remain.
Thanks for attention guys!


NVS is very good, congratulations to the developers. :lol:
I will wait for the addition of NVS to work with external flash. This features are already planned to be added, I'll be looking forward to nvs in external flash.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Custom partition table make slow boot

Postby WiFive » Sun Mar 25, 2018 12:53 am

How do you do a syslog with a key/value store?

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Custom partition table make slow boot

Postby urbanze » Sun Mar 25, 2018 3:01 am

WiFive wrote:How do you do a syslog with a key/value store?
I'm still checking for the best methods for implementing internal LOG, but the best results were generated by the simplest way I could think.

I have a "variable" (key-value) pointer indicating the next key to be written, like the "PC" of the assembly.

Then when an event occurs, the current address is obtained and added +1, returning the next key for recording, such as list:

Code: Select all

ptr = 0;
* EVENT HERE *
String address = "e";
address += ++ptr;
nvs_write (address, EVENT);
Will save event X on key "e1" and so on. It may not be the most effective speed/memory method, but I'm still in the process of validating ideas and any suggestions or problem about this method are welcome to tell-me. :P

The user will read this log from a simple table in html, and for this, just read each key and return everything to the user in a table, such as:

nvs_read ("e1");
nvs_read ("e2");
..................

Who is online

Users browsing this forum: No registered users and 76 guests