BPROT HAL

group nrf_bprot_hal

Hardware access layer for managing the Block Protection (BPROT) mechanism.

Functions

NRF_STATIC_INLINE void nrf_bprot_nvm_blocks_protection_enable(NRF_BPROT_Type *p_reg, uint8_t group_idx, uint32_t block_mask)

Function for enabling protection for specified non-volatile memory blocks.

Blocks are arranged into groups of 32 blocks each. Each block size is 4 kB. Any attempt to write or erase a protected block will result in hard fault. The memory block protection can be disabled only by resetting the device.

Parameters
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • group_idx[in] Non-volatile memory group containing memory blocks to protect.

  • block_mask[in] Non-volatile memory blocks to protect. Each bit in bitmask represents one memory block in the specified group.

NRF_STATIC_INLINE void nrf_bprot_nvm_protection_in_debug_set(NRF_BPROT_Type *p_reg, bool enable)

Function for setting the non-volatile memory (NVM) protection during debug.

NVM protection is disabled by default while debugging.

Parameters
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if NVM protection during debug is to be enabled, false otherwise.