Skip to content
Open
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
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ if (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Build type" FORCE)
endif ()

# SoftDevice S145 for nRF54L
# SoftDevice S145 for nRF54L. 10.0.1 ships a separate hex per SoC, so SD_CHIP below is the
# SoC name rather than a family name.
if(NOT DEFINED SD_VERSION)
set(SD_VERSION 9.0.0)
set(SD_VERSION 10.0.1)
endif ()

project(nRF54L_Bootloader C ASM)
Expand Down Expand Up @@ -211,14 +212,17 @@ endif ()
if (MCU_VARIANT STREQUAL "nrf54l15")
set(DFU_DEV_REV 54115)
set(DFU_APP_DATA_RESERVED 8*4096)
set(SD_CHIP nrf54l15)
target_compile_definitions(bootloader PUBLIC NRF54L15_XXAA)
elseif (MCU_VARIANT STREQUAL "nrf54l10")
set(DFU_DEV_REV 54110)
set(DFU_APP_DATA_RESERVED 8*4096)
set(SD_CHIP nrf54l10)
target_compile_definitions(bootloader PUBLIC NRF54L10_XXAA NRF54L15_XXAA)
elseif (MCU_VARIANT STREQUAL "nrf54l05")
set(DFU_DEV_REV 54105)
set(DFU_APP_DATA_RESERVED 8*4096)
set(SD_CHIP nrf54l05)
target_compile_definitions(bootloader PUBLIC NRF54L05_XXAA NRF54L15_XXAA)
else ()
message(FATAL_ERROR "Unknown MCU_VARIANT: ${MCU_VARIANT}")
Expand All @@ -231,8 +235,7 @@ endif ()
string(TOUPPER ${SD_NAME} SD_NAME_UPPER)
target_compile_definitions(bootloader PUBLIC ${SD_NAME_UPPER})

set(SD_CHIP_FAMILY nrf54l)
set(SD_FILENAME ${SD_NAME}_${SD_CHIP_FAMILY}_${SD_VERSION})
set(SD_FILENAME ${SD_NAME}_${SD_CHIP}_${SD_VERSION})
set(SD_HEX ${SOFTDEVICE_DIR}/${SD_FILENAME}/${SD_FILENAME}_softdevice.hex)

target_compile_definitions(bootloader PUBLIC ${SD_NAME_UPPER})
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ its own vector table at `0x8000` and forwards the SoftDevice interrupts.
| CF2 config | `0x7C00` | `0x7C00` | `0x7C00` |
| Application | `0x8000 – 0x47000` | `0x8000 – 0xC7000` | `0x8000 – 0x147000` |
| Bootloader settings page | `0x4F000` | `0xCF000` | `0x14F000` |
| SoftDevice s145 | `0x58C00` | `0xD8C00` | `0x158C00` |
| SoftDevice s145 10.0.1 | `0x5A800` | `0xDA800` | `0x15A800` |

RAM: `0x20000000 – 0x20004800` SoftDevice, bootloader and application from
`0x20004800`; the last 128 bytes (`0x2003FF80`) hold the BLE peer data and
Expand Down Expand Up @@ -111,10 +111,14 @@ pyocd load -t nrf54l --erase sector <s145_softdevice.hex>
### DFU an application over serial

```bash
adafruit-nrfutil dfu genpkg --dev-type 0x0054 --sd-req 0x3024 --application app.hex app_dfu.zip
adafruit-nrfutil dfu genpkg --dev-type 0x0054 --sd-req 0x310D --application app.hex app_dfu.zip
adafruit-nrfutil dfu serial --package app_dfu.zip -p /dev/ttyACM0 -b 115200 --singlebank
```

`--sd-req` is the SoftDevice FWID: `0x310D` for s145 10.0.1, on every
variant. It was `0x3024` for s145 9.0.0, which this bootloader no longer
ships; devices still running that SoftDevice need it reflashed.

## Build options

| Option | Default | Description |
Expand All @@ -141,7 +145,7 @@ cmake -G Ninja -B _build -DBOARD=nrf54l15dk -DSIGNED_FW=ON -DSIGNED_FW_QX='...'
Create a signed DFU package:

```bash
adafruit-nrfutil dfu genpkg --dev-type 0x0054 --sd-req 0x3024 --application app.hex --key-file stored_key.pem app_dfu.zip
adafruit-nrfutil dfu genpkg --dev-type 0x0054 --sd-req 0x310D --application app.hex --key-file stored_key.pem app_dfu.zip
```

## Adding a new board
Expand Down
6 changes: 3 additions & 3 deletions lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ static inline uint32_t sd_softdevice_vector_table_base_set(uint32_t addr)
#define BOOTLOADER_REGION_START 0x00000000
#define CODE_REGION_1_START 0x00008000
#if defined(NRF54L05_XXAA)
#define SOFTDEVICE_REGION_START 0x00058C00
#define SOFTDEVICE_REGION_START 0x0005A800
#define BOOTLOADER_SETTINGS_ADDRESS 0x0004F000
#elif defined(NRF54L10_XXAA)
#define SOFTDEVICE_REGION_START 0x000D8C00
#define SOFTDEVICE_REGION_START 0x000DA800
#define BOOTLOADER_SETTINGS_ADDRESS 0x000CF000
#elif defined(NRF54L15_XXAA)
#define SOFTDEVICE_REGION_START 0x00158C00
#define SOFTDEVICE_REGION_START 0x0015A800
#define BOOTLOADER_SETTINGS_ADDRESS 0x0014F000
#else
#error "No nRF54L target defined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ enum BLE_GAP_QOS_CONN_EVENT_REPORT
#define BLE_GAP_DEVNAME_MAX_LEN 248 /**< Maximum number of octets in device name. */
/**@} */

/**@brief Received Signal Strength Indication (RSSI) not available. */
#define BLE_GAP_RSSI_UNAVAILABLE 127

/**@brief Disable RSSI events for connections */
#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF
Expand Down Expand Up @@ -1244,8 +1246,8 @@ typedef struct
/**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */
typedef struct
{
int8_t rssi; /**< Received Signal Strength Indication in dBm.
@note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */
int8_t rssi; /**< Received Signal Strength Indication (RSSI) in dBm.
@ref BLE_GAP_RSSI_UNAVAILABLE if RSSI is unavailable. */
uint8_t ch_index; /**< Data Channel Index on which the Signal Strength is measured (0-36). */
} ble_gap_evt_rssi_changed_t;

Expand Down Expand Up @@ -1291,8 +1293,8 @@ typedef struct
This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the
last received packet did not contain the Tx Power field.
@note TX Power is only included in extended advertising packets. */
int8_t rssi; /**< Received Signal Strength Indication in dBm of the last packet received.
@note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */
int8_t rssi; /**< Received Signal Strength Indication (RSSI) in dBm.
@ref BLE_GAP_RSSI_UNAVAILABLE if RSSI is unavailable. */
uint8_t set_id; /**< Set ID of the received advertising data. Set ID is not present
if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */
ble_data_t data; /**< Received advertising or scan response data,
Expand Down Expand Up @@ -1326,6 +1328,8 @@ typedef struct
typedef struct
{
uint8_t adv_handle; /**< Advertising handle for the advertising set which received the Scan Request */
int8_t rssi; /**< Received Signal Strength Indication (RSSI) in dBm.
@ref BLE_GAP_RSSI_UNAVAILABLE if RSSI is unavailable. */
ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1
and the address is the device's identity address. */
} ble_gap_evt_scan_req_report_t;
Expand Down Expand Up @@ -2737,7 +2741,6 @@ SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle
*
* @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND
* will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start.
* @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement.
* @mscs
* @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
* @endmscs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
/*
* Copyright (c) Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
@defgroup nrf_error SoftDevice Global Error Codes
@{

@brief Global Error definitions
*/

/* Header guard */
#ifndef NRF_ERROR_H__
#define NRF_ERROR_H__

#ifdef __cplusplus
extern "C" {
#endif

/** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions
* @{ */
#define NRF_ERROR_BASE_NUM (0x0) ///< Global error base
#define NRF_ERROR_SDM_BASE_NUM (0x1000) ///< SDM error base
#define NRF_ERROR_SOC_BASE_NUM (0x2000) ///< SoC error base
#define NRF_ERROR_STK_BASE_NUM (0x3000) ///< STK error base
/** @} */

#define NRF_SUCCESS (NRF_ERROR_BASE_NUM + 0) ///< Successful command
#define NRF_ERROR_SVC_HANDLER_MISSING (NRF_ERROR_BASE_NUM + 1) ///< SVC handler is missing
#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED (NRF_ERROR_BASE_NUM + 2) ///< SoftDevice has not been enabled
#define NRF_ERROR_INTERNAL (NRF_ERROR_BASE_NUM + 3) ///< Internal Error
#define NRF_ERROR_NO_MEM (NRF_ERROR_BASE_NUM + 4) ///< No Memory for operation
#define NRF_ERROR_NOT_FOUND (NRF_ERROR_BASE_NUM + 5) ///< Not found
#define NRF_ERROR_NOT_SUPPORTED (NRF_ERROR_BASE_NUM + 6) ///< Not supported
#define NRF_ERROR_INVALID_PARAM (NRF_ERROR_BASE_NUM + 7) ///< Invalid Parameter
#define NRF_ERROR_INVALID_STATE (NRF_ERROR_BASE_NUM + 8) ///< Invalid state, operation disallowed in this state
#define NRF_ERROR_INVALID_LENGTH (NRF_ERROR_BASE_NUM + 9) ///< Invalid Length
#define NRF_ERROR_INVALID_FLAGS (NRF_ERROR_BASE_NUM + 10) ///< Invalid Flags
#define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11) ///< Invalid Data
#define NRF_ERROR_DATA_SIZE (NRF_ERROR_BASE_NUM + 12) ///< Invalid Data size
#define NRF_ERROR_TIMEOUT (NRF_ERROR_BASE_NUM + 13) ///< Operation timed out
#define NRF_ERROR_NULL (NRF_ERROR_BASE_NUM + 14) ///< Null Pointer
#define NRF_ERROR_FORBIDDEN (NRF_ERROR_BASE_NUM + 15) ///< Forbidden Operation
#define NRF_ERROR_INVALID_ADDR (NRF_ERROR_BASE_NUM + 16) ///< Bad Memory Address
#define NRF_ERROR_BUSY (NRF_ERROR_BASE_NUM + 17) ///< Busy
#define NRF_ERROR_CONN_COUNT (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded.
#define NRF_ERROR_RESOURCES (NRF_ERROR_BASE_NUM + 19) ///< Not enough resources for operation

#ifdef __cplusplus
}
#endif
#endif // NRF_ERROR_H__

/**
@}
*/
/*
* Copyright (c) Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
@defgroup nrf_error SoftDevice Global Error Codes
@{
@brief Global Error definitions
*/
/* Header guard */
#ifndef NRF_ERROR_H__
#define NRF_ERROR_H__
#ifdef __cplusplus
extern "C" {
#endif
/** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions
* @{ */
#define NRF_ERROR_BASE_NUM (0x0) ///< Global error base
#define NRF_ERROR_SDM_BASE_NUM (0x1000) ///< SDM error base
#define NRF_ERROR_SOC_BASE_NUM (0x2000) ///< SoC error base
#define NRF_ERROR_STK_BASE_NUM (0x3000) ///< STK error base
/** @} */
#define NRF_SUCCESS (NRF_ERROR_BASE_NUM + 0) ///< Successful command
#define NRF_ERROR_SVC_HANDLER_MISSING (NRF_ERROR_BASE_NUM + 1) ///< SVC handler is missing
#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED (NRF_ERROR_BASE_NUM + 2) ///< SoftDevice has not been enabled
#define NRF_ERROR_INTERNAL (NRF_ERROR_BASE_NUM + 3) ///< Internal Error
#define NRF_ERROR_NO_MEM (NRF_ERROR_BASE_NUM + 4) ///< No Memory for operation
#define NRF_ERROR_NOT_FOUND (NRF_ERROR_BASE_NUM + 5) ///< Not found
#define NRF_ERROR_NOT_SUPPORTED (NRF_ERROR_BASE_NUM + 6) ///< Not supported
#define NRF_ERROR_INVALID_PARAM (NRF_ERROR_BASE_NUM + 7) ///< Invalid Parameter
#define NRF_ERROR_INVALID_STATE (NRF_ERROR_BASE_NUM + 8) ///< Invalid state, operation disallowed in this state
#define NRF_ERROR_INVALID_LENGTH (NRF_ERROR_BASE_NUM + 9) ///< Invalid Length
#define NRF_ERROR_INVALID_FLAGS (NRF_ERROR_BASE_NUM + 10) ///< Invalid Flags
#define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11) ///< Invalid Data
#define NRF_ERROR_DATA_SIZE (NRF_ERROR_BASE_NUM + 12) ///< Invalid Data size
#define NRF_ERROR_TIMEOUT (NRF_ERROR_BASE_NUM + 13) ///< Operation timed out
#define NRF_ERROR_NULL (NRF_ERROR_BASE_NUM + 14) ///< Null Pointer
#define NRF_ERROR_FORBIDDEN (NRF_ERROR_BASE_NUM + 15) ///< Forbidden Operation
#define NRF_ERROR_INVALID_ADDR (NRF_ERROR_BASE_NUM + 16) ///< Bad Memory Address
#define NRF_ERROR_BUSY (NRF_ERROR_BASE_NUM + 17) ///< Busy
#define NRF_ERROR_CONN_COUNT (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded.
#define NRF_ERROR_RESOURCES (NRF_ERROR_BASE_NUM + 19) ///< Not enough resources for operation
#ifdef __cplusplus
}
#endif
#endif // NRF_ERROR_H__
/**
@}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
* @defgroup nrf_sd_def SoftDevice definitions
* @{
*
* @brief Peripherals reserved by SoftDevice.
*
*/

#ifndef NRF_SD_DEF_H__
#define NRF_SD_DEF_H__

Expand Down Expand Up @@ -66,8 +74,12 @@ extern "C" {

#define SD_SWI_USED 0x00000007uL /**< Software interrupts utilized by SoftDevice (not available to the application). */

#define SD_TIMESLOT_TIMER0 NRF_TIMER10 /**< TIMER instance utilized by SoftDevice (not available to the application). */

#ifdef __cplusplus
}
#endif

#endif /* NRF_SD_DEF_H__ */

/**@} */
Loading