Skip to content

Commit 3835a97

Browse files
mbrossardgerargz
authored andcommitted
Make microbit bootloader optional for kl27z HIC
(cherry picked from commit 1d7ad5d) Modifications: -Only define MICROBIT_LOCK_BOOTLOADER for kl27z_microbit_bl project -Keep only one common: section in kl27z_microbit_bl.yaml
1 parent 7e18836 commit 3835a97

File tree

3 files changed

+405
-0
lines changed

3 files changed

+405
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
common:
2+
macros:
3+
- MICROBIT_LOCK_BOOTLOADER
24
sources:
35
board:
46
- source/board/kl27z_microbit_bl.c

source/hic_hal/freescale/kl27z/armcc/startup_MKL27Z4.s

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ __Vectors_Size EQU __Vectors_End - __Vectors
167167
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
168168
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
169169
; <o7> Backdoor Comparison Key 7. <0x0-0xFF:2>
170+
#if defined(MICROBIT_LOCK_BOOTLOADER)
170171
BackDoorK0 EQU 0x4D ; 'M'
171172
BackDoorK1 EQU 0x49 ; 'I'
172173
BackDoorK2 EQU 0x43 ; 'C'
@@ -175,6 +176,16 @@ BackDoorK4 EQU 0x4F ; 'O'
175176
BackDoorK5 EQU 0x42 ; 'B'
176177
BackDoorK6 EQU 0x49 ; 'I'
177178
BackDoorK7 EQU 0x54 ; 'T'
179+
#else
180+
BackDoorK0 EQU 0xFF
181+
BackDoorK1 EQU 0xFF
182+
BackDoorK2 EQU 0xFF
183+
BackDoorK3 EQU 0xFF
184+
BackDoorK4 EQU 0xFF
185+
BackDoorK5 EQU 0xFF
186+
BackDoorK6 EQU 0xFF
187+
BackDoorK7 EQU 0xFF
188+
#endif
178189
; </h>
179190
; <h> Program flash protection bytes (FPROT)
180191
; <i> Each program flash region can be protected from program and erase operation by setting the associated PROT bit.
@@ -190,7 +201,11 @@ BackDoorK7 EQU 0x54 ; 'T'
190201
; <o.5> FPROT3.5
191202
; <o.6> FPROT3.6
192203
; <o.7> FPROT3.7
204+
#if defined(MICROBIT_LOCK_BOOTLOADER)
193205
nFPROT3 EQU 0x0F ; Enable protection of the first 32 kB of flash
206+
#else
207+
nFPROT3 EQU 0x00
208+
#endif
194209
FPROT3 EQU nFPROT3:EOR:0xFF
195210
; </h>
196211
; <h> FPROT2
@@ -281,7 +296,11 @@ FOPT EQU 0x39
281296
; * <2=> Backdoor key access enabled
282297
; <3=> Backdoor key access disabled
283298
; <i> Backdoor Key Security Enable
299+
#if defined(MICROBIT_LOCK_BOOTLOADER)
284300
FSEC EQU 0xBE
301+
#else
302+
FSEC EQU 0xFE
303+
#endif
285304
; </h>
286305
; </h>
287306

0 commit comments

Comments
 (0)