Skip to content
Permalink
Browse files

tests/drivers/soc_flash_nrf: fix lack of disabled protection

Write protection was not disabled prior erase call.
It used to work before only because nrf driver had not check
the protection before erase execution. This behavior was changed in
order to align to zephyr - which implied requirement for this test fix.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
  • Loading branch information...
nvlsianpu authored and carlescufi committed Apr 2, 2019
1 parent 279115e commit 2d24ce85652eea00f7002aad7d5e50dfff8ed9f4
Showing with 1 addition and 2 deletions.
  1. +1 −2 samples/drivers/soc_flash_nrf/src/main.c
@@ -46,6 +46,7 @@ void main(void)
}

printf("\nTest 1: Flash erase page at 0x%x\n", FLASH_TEST_OFFSET);
flash_write_protection_set(flash_dev, false);
if (flash_erase(flash_dev, FLASH_TEST_OFFSET, FLASH_PAGE_SIZE) != 0) {
printf(" Flash erase failed!\n");
} else {
@@ -76,7 +77,6 @@ void main(void)
printf(" Data read does not match data written!\n");
}
}
flash_write_protection_set(flash_dev, true);

offset = FLASH_TEST_OFFSET - FLASH_PAGE_SIZE * 2;
printf("\nTest 3: Flash erase (4 pages at 0x%x)\n", offset);
@@ -110,7 +110,6 @@ void main(void)
printf(" Data read does not match data written!\n");
}
}
flash_write_protection_set(flash_dev, true);

printf("\nTest 5: Flash erase page at 0x%x\n", FLASH_TEST_OFFSET);
if (flash_erase(flash_dev, FLASH_TEST_OFFSET, FLASH_PAGE_SIZE) != 0) {

0 comments on commit 2d24ce8

Please sign in to comment.
You can’t perform that action at this time.