ble_app_all_in_one crashes with hardfault when program DA14535 Module

ID: LPCBARESDK-1053

Status: Open

First reported: 6.0.22.1401

Fixed in: TBD

Description

This issue is a hardware limitation specific to the DA14535 Module, which causes the ble_app_all_in_one application to crash with a Hardfault when the code is downloaded to RAM using a debugger.

The problem occurs on the DA14535 Module due to its smaller flash size compared to the DA14535 development kit. This issue does not affect the DA14535 device itself, nor does it occur on the DA14531 Module, as the project is not targeting the DA14531.

Workaround

The project defines the USER_CFG_BOND_DB_DATA_OFFSET macro in the user_config.h file with a value of 0x39000 to specify the location of the bonding database. However, this creates an issue when the device attempts to read the bonding database from the external flash at that address.

The problem arises because the P25Q11U flash used in the DA14535MOD has a capacity of 0x20000. As a result, the size calculation is incorrect, leading the spi_flash_read_data function to continue reading until a Hardfault occurs. Since the flash’s address counter rolls over to 0 when it reaches the maximum address, any read operation will always happen within the flash’s bounds, potentially leading to data corruption or system crashes.

If the macro is undefined, the default bonding database location is 0x1E000, which results in correct size calculations. Since no other projects define this macro, this issue is not expected to affect them.

The issue can be resolved by changing the USER_CFG_BOND_DB_DATA_OFFSET macro to 0x1E000. However, this change may cause additional complications when using the development kit, particularly when generating SUotA images. Please Reach out to your local support for assistance.