Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common download scripts for NRF5x #3352

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions hw/bsp/nordic_pca10028-16k/bsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
- "hw/bsp/nordic_pca10028-16k/boot-nrf51xxaa.ld"
- "@apache-mynewt-core/hw/mcu/nordic/nrf51xxx/nrf51.ld"
bsp.part2linkerscript: "hw/bsp/nordic_pca10028-16k/split-nordic_pca10028-16k.ld"
bsp.downloadscript: "hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_download.sh"
bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_debug.sh"
bsp.downloadscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_download.cmd"
bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_debug.cmd"

bsp.flash_map:
areas:
Expand Down
22 changes: 0 additions & 22 deletions hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_download.cmd

This file was deleted.

41 changes: 0 additions & 41 deletions hw/bsp/nordic_pca10028-16k/nordic_pca10028-16k_download.sh

This file was deleted.

1 change: 1 addition & 0 deletions hw/bsp/nordic_pca10028-16k/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pkg.cflags:
pkg.deps:
- "@apache-mynewt-core/hw/mcu/nordic/nrf51xxx"
- "@apache-mynewt-core/libc"
- "@apache-mynewt-core/hw/scripts"

pkg.deps.UART_0:
- "@apache-mynewt-core/hw/drivers/uart/uart_hal"
Expand Down
6 changes: 6 additions & 0 deletions hw/bsp/nordic_pca10028-16k/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ syscfg.vals:
MCU_DCDC_ENABLED: 1
MCU_LFCLK_SOURCE: LFXO

# Flasher parameters
MYNEWT_DOWNLOADER: nrfjprog
MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0
PYOCD_TARGET: nrf51
JLINK_TARGET: nRF51422_xxAC

syscfg.vals.BLE_CONTROLLER:
OS_CPUTIME_FREQ: 32768
OS_CPUTIME_TIMER_NUM: 3
Expand Down
4 changes: 1 addition & 3 deletions hw/bsp/nordic_pca10028/bsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
- "hw/bsp/nordic_pca10028/boot-nrf51xxac.ld"
- "@apache-mynewt-core/hw/mcu/nordic/nrf51xxx/nrf51.ld"
bsp.part2linkerscript: "hw/bsp/nordic_pca10028/split-nordic_pca10028.ld"
bsp.downloadscript: "hw/bsp/nordic_pca10028/nordic_pca10028_download.sh"
bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10028/nordic_pca10028_debug.sh"
bsp.downloadscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10028/nordic_pca10028_download.cmd"
bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10028/nordic_pca10028_debug.cmd"

bsp.flash_map:
areas:
Expand Down
22 changes: 0 additions & 22 deletions hw/bsp/nordic_pca10028/nordic_pca10028_download.cmd

This file was deleted.

41 changes: 0 additions & 41 deletions hw/bsp/nordic_pca10028/nordic_pca10028_download.sh

This file was deleted.

1 change: 1 addition & 0 deletions hw/bsp/nordic_pca10028/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pkg.cflags:
pkg.deps:
- "@apache-mynewt-core/hw/mcu/nordic/nrf51xxx"
- "@apache-mynewt-core/libc"
- "@apache-mynewt-core/hw/scripts"

pkg.deps.UART_0:
- "@apache-mynewt-core/hw/drivers/uart/uart_hal"
Expand Down
6 changes: 6 additions & 0 deletions hw/bsp/nordic_pca10028/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ syscfg.vals:
MCU_DCDC_ENABLED: 1
MCU_LFCLK_SOURCE: LFXO

# Flasher parameters
MYNEWT_DOWNLOADER: nrfjprog
MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0
PYOCD_TARGET: nrf51
JLINK_TARGET: nRF51422_xxAC

syscfg.vals.BLE_CONTROLLER:
OS_CPUTIME_FREQ: 32768
OS_CPUTIME_TIMER_NUM: 3
Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/nordic_pca10056/bsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bsp.arch: cortex_m4
bsp.compiler: compiler/arm-none-eabi-m4
bsp.linkerscript: autogenerated
bsp.part2linkerscript: "hw/bsp/nordic_pca10056/split-nordic_pca10056.ld"
bsp.downloadscript: "hw/bsp/nordic_pca10056/nordic_pca10056_download.sh"
bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10056/nordic_pca10056_debug.sh"

bsp.flash_map:
Expand Down
40 changes: 0 additions & 40 deletions hw/bsp/nordic_pca10056/nordic_pca10056_download.sh

This file was deleted.

1 change: 1 addition & 0 deletions hw/bsp/nordic_pca10056/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pkg.cflags.HARDFLOAT:
pkg.deps:
- "@apache-mynewt-core/hw/mcu/nordic/nrf52xxx"
- "@apache-mynewt-core/libc"
- "@apache-mynewt-core/hw/scripts"
- "@apache-mynewt-core/sys/flash_map"
- "@apache-mynewt-core/boot/startup"

Expand Down
5 changes: 5 additions & 0 deletions hw/bsp/nordic_pca10056/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ syscfg.vals:
QSPI_PIN_DIO3: 23
GPIO_AS_PIN_RESET: 1

MYNEWT_DOWNLOADER: nrfutil
JLINK_TARGET: NRF52
PYOCD_TARGET: nrf52840
MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0

syscfg.vals.BLE_CONTROLLER:
TIMER_0: 0
TIMER_5: 1
Expand Down
34 changes: 33 additions & 1 deletion hw/bsp/nordic_pca10059/bsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bsp.arch: cortex_m4
bsp.compiler: compiler/arm-none-eabi-m4
bsp.linkerscript: autogenerated
bsp.part2linkerscript: "hw/bsp/nordic_pca10059/split-nordic_pca10059.ld"
bsp.downloadscript: "hw/bsp/nordic_pca10059/nordic_pca10059_download.sh"
bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10059/nordic_pca10059_debug.sh"

bsp.flash_map:
Expand Down Expand Up @@ -58,3 +58,35 @@ bsp.flash_map:
device: 0
offset: 0x000fc000
size: 16kB

bsp.flash_map.BSP_NRF_SDK_FLASH_LAYOUT:
areas:
# NRF52 MBR area.
FLASH_AREA_MBR:
user_id: 20
device: 0
offset: 0x00000000
size: 4kB
# NRF52 bootloader ara.
FLASH_AREA_NRF52_BOOTLOADER:
user_id: 21
device: 0
offset: 0x000E0000
size: 128kB
# mynewt image
FLASH_AREA_IMAGE_0:
device: 0
offset: 0x00001000
size: 396kB

# User areas.
FLASH_AREA_REBOOT_LOG:
user_id: 0
device: 0
offset: 0x000C8000
size: 16kB
FLASH_AREA_NFFS:
user_id: 1
device: 0
offset: 0x000CC000
size: 16kB
40 changes: 0 additions & 40 deletions hw/bsp/nordic_pca10059/nordic_pca10059_download.sh

This file was deleted.

1 change: 1 addition & 0 deletions hw/bsp/nordic_pca10059/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pkg.deps:
- "@apache-mynewt-core/libc"
- "@apache-mynewt-core/sys/flash_map"
- "@apache-mynewt-core/boot/startup"
- "@apache-mynewt-core/hw/scripts"

pkg.deps.SOFT_PWM:
- "@apache-mynewt-core/hw/drivers/pwm/soft_pwm"
18 changes: 17 additions & 1 deletion hw/bsp/nordic_pca10059/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@ syscfg.defs:
SOFT_PWM:
description: 'Enable soft PWM'
value: 0
BSP_NRF_SDK_FLASH_LAYOUT:
description: >
Set this to 1 when device has Nordic SDK bootloader.
When this is used device can be flashed with nrfutil
tool without debugger.
value: 0

syscfg.BSP_NRF_SDK_FLASH_LAYOUT:
# Change to use Nordic DFU bootloader which is likely to be used
# when device still has original bootloader
NRFUTIL_TRAITS: nordicDfu

syscfg.vals:
# Enable nRF52840 MCU and common startup code
MYNEWT_DOWNLOADER: nrfutil
JLINK_TARGET: nRF52840_xxAA
PYOCD_TARGET: nrf52840
NRFUTIL_TRAITS: jlink

# Enable nRF52840 MCU and common startup code
MCU_TARGET: nRF52840
MCU_COMMON_STARTUP: 1

Expand Down
6 changes: 6 additions & 0 deletions hw/scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ case "${MYNEWT_VAL_MYNEWT_DOWNLOADER}" in
common_file_to_load
nrfjprog_load
;;
"nrfutil")
check_downloader nrfutil
. $CORE_PATH/hw/scripts/nrfutil.sh
common_file_to_load
nrfutil_load
;;
"openocd")
check_downloader openocd
. $CORE_PATH/hw/scripts/openocd.sh
Expand Down
Loading