From 4eea5988c11b7208c46efdbab311550caab3e2e1 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 28 Aug 2020 17:49:19 +0200 Subject: [PATCH] fixup! tests/periph_flashpage: add test for AUX page --- tests/periph_flashpage/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/periph_flashpage/main.c b/tests/periph_flashpage/main.c index 1aaf77307c55e..a9833b6c15035 100644 --- a/tests/periph_flashpage/main.c +++ b/tests/periph_flashpage/main.c @@ -547,7 +547,11 @@ static int cmd_dump_config(int argc, char **argv) (void) argc; (void) argv; +#ifdef FLASH_USER_PAGE_SIZE od_hex_dump((void*)NVMCTRL_USER, FLASH_USER_PAGE_SIZE, 0); +#else + od_hex_dump((void*)NVMCTRL_USER, AUX_PAGE_SIZE * AUX_NB_OF_PAGES, 0); +#endif return 0; } @@ -568,7 +572,7 @@ static int cmd_test_config(int argc, char **argv) /* check if the AUX page has been cleared */ for (uint32_t i = 0; i < FLASH_USER_PAGE_AUX_SIZE; ++i) { if (*(uint8_t*)sam0_flashpage_aux_get(i) != 0xFF) { - printf("user page not cleared at offset 0x%lx\n", i); + printf("user page not cleared at offset 0x%"PRIx32"\n", i); return -1; } } @@ -582,13 +586,13 @@ static int cmd_test_config(int argc, char **argv) /* check if half-word was written correctly */ uint16_t data_in = *(uint16_t*)sam0_flashpage_aux_get(dst + sizeof(test_data)); if (data_in != single_data) { - printf("%x != %x, offset = 0x%lx\n", single_data, data_in, dst + sizeof(test_data)); + printf("%x != %x, offset = 0x%"PRIx32"\n", single_data, data_in, dst + sizeof(test_data)); return -1; } /* check if test data was written correctly */ if (memcmp(sam0_flashpage_aux_get(dst), test_data, sizeof(test_data))) { - printf("write test_data failed, offset = 0x%lx\n", dst); + printf("write test_data failed, offset = 0x%"PRIx32"\n", dst); return -1; }