Skip to content

Commit

Permalink
Merge pull request #73 from brilliantlabsAR/dev-raj
Browse files Browse the repository at this point in the history
Camera I2C working
  • Loading branch information
siliconwitch authored Jan 31, 2023
2 parents a8d8712 + e67cab3 commit 64d7bce
Show file tree
Hide file tree
Showing 11 changed files with 3,342 additions and 3,505 deletions.
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@
"isDefault": false
},
},
{
"label": "Release",
"type": "shell",
"command": "make release",
"problemMatcher": [
"$gcc"
],
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": {
"kind": "build",
"isDefault": false
},
},
{
"label": "Clean",
"type": "shell",
Expand Down
50 changes: 6 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ SRC_C += modules/fpga.c
SRC_C += modules/led.c
SRC_C += modules/time.c
SRC_C += modules/touch.c
SRC_C += modules/update.c

SRC_C += segger/SEGGER_RTT_printf.c
SRC_C += segger/SEGGER_RTT_Syscalls_GCC.c
Expand Down Expand Up @@ -198,48 +199,9 @@ flash: build/application.hex
nrfjprog --reset -f nrf52

release: clean build/application.hex
sed -i 's/NEXT_RELEASE/$(BUILD_VERSION)/' CHANGELOG.md
git commit -am "Release $(BUILD_VERSION)"
git tag $(BUILD_VERSION)
nrfutil settings generate --family NRF52 --application build/application.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 build/settings.hex
mergehex -m build/settings.hex build/application.hex softdevice/s132_nrf52_7.3.0_softdevice.hex bootloader/build/nrf52832_xxaa_s132.hex -o build/release-$(BUILD_VERSION).hex
nrfutil pkg generate --hw-version 52 --application-version 0 --application build/application.hex --sd-req 0x0124 --key-file bootloader/published_privkey.pem build/release-$(BUILD_VERSION).zip
nrfutil pkg generate --hw-version 52 --application-version 0 --application build/application.hex --sd-req 0x0124 --key-file bootloader/published_privkey.pem build/release-$(BUILD_VERSION)-next.zip

include micropython/py/mkrules.mk

# TODO fix the zip creation
# Bluetooth settings generated by nrfutil below
# BLSETTINGS_HEX := build/blsettings.hex
# BOOTLOADER_HEX := bootloader/build/nrf52832_xxaa_s132.hex
# BOOTLOADER_KEY := bootloader/published_privkey.pem


########################################
# TODO turn these into one flash command, and enable plugin for OpenOCD

# OPENOCD = openocd -c 'gdb_port 2331'
# OPENOCD_FLASH = -c 'init; nrf52_recover; program build/firmware.hex verify; reset run; exit'
# OPENOCD_RTT = -c 'init; rtt setup 0x20000000 0x8000 "SEGGER RTT"; rtt start; rtt server start 9090 0'
# OPENOCD_STLINK = -f interface/stlink-dap.cfg -f target/nrf52.cfg
# OPENOCD_JLINK = -f interface/jlink.cfg -c 'transport select swd' -f target/nrf52.cfg

flash_openocd_stlink:
$(OPENOCD) $(OPENOCD_STLINK) $(OPENOCD_FLASH)

flash_openocd_jlink:
$(OPENOCD) $(OPENOCD_JLINK) $(OPENOCD_FLASH)

rtt_openocd_stlink:
$(OPENOCD) $(OPENOCD_STLINK) $(OPENOCD_RTT)

rtt_openocd_jlink:
$(OPENOCD) $(OPENOCD_JLINK) $(OPENOCD_RTT)

flash_nrfjprog_jlink:
$(NRFJPROG) --family nrf52 --recover
$(NRFJPROG) --family nrf52 --verify --program ${FIRMWARE_HEX} --debugreset

gdb_openocd_stlink:
$(OPENOCD) $(OPENOCD_STLINK)

gdb_openocd_jlink:
$(OPENOCD) $(OPENOCD_JLINK)

########################################
include micropython/py/mkrules.mk
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,36 @@ nrfjprog --program *.hex --chiperase -f nrf52 --verify --reset
1. Build & flash
1. Clean

### Generating final release `.hex` and DFU `.zip` files

1. Download and install [nrfutil](https://www.nordicsemi.com/Products/Development-tools/nRF-Util) including the `nrf5sdk-tools` package:

```sh
chmod +x nrfutil
# Make sure to add nrfutil to your path
nrfutil install nrf5sdk-tools
```

1. Generate a settings file:

```sh
nrfutil settings generate --family NRF52 --application build/application.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 build/settings.hex
```

1. Download and install the `mergehex` tool which is a part of the [nRF Command Line Tools](https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools).

1. Merge the settings, bootloader, softdevice and application hex files:

```sh
mergehex -m build/settings.hex build/application.hex softdevice/s132_nrf52_7.3.0_softdevice.hex bootloader/build/nrf52832_xxaa_s132.hex -o build/release.hex
```

1. Create the DFU zip package using the command:

```sh
nrfutil pkg generate --hw-version 52 --application-version 0 --application build/application.hex --sd-req 0x0124 --key-file bootloader/published_privkey.pem build/release.zip
```

## FPGA

For information on developing and flashing the FPGA binary. Check the [Monocle FPGA](https://github.com/brilliantlabsAR/monocle-fpga) repository.
Loading

0 comments on commit 64d7bce

Please sign in to comment.