Skip to content

Commit 06d53b1

Browse files
nvincent-vosslohstephanosio
authored andcommitted
settings fcb: Increase buffer for mcu with large write block size
Devices with write block size greater than 16 could not use settings_fcb due to small buffer size. Update value in test as well. Signed-off-by: Nicolas VINCENT <[email protected]>
1 parent 18e2f44 commit 06d53b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

subsys/settings/src/settings_line.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int settings_line_write(const char *name, const char *value, size_t val_len,
2727
size_t w_size, rem, add;
2828

2929
bool done;
30-
char w_buf[16]; /* write buff, must be aligned either to minimal */
30+
char w_buf[32]; /* write buff, must be aligned either to minimal */
3131
/* base64 encoding size and write-block-size */
3232
int rc;
3333
uint8_t wbs = settings_io_cb.rwbs;
@@ -174,7 +174,7 @@ static int settings_line_raw_read_until(off_t seek, char *out, size_t len_req,
174174
void *cb_arg)
175175
{
176176
size_t rem_size, len;
177-
char temp_buf[16]; /* buffer for fit read-block-size requirements */
177+
char temp_buf[32]; /* buffer for fit read-block-size requirements */
178178
size_t exp_size, read_size;
179179
uint8_t rbs = settings_io_cb.rwbs;
180180
off_t off;

tests/subsys/settings/fcb/src/settings_test_fcb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void *settings_config_fcb_setup(void)
354354
zassume_true(rc == 0, "Can't open storage flash area");
355355

356356
wbs = flash_area_align(fap);
357-
zassume_true(wbs <= 16,
357+
zassume_true(wbs <= 32,
358358
"Flash driver is not compatible with the settings fcb-backend");
359359
return NULL;
360360
}

0 commit comments

Comments
 (0)