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 address Peripheral Instance Description Configuration
0x40000000 BPROT BPROT

Block Protect

   
Table 2. Register Overview
Register Offset Description
CONFIG0 0x600

Block protect configuration register 0

 
CONFIG1 0x604

Block protect configuration register 1

 
DISABLEINDEBUG 0x608

Disable protection mechanism in debug interface mode

 
  0x60C  

Reserved

CONFIG2 0x610

Block protect configuration register 2

 
CONFIG3 0x614

Block protect configuration register 3

 

CONFIG0

Address offset: 0x600

Block protect configuration register 0

Bit number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Id f e d c b a Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
Reset 0x00000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Id RW Field Value Id Value Description
A RW

REGION0

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

B RW

REGION1

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

C RW

REGION2

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

D RW

REGION3

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

E RW

REGION4

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

F RW

REGION5

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

G RW

REGION6

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

H RW

REGION7

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

I RW

REGION8

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

J RW

REGION9

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

K RW

REGION10

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

L RW

REGION11

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

M RW

REGION12

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

N RW

REGION13

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

O RW

REGION14

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

P RW

REGION15

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

Q RW

REGION16

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

R RW

REGION17

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

S RW

REGION18

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

T RW

REGION19

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

U RW

REGION20

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

V RW

REGION21

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

W RW

REGION22

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

X RW

REGION23

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

Y RW

REGION24

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

Z RW

REGION25

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

a RW

REGION26

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

b RW

REGION27

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

c RW

REGION28

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

d RW

REGION29

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

e RW

REGION30

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enable

f RW

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 number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Id f e d c b a Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
Reset 0x00000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Id RW Field Value Id Value Description
A RW

REGION32

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

B RW

REGION33

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

C RW

REGION34

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

D RW

REGION35

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

E RW

REGION36

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

F RW

REGION37

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

G RW

REGION38

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

H RW

REGION39

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

I RW

REGION40

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

J RW

REGION41

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

K RW

REGION42

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

L RW

REGION43

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

M RW

REGION44

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

N RW

REGION45

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

O RW

REGION46

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

P RW

REGION47

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Q RW

REGION48

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

R RW

REGION49

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

S RW

REGION50

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

T RW

REGION51

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

U RW

REGION52

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

V RW

REGION53

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

W RW

REGION54

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

X RW

REGION55

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Y RW

REGION56

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Z RW

REGION57

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

a RW

REGION58

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

b RW

REGION59

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

c RW

REGION60

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

d RW

REGION61

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

e RW

REGION62

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

f RW

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 number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Id                                                               A
Reset 0x00000001 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Id RW Field Value Id Value Description
A RW

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 number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Id f e d c b a Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
Reset 0x00000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Id RW Field Value Id Value Description
A RW

REGION64

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

B RW

REGION65

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

C RW

REGION66

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

D RW

REGION67

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

E RW

REGION68

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

F RW

REGION69

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

G RW

REGION70

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

H RW

REGION71

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

I RW

REGION72

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

J RW

REGION73

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

K RW

REGION74

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

L RW

REGION75

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

M RW

REGION76

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

N RW

REGION77

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

O RW

REGION78

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

P RW

REGION79

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Q RW

REGION80

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

R RW

REGION81

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

S RW

REGION82

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

T RW

REGION83

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

U RW

REGION84

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

V RW

REGION85

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

W RW

REGION86

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

X RW

REGION87

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Y RW

REGION88

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Z RW

REGION89

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

a RW

REGION90

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

b RW

REGION91

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

c RW

REGION92

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

d RW

REGION93

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

e RW

REGION94

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

f RW

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 number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Id f e d c b a Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
Reset 0x00000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Id RW Field Value Id Value Description
A RW

REGION96

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

B RW

REGION97

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

C RW

REGION98

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

D RW

REGION99

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

E RW

REGION100

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

F RW

REGION101

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

G RW

REGION102

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

H RW

REGION103

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

I RW

REGION104

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

J RW

REGION105

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

K RW

REGION106

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

L RW

REGION107

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

M RW

REGION108

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

N RW

REGION109

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

O RW

REGION110

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

P RW

REGION111

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Q RW

REGION112

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

R RW

REGION113

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

S RW

REGION114

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

T RW

REGION115

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

U RW

REGION116

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

V RW

REGION117

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

W RW

REGION118

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

X RW

REGION119

   

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

     

Disabled

0

Protection disabled

     

Enabled

1

Protection enabled

Y RW

REGION120