Lines Matching +full:write +full:- +full:protected

4  * SPDX-License-Identifier: Apache-2.0
36 flash_get_page_info_by_offs(dev, offset + size - 1, &end_page)) { in sector_mask_from_offset()
37 return -EINVAL; in sector_mask_from_offset()
40 *mask = ((1UL << (end_page.index + 1)) - 1) & in sector_mask_from_offset()
41 ~((1UL << start_page.index) - 1); in sector_mask_from_offset()
73 /* Check if region is not write protected. */ in flash_stm32_setup()
76 zassert_equal(rc, 0, "Cannot get write protect status"); in flash_stm32_setup()
78 TC_PRINT("Protected sectors: 0x%llx\n", wp_status.protected_mask); in flash_stm32_setup()
82 TC_PRINT("Removing write protection\n"); in flash_stm32_setup()
88 zassert_equal(rc, 0, "Cannot remove write protection"); in flash_stm32_setup()
97 if (buf[i] != flash_params->erase_value) { in flash_stm32_setup()
125 TC_PRINT("Enabling write protection..."); in ZTEST()
131 zassert_equal(rc, 0, "Cannot enable write protection"); in ZTEST()
135 zassert_not_equal(rc, 0, "Write suceeded"); in ZTEST()
136 TC_PRINT("Write failed as expected, error %d\n", rc); in ZTEST()
142 zassert_true(buf[i] == flash_params->erase_value, in ZTEST()
143 "Buffer is not empty after write with protected " in ZTEST()
147 TC_PRINT("Disabling write protection..."); in ZTEST()
153 zassert_equal(rc, 0, "Cannot disable write protection"); in ZTEST()
157 zassert_equal(rc, 0, "Write failed"); in ZTEST()
158 TC_PRINT("Write suceeded\n"); in ZTEST()
196 return regs->OPTCR & FLASH_OPTCR_OPTLOCK; in flash_opt_locked()
203 regs->KEYR = FLASH_KEY1; in flash_cr_unlock()
204 regs->KEYR = FLASH_KEY2; in flash_cr_unlock()
211 return regs->CR & FLASH_CR_LOCK; in flash_cr_locked()
229 SCB->SHCSR &= ~SCB_SHCSR_BUSFAULTPENDED_Msk; in ZTEST()
245 SCB->SHCSR &= ~SCB_SHCSR_BUSFAULTPENDED_Msk; in ZTEST()