Page 1 of 1

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

Posted: Thu Nov 22, 2018 6:32 am
by stoikos
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 ?

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

Posted: Thu Nov 22, 2018 7:49 am
by stoikos
I suspect that I need to take into account proper data type alignment in the struct. where can I get this info?