BPROT — Block protection

The mechanism for protecting non-volatile memory can be used to prevent application code from erasing or writing to protected blocks.

Non-volatile memory can be protected from erases and writes depending on the settings in the CONFIG registers. One bit in a CONFIG register represents one protected block of 4 kB. There are four CONFIG registers of 32 bits, which means there are 128 protectable blocks in total.

Important: If an erase or write to a protected block is detected, the CPU will hard fault. If an ERASEALL operation is attempted from the CPU while any block is protected, it will be blocked and the CPU will hard fault.

On reset, all the protection bits are cleared. To ensure safe operation, the first task after reset must be to set the protection bits. The only way of clearing protection bits is by resetting the device from any reset source.

The protection mechanism is turned off when in debug interface mode (a debugger is connected) and the DISABLEINDEBUG register is set to disable. For more information, see Debug and trace.

Figure 1. Protected regions of program memory

Registers

Table 1. Instances
Base addressPeripheralInstanceDescriptionConfiguration
0x40000000BPROTBPROT

Block Protect

  
Table 2. Register Overview
RegisterOffsetDescription
CONFIG00x600

Block protect configuration register 0

 
CONFIG10x604

Block protect configuration register 1

 
DISABLEINDEBUG0x608

Disable protection mechanism in debug interface mode

 
 0x60C 

Reserved

CONFIG20x610

Block protect configuration register 2

 
CONFIG30x614

Block protect configuration register 3

 

CONFIG0

Address offset: 0x600

Block protect configuration register 0

Bit number313029282726252423222120191817161514131211109876543210
IdfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

REGION0

  

Enable protection for region 0. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

BRW

REGION1

  

Enable protection for region 1. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

CRW

REGION2

  

Enable protection for region 2. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

DRW

REGION3

  

Enable protection for region 3. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

ERW

REGION4

  

Enable protection for region 4. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

FRW

REGION5

  

Enable protection for region 5. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

GRW

REGION6

  

Enable protection for region 6. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

HRW

REGION7

  

Enable protection for region 7. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

IRW

REGION8

  

Enable protection for region 8. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

JRW

REGION9

  

Enable protection for region 9. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

KRW

REGION10

  

Enable protection for region 10. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

LRW

REGION11

  

Enable protection for region 11. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

MRW

REGION12

  

Enable protection for region 12. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

NRW

REGION13

  

Enable protection for region 13. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

ORW

REGION14

  

Enable protection for region 14. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

PRW

REGION15

  

Enable protection for region 15. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

QRW

REGION16

  

Enable protection for region 16. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

RRW

REGION17

  

Enable protection for region 17. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

SRW

REGION18

  

Enable protection for region 18. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

TRW

REGION19

  

Enable protection for region 19. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

URW

REGION20

  

Enable protection for region 20. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

VRW

REGION21

  

Enable protection for region 21. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

WRW

REGION22

  

Enable protection for region 22. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

XRW

REGION23

  

Enable protection for region 23. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

YRW

REGION24

  

Enable protection for region 24. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

ZRW

REGION25

  

Enable protection for region 25. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

aRW

REGION26

  

Enable protection for region 26. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

bRW

REGION27

  

Enable protection for region 27. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

cRW

REGION28

  

Enable protection for region 28. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

dRW

REGION29

  

Enable protection for region 29. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

eRW

REGION30

  

Enable protection for region 30. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

fRW

REGION31

  

Enable protection for region 31. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enable

 

CONFIG1

Address offset: 0x604

Block protect configuration register 1

Bit number313029282726252423222120191817161514131211109876543210
IdfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

REGION32

  

Enable protection for region 32. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

BRW

REGION33

  

Enable protection for region 33. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

CRW

REGION34

  

Enable protection for region 34. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

DRW

REGION35

  

Enable protection for region 35. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ERW

REGION36

  

Enable protection for region 36. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

FRW

REGION37

  

Enable protection for region 37. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

GRW

REGION38

  

Enable protection for region 38. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

HRW

REGION39

  

Enable protection for region 39. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

IRW

REGION40

  

Enable protection for region 40. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

JRW

REGION41

  

Enable protection for region 41. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

KRW

REGION42

  

Enable protection for region 42. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

LRW

REGION43

  

Enable protection for region 43. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

MRW

REGION44

  

Enable protection for region 44. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

NRW

REGION45

  

Enable protection for region 45. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ORW

REGION46

  

Enable protection for region 46. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

PRW

REGION47

  

Enable protection for region 47. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

QRW

REGION48

  

Enable protection for region 48. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

RRW

REGION49

  

Enable protection for region 49. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

SRW

REGION50

  

Enable protection for region 50. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

TRW

REGION51

  

Enable protection for region 51. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

URW

REGION52

  

Enable protection for region 52. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

VRW

REGION53

  

Enable protection for region 53. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

WRW

REGION54

  

Enable protection for region 54. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

XRW

REGION55

  

Enable protection for region 55. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

YRW

REGION56

  

Enable protection for region 56. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ZRW

REGION57

  

Enable protection for region 57. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

aRW

REGION58

  

Enable protection for region 58. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

bRW

REGION59

  

Enable protection for region 59. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

cRW

REGION60

  

Enable protection for region 60. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

dRW

REGION61

  

Enable protection for region 61. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

eRW

REGION62

  

Enable protection for region 62. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

fRW

REGION63

  

Enable protection for region 63. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

 

DISABLEINDEBUG

Address offset: 0x608

Disable protection mechanism in debug interface mode

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000100000000000000000000000000000001
IdRWFieldValue IdValueDescription
ARW

DISABLEINDEBUG

  

Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode.

   

Disabled

1

Disable in debug

   

Enabled

0

Enable in debug

 

CONFIG2

Address offset: 0x610

Block protect configuration register 2

Bit number313029282726252423222120191817161514131211109876543210
IdfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

REGION64

  

Enable protection for region 64. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

BRW

REGION65

  

Enable protection for region 65. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

CRW

REGION66

  

Enable protection for region 66. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

DRW

REGION67

  

Enable protection for region 67. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ERW

REGION68

  

Enable protection for region 68. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

FRW

REGION69

  

Enable protection for region 69. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

GRW

REGION70

  

Enable protection for region 70. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

HRW

REGION71

  

Enable protection for region 71. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

IRW

REGION72

  

Enable protection for region 72. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

JRW

REGION73

  

Enable protection for region 73. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

KRW

REGION74

  

Enable protection for region 74. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

LRW

REGION75

  

Enable protection for region 75. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

MRW

REGION76

  

Enable protection for region 76. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

NRW

REGION77

  

Enable protection for region 77. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ORW

REGION78

  

Enable protection for region 78. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

PRW

REGION79

  

Enable protection for region 79. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

QRW

REGION80

  

Enable protection for region 80. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

RRW

REGION81

  

Enable protection for region 81. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

SRW

REGION82

  

Enable protection for region 82. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

TRW

REGION83

  

Enable protection for region 83. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

URW

REGION84

  

Enable protection for region 84. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

VRW

REGION85

  

Enable protection for region 85. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

WRW

REGION86

  

Enable protection for region 86. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

XRW

REGION87

  

Enable protection for region 87. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

YRW

REGION88

  

Enable protection for region 88. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ZRW

REGION89

  

Enable protection for region 89. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

aRW

REGION90

  

Enable protection for region 90. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

bRW

REGION91

  

Enable protection for region 91. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

cRW

REGION92

  

Enable protection for region 92. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

dRW

REGION93

  

Enable protection for region 93. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

eRW

REGION94

  

Enable protection for region 94. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

fRW

REGION95

  

Enable protection for region 95. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

 

CONFIG3

Address offset: 0x614

Block protect configuration register 3

Bit number313029282726252423222120191817161514131211109876543210
IdfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

REGION96

  

Enable protection for region 96. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

BRW

REGION97

  

Enable protection for region 97. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

CRW

REGION98

  

Enable protection for region 98. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

DRW

REGION99

  

Enable protection for region 99. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ERW

REGION100

  

Enable protection for region 100. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

FRW

REGION101

  

Enable protection for region 101. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

GRW

REGION102

  

Enable protection for region 102. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

HRW

REGION103

  

Enable protection for region 103. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

IRW

REGION104

  

Enable protection for region 104. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

JRW

REGION105

  

Enable protection for region 105. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

KRW

REGION106

  

Enable protection for region 106. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

LRW

REGION107

  

Enable protection for region 107. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

MRW

REGION108

  

Enable protection for region 108. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

NRW

REGION109

  

Enable protection for region 109. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ORW

REGION110

  

Enable protection for region 110. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

PRW

REGION111

  

Enable protection for region 111. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

QRW

REGION112

  

Enable protection for region 112. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

RRW

REGION113

  

Enable protection for region 113. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

SRW

REGION114

  

Enable protection for region 114. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

TRW

REGION115

  

Enable protection for region 115. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

URW

REGION116

  

Enable protection for region 116. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

VRW

REGION117

  

Enable protection for region 117. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

WRW

REGION118

  

Enable protection for region 118. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

XRW

REGION119

  

Enable protection for region 119. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

YRW

REGION120

  

Enable protection for region 120. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

ZRW

REGION121

  

Enable protection for region 121. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

aRW

REGION122

  

Enable protection for region 122. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

bRW

REGION123

  

Enable protection for region 123. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

cRW

REGION124

  

Enable protection for region 124. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

dRW

REGION125

  

Enable protection for region 125. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

eRW

REGION126

  

Enable protection for region 126. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled

fRW

REGION127

  

Enable protection for region 127. Write '0' has no effect.

   

Disabled

0

Protection disabled

   

Enabled

1

Protection enabled