how to represent a struct in a csv file used by nvs_partition_gen.py and read it back in esp32

stoikos
Posts: 31
Joined: Mon Aug 06, 2018 4:38 am

how to represent a struct in a csv file used by nvs_partition_gen.py and read it back in esp32

Postby stoikos » Thu Nov 22, 2018 6:32 am

Hi ,
I have a factoryconfig struct that i want to be available in ESP32. I want to upload the data to a custom NVS partition using a csv file as input to_partition_gen.py, get the bin, flash it and then read it back in ESP32. I tried

Code: Select all

factoryConfig,data,hex2bin,00000001000100000000000000000000000000000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c8000043c80000
but when i read it back in ESP32 i get garbage

Code: Select all

#define P_COUNT 5
#define B_COUNT 4
typedef struct 
{	
	bool factoryConfigComplete;
	bool  valid[P_COUNT][B_COUNT];              
	float factor[P_COUNT][B_COUNT];             		
} factory_info_t;
Any idea ?

stoikos
Posts: 31
Joined: Mon Aug 06, 2018 4:38 am

Re: how to represent a struct in a csv file used by nvs_partition_gen.py and read it back in esp32

Postby stoikos » Thu Nov 22, 2018 7:49 am

I suspect that I need to take into account proper data type alignment in the struct. where can I get this info?

Who is online

Users browsing this forum: No registered users and 114 guests