From 7a1c286f5caadc1aa7510aaad63ccdfdc4f0b25e Mon Sep 17 00:00:00 2001 From: Andrej Butok Date: Tue, 30 Jul 2024 15:14:18 +0200 Subject: [PATCH] tests: flash: erase_blocks: Add support of flash program size > 128 Fix failed test for platforms with flash program size > 128 bytes. Update supported program size to 512 bytes, the highest supported program size by Zephyr platforms. Signed-off-by: Andrej Butok --- tests/drivers/flash/erase_blocks/src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/drivers/flash/erase_blocks/src/main.c b/tests/drivers/flash/erase_blocks/src/main.c index 0269f7c7691a..57edfee8fced 100644 --- a/tests/drivers/flash/erase_blocks/src/main.c +++ b/tests/drivers/flash/erase_blocks/src/main.c @@ -38,13 +38,13 @@ LOG_MODULE_REGISTER(test_flash); DT_MTD_FROM_FIXED_PARTITION(TEST_FLASH_PART_NODE) static const struct device *flash_controller = DEVICE_DT_GET(TEST_FLASH_CONTROLLER_NODE); -static uint8_t test_write_block[128]; -static uint8_t test_read_block[128]; +static uint8_t test_write_block[512]; +static uint8_t test_read_block[512]; static void test_flash_fill_test_write_block(void) { - for (uint8_t i = 0; i < sizeof(test_write_block); i++) { - test_write_block[i] = i; + for (size_t i = 0; i < sizeof(test_write_block); i++) { + test_write_block[i] = (uint8_t)i; } }