Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfg_page: provide/manage of configuration variables in flash #17092

Closed
wants to merge 43 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e4fc877
shell comments for cfg_page
mcr Oct 14, 2021
e568eb1
initial work on cfg_page
mcr Oct 14, 2021
ce6855e
added CFG_PAGE options to native board
mcr Oct 14, 2021
f317b3d
return serialno from cfg_page_validate, and remove debugging, fix int…
mcr Oct 18, 2021
f17368e
added cfg_page_format to initialize the new pages
mcr Oct 20, 2021
2e11c11
moved slot selection code out of tester, into cfg_page_init
mcr Oct 20, 2021
6f16a3b
changed struct cfg_page_desc_t to typedef
mcr Oct 20, 2021
23495ee
test case exits when done to permit shell script driven tests
mcr Oct 20, 2021
4b6ea52
added two more test cases, document test1
mcr Oct 20, 2021
d308f5d
re-intend with RIOT style: bsd w/4-spaces
mcr Oct 20, 2021
ff74bc7
added debug of crc value
mcr Oct 20, 2021
002a34d
when initializing, make sure entire page is erased
mcr Oct 20, 2021
aecaffd
prepare the flash file better: initialize to 0xff, and create proper …
mcr Oct 20, 2021
49650f8
initialize the flash space with 0xff properly
mcr Oct 20, 2021
1b76133
cfg_page: coded cfg_page_get_value that returns _last_ key from map
mcr Oct 20, 2021
c1f302c
cfg_page: added cfg_page_set_str_value writer function and test
mcr Oct 20, 2021
7b8bff0
cfg_page: correctly initialize test data with indefinite map, and the…
mcr Oct 20, 2021
b2fa52c
cfg_page: when writing, take care to split up the writes when they cr…
mcr Oct 21, 2021
79bd61d
cfg_page: added documentation on how cfg_page_swap_slotno is supposed…
mcr Oct 22, 2021
41e03f1
cfg_page: initialize the pointers correctly, and also point writer at…
mcr Oct 22, 2021
44de62e
cfg_page: push the contents to just before the 4k page blows up
mcr Oct 22, 2021
e37b034
cfg_page: cfg_page_print reads entire SECTOR rather than only PAGE of…
mcr Oct 22, 2021
ab48c8b
cfg_page: refactor out initialization of header
mcr Oct 23, 2021
7df4380
cfg_page: remember what the highest active serial number is
mcr Oct 23, 2021
1e50742
cfg_page: move initialize of map into page_format
mcr Oct 23, 2021
d3144f7
cfg_page: instead of re-initializing the end of values reader in the …
mcr Oct 23, 2021
236e7c0
cfg_page: rejig the loop when writing that does the slot swap. Moved…
mcr Oct 26, 2021
3fcd066
cfg_page: make sure that last copy of key is splatted after it is copied
mcr Oct 28, 2021
908898e
cfg_page: deal with keys that are bigger than one byte
mcr Oct 28, 2021
831ef3f
cfg_page: test with bigger key values
mcr Oct 28, 2021
a872ab3
cfg_page: clean up some debug for better readability
mcr Oct 28, 2021
2ef4655
cfg_page: deal with key size of 0
mcr Oct 28, 2021
9885e87
cfg_page: rework splat code, then realized that calculation of key si…
mcr Oct 29, 2021
eb99f27
cfg_page: turn off some debugging
mcr Oct 29, 2021
bfde775
cfg_page: bump test to 256 to get two iterations of slot swap
mcr Oct 29, 2021
45aefe8
cfg_page: move to variety of key sizes
mcr Oct 29, 2021
c0b3fb8
cfg_page: stock mtd_write only supports MTD_PAGE_SIZE blocks
mcr Oct 29, 2021
268f358
cfg_page: added wrap around for serial numbers
mcr Oct 29, 2021
0e3f5a6
cfg_page: added documentation for functions
mcr Oct 29, 2021
f132669
cfg_page: increment valuelen to accomodate key part
mcr Nov 1, 2021
a71b1e4
cfg_page: nanocbor_at_end() seems to not end in some circumstances, TBD
mcr Nov 1, 2021
fede9cb
cfg_page: name test file TEST4.bin
mcr Nov 1, 2021
43fc319
cfg_page: turn off debug
mcr Nov 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cfg_page: test with bigger key values
mcr committed Oct 29, 2021
commit 831ef3f305503bba643800ba0e0b5e2bddef4ccc
7 changes: 4 additions & 3 deletions tests/driver_cfg_page/main.c
Original file line number Diff line number Diff line change
@@ -42,18 +42,19 @@ int main(void)

cfg_page_print(&cfgpage);

for(i=0; i<127; i++) {
for(i=0; i<128; i++) {
printf("writing iteration %d\n", i);
uint8_t buf2[16];
snprintf((char *)buf2, 16, "bob%04x", i);
if(cfg_page_set_str_value(&cfgpage, 1, buf2, strlen((const char *)buf2)) != 0) {
printf("set key 1 failed\n");
}
snprintf((char *)buf2, 16, "frank%04x", i);
if(cfg_page_set_str_value(&cfgpage, 2, buf2, strlen((const char *)buf2)) != 0) {
if(cfg_page_set_str_value(&cfgpage, 32, buf2, strlen((const char *)buf2)) != 0) {
printf("set key 2 failed\n");
}
snprintf((char *)buf2, 16, "george%04x", i);
if(cfg_page_set_str_value(&cfgpage, 3, buf2, strlen((const char *)buf2)) != 0) {
if(cfg_page_set_str_value(&cfgpage, 65537, buf2, strlen((const char *)buf2)) != 0) {
printf("set key 3 failed\n");
}
}