Skip to content

Commit

Permalink
update ld script
Browse files Browse the repository at this point in the history
  • Loading branch information
solosky committed Feb 16, 2024
1 parent 6995c7b commit 2abc40f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@
"configFiles": [
"${workspaceRoot}/fw/application/openocd/debug.cfg"
]
}
},

{
"name": "Pixl.js BL JLink Debug",
"cwd": "${workspaceRoot}",
"executable": "fw/_build/bootloader.out",
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
"device": "nrf52",
"interface": "swd",
"ipAddress": null,
"serialNumber": null,
},
]
}
17 changes: 11 additions & 6 deletions fw/bootloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OUTPUT_DIRECTORY := ../_build

SDK_ROOT := $(NRF52_SDK_ROOT)
PROJ_DIR := ./src
BOARD ?= LCD
BOARD ?= NEO

# boards defines
ifeq ($(BOARD),NEO)
Expand Down Expand Up @@ -190,7 +190,7 @@ CFLAGS += $(OPT)
CFLAGS += -DBLE_STACK_SUPPORT_REQD
CFLAGS += -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DFLOAT_ABI_HARD
CFLAGS += -DNRF52
#CFLAGS += -DNRF52
CFLAGS += -D$(NRF_SOC)
CFLAGS += -DNRF52_PAN_74
CFLAGS += -DNRF_DFU_SETTINGS_VERSION=2
Expand All @@ -213,10 +213,6 @@ CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
CFLAGS += -fno-builtin -fshort-enums
CFLAGS += -DCUSTOM_BOARD_INC=boards_defines
CFLAGS += -DBOARD_$(BOARD)
# oled
ifeq ($(OLED_TYPE), sh1106)
CFLAGS += -DOLED_TYPE_SH1106
endif

# C++ flags common to all targets
CXXFLAGS += $(OPT)
Expand Down Expand Up @@ -288,6 +284,15 @@ flash: default
nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/bootloader.hex --sectorerase
nrfjprog -f nrf52 --reset

# Flash softdevice
flash_softdevice:
@echo Flashing: $(SD_VERSION_INC)_nrf52_7.2.0_softdevice.hex
nrfjprog -f nrf52 --program $(SDK_ROOT)/components/softdevice/$(SD_VERSION_INC)/hex/$(SD_VERSION_INC)_nrf52_7.2.0_softdevice.hex --sectorerase --log
nrfjprog -f nrf52 --reset --log

erase:
nrfjprog -f nrf52 --eraseall

privgen:
nrfutil keys generate priv.pem
nrfutil keys display --key pk --format code priv.pem --out_file dfu_public_key.c
11 changes: 0 additions & 11 deletions fw/ld/bootloader.ld
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,3 @@ SECTIONS


INCLUDE "nrf_common.ld"

SECTIONS
{
.noinit (NOLOAD):
{
PROVIDE(__start_noinit = .);
/* place all symbols in input sections that start with .noinit */
KEEP(*(*.noinit*))
PROVIDE(__stop_noinit = .);
} > NOINIT
}
16 changes: 3 additions & 13 deletions fw/ld/bootloader_nrf52840.ld
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ GROUP(-lgcc -lc -lnosys)

MEMORY
{
FLASH (rx) : ORIGIN = 0xF3000, LENGTH = 0xB000
RAM (rwx) : ORIGIN = 0x20005978, LENGTH = 0x32688
FLASH (rx) : ORIGIN = 0xf8000, LENGTH = 0x6000
RAM (rwx) : ORIGIN = 0x20005978, LENGTH = 0x3a688
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
Expand Down Expand Up @@ -152,15 +152,5 @@ SECTIONS

} INSERT AFTER .text

INCLUDE "nrf_common.ld"

SECTIONS
{
.noinit (NOLOAD):
{
PROVIDE(__start_noinit = .);
/* place all symbols in input sections that start with .noinit */
KEEP(*(*.noinit*))
PROVIDE(__stop_noinit = .);
} > NOINIT
}
INCLUDE "nrf_common.ld"

0 comments on commit 2abc40f

Please sign in to comment.