Skip to content

Commit 8d065fe

Browse files
committed
update reamde
1 parent 5454768 commit 8d065fe

1 file changed

Lines changed: 32 additions & 48 deletions

File tree

ports/nrf/boards/feather52840/README.md

Lines changed: 32 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ nrfjprog version: 9.7.2
7474
JLinkARM.dll version: 6.20f
7575
```
7676

77-
### Option 1 (nRF52832 or nRF52840): Flash the HW UART Bootloader with `nrfjprog`
77+
### Flash the USB CDC Bootloader with 'nrfjprog'
7878

7979
> This operation only needs to be done once, and only on boards that don't
8080
already have the serial bootloader installed.
@@ -83,14 +83,14 @@ Once `nrfjprog` is installed and available in `PATH` you can flash your
8383
board with the serial bootloader via the following command:
8484

8585
```
86-
make SD=s140 BOARD=feather52840 boot-flash
86+
make SD=s140 BOARD=feather52840 bootloader
8787
```
8888

8989
This should give you the following (or very similar) output, and you will see
9090
a DFU blinky pattern on one of the board LEDs:
9191

9292
```
93-
$ make SD=s140 BOARD=feather52840 boot-flash
93+
$ make SD=s140 BOARD=feather52840 bootloader
9494
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
9595
nrfjprog --program boards/feather52840/bootloader/feather52840_bootloader_6.0.0_s140_single.hex -f nrf52 --chiperase --reset
9696
Parsing hex file.
@@ -105,37 +105,6 @@ Run.
105105
From this point onward, you can now use a simple serial port for firmware
106106
updates.
107107

108-
### Option 2 (nRF52840): Flash the USB CDC Bootloader with 'nrfjprog'
109-
110-
> This operation only needs to be done once, and only on boards that don't
111-
already have the serial bootloader installed.
112-
113-
Once `nrfjprog` is installed and available in `PATH` you can flash your
114-
board with the serial bootloader via the following command:
115-
116-
```
117-
make SD=s140 BOARD=feather52840 boot-usb-flash
118-
```
119-
120-
This should give you the following (or very similar) output, and you will see
121-
a DFU blinky pattern on one of the board LEDs:
122-
123-
```
124-
$ make SD=s140 BOARD=feather52840 boot-usb-flash
125-
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
126-
nrfjprog --program boards/feather52840/bootloader/usb/feather52840_bootloader_6.0.0_s140_single.hex -f nrf52 --chiperase --reset
127-
Parsing hex file.
128-
Erasing user available code and UICR flash areas.
129-
Applying system reset.
130-
Checking that the area to write is not protected.
131-
Programing device.
132-
Applying system reset.
133-
Run.
134-
```
135-
136-
From this point onward, you can now use a simple serial port for firmware
137-
updates.
138-
139108
### IMPORTANT: Disable Mass Storage on PCA10056 J-Link
140109

141110
The J-Link firmware on the PCA10056 implement USB Mass Storage, but this
@@ -181,22 +150,17 @@ $ sudo pip install -r requirements.txt
181150
$ sudo python setup.py install
182151
```
183152

184-
#### Changes to `nrfutil` in 0.5.2b
153+
#### Changes to `nrfutil` in 0.5.2d
185154

186-
**IMPORTANT**: Make sure that you have version **0.5.2b**, since a small
155+
**IMPORTANT**: Make sure that you have version **0.5.2d**, since a small
187156
change was required to `dfu_transport_serial.py` to account for the
188157
increased minimum flash erase time on the nRF52840 compared to the earlier
189158
nRF52832!
190159

191160
You can also manually change the file with the following new values (lines
192161
67-68), and reinstall the utility via `sudo python setup.py install`:
193162

194-
```
195-
FLASH_PAGE_ERASE_MAX_TIME = 0.1 # Worst time to erase a page 100 ms
196-
FLASH_PAGE_ERASE_MIN_TIME = 0.09 # Best time to erase a page 90 ms
197-
```
198-
199-
### Flashing CircuitPython
163+
### Flashing CircuitPython with USB CDC
200164

201165
With the serial bootloader present on your board, you first need to force your
202166
board into DFU mode by holding down BUTTON1 and RESETTING the board (with
@@ -215,18 +179,38 @@ $ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all dfu-gen d
215179
This should give you the following results:
216180

217181
```
218-
$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 dfu-gen dfu-flash
182+
$make V=1 BOARD=feather52840 SD=s140 SERIAL=/dev/tty.usbmodem1411 dfu-gen dfu-flash
219183
nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application build-feather52840-s140/firmware.hex build-feather52840-s140/dfu-package.zip
220184
Zip created at build-feather52840-s140/dfu-package.zip
221-
nrfutil --verbose dfu serial --package build-feather52840-s140/dfu-package.zip -p /dev/tty.usbmodem1411 -b 115200
222-
Upgrading target on /dev/tty.usbmodem1411 with DFU package /Users/kevintownsend/Dropbox/microBuilder/Code/CircuitPython/circuitpython-mb/ports/nrf/build-feather52840-s140/dfu-package.zip. Flow control is disabled.
223-
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 195252
185+
nrfutil --verbose dfu serial --package build-feather52840-s140/dfu-package.zip -p /dev/ttyACM1 -b 115200 --singlebank
186+
Upgrading target on /dev/ttyACM1 with DFU package /home/hathach/Dropbox/adafruit/circuitpython/ada_cp/ports/nrf/build-feather52840-s140/dfu-package.zip. Flow control is disabled, Single bank mode
187+
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 199840
224188
Sending DFU start packet
225189
Sending DFU init packet
226190
Sending firmware file
227-
################################################################################################################################################################################################################################################################################################################################################################################################
191+
#########################################################################################################################################################################################################################################################################################################################################################################################################
228192
Activating new firmware
229193
230-
DFU upgrade took 41.6610329151s
194+
DFU upgrade took 8.50606513023s
231195
Device programmed.
232196
```
197+
198+
### Flashing CircuitPython with MSC UF2
199+
200+
Make `uf2` target to generate the uf2
201+
202+
```
203+
$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all uf2
204+
Create firmware.uf2
205+
../../tools/uf2/utils/uf2conv.py -c -o "build-feather52840-s140/firmware.uf2" "build-feather52840-s140/firmware.hex"
206+
Converting to uf2, output size: 392192, start address: 0x26000
207+
Wrote 392192 bytes to build-feather52840-s140/firmware.uf2.
208+
```
209+
210+
Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done.
211+
212+
**Note**: you need to update `tools/uf2` for uf2conv.py to support hex file input, current circuitpython's master use older verion of uf2conv.py which only support biin file input. To update, change directory to top folder of circuitpython and run. The size of uf2 should be ~400KB, if using the old uf2conv.py the output file would be 1 MB which is not correct.
213+
214+
```
215+
git submodule update --init
216+
```

0 commit comments

Comments
 (0)