File tree Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ set(TINYUSB_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb/src)
34
34
set (UF2CONV_PY ${CMAKE_CURRENT_LIST_DIR} /lib/uf2/utils/uf2conv.py )
35
35
set (UF2_FAMILY_ID_BOOTLOADER 0xd663823c )
36
36
37
+ if (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "" )
38
+ set (CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Build type" FORCE )
39
+ endif ()
40
+
37
41
#-------------------
38
42
# Bootloader
39
43
#-------------------
@@ -131,7 +135,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
131
135
target_include_directories (bootloader PUBLIC
132
136
lib/SEGGER_RTT/RTT
133
137
)
134
-
135
138
target_compile_definitions (bootloader PUBLIC
136
139
CFG_DEBUG
137
140
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
@@ -175,6 +178,7 @@ target_compile_options(bootloader PUBLIC
175
178
)
176
179
target_compile_definitions (bootloader PUBLIC
177
180
SOFTDEVICE_PRESENT
181
+ CONFIG_GPIO_AS_PINRESET
178
182
)
179
183
180
184
if (TRACE_ETM STREQUAL "1" )
@@ -333,4 +337,11 @@ add_custom_target(flash-mbr
333
337
334
338
add_custom_target (flash-erase
335
339
COMMAND ${NRFJPROG} -f nrf52 --eraseall
336
- )
340
+ )
341
+
342
+ # flash skip crc magic ( app valid = 0x0001, crc = 0x0000 )
343
+ #add_custom_target(flash-skip-crc
344
+ # #COMMAND ${NRFJPROG} --memwr $(BOOT_SETTING_ADDR) --val 0x00000001 -f nrf52
345
+ # COMMAND ${NRFJPROG} --memwr 0xFF000 --val 0x00000001 -f nrf52
346
+ # #COMMAND ${NRFJPROG} --memwr 0x7F000 --val 0x00000001 -f nrf52
347
+ # )
Original file line number Diff line number Diff line change @@ -114,14 +114,20 @@ You must have have a J-Link available to "unbrick" your device.
114
114
115
115
### Build:
116
116
117
- Firstly clone this repo with following commands
117
+ Firstly clone this repo including its submodules with following command:
118
118
119
+ ```
120
+ git clone --recurse-submodules https://github.com/adafruit/Adafruit_nRF52_Bootloader
121
+ ```
122
+
123
+ For git versions before `2.13.0` you have to do that manually:
119
124
```
120
125
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
121
126
cd Adafruit_nRF52_Bootloader
122
127
git submodule update --init
123
128
```
124
129
130
+ #### Build using `make`
125
131
Then build it with `make BOARD={board} all`, for example:
126
132
127
133
```
@@ -137,6 +143,37 @@ Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056
137
143
Makefile:90: ** * BOARD not defined. Stop
138
144
```
139
145
146
+ #### Build using `cmake`
147
+
148
+ Firstly initialize your build environment by passing your board to `cmake` via `-DBOARD={board}`:
149
+
150
+ ```bash
151
+ mkdir build
152
+ cd build
153
+ cmake .. -DBOARD=feather_nrf52840_express
154
+ ```
155
+
156
+ And then build it with:
157
+
158
+ ``` bash
159
+ make
160
+ ```
161
+
162
+ You can also use the generator of your choice. For example adding the ` -GNinja ` and then you can invoke ` ninja build ` instead of ` make ` .
163
+
164
+ To list all supported targets, run:
165
+
166
+ ``` bash
167
+ cmake --build . --target help
168
+ ```
169
+
170
+ To build individual targets, you can specify it directly with ` make ` or using ` cmake --build ` :
171
+
172
+ ``` bash
173
+ make bootloader
174
+ cmake --build . --target bootloader
175
+ ```
176
+
140
177
### Flash
141
178
142
179
To flash the bootloader (without softdevice/mbr) using JLink:
You can’t perform that action at this time.
0 commit comments