I am using a nRF52840 with "SEGGER Embedded Studio for ARM 5.10a" and "nRF5_SDK_17.0.0_9d13099" sdk.
I am using a nRF52840 with "SEGGER Embedded Studio for ARM 5.10a" and "nRF5_SDK_17.0.0_9d13099" sdk.
I have successfully added Bluetooth in my project .
Here is the step by step guide if any one needs it.
Create a folder named nRF_SoftDevices and add these files
Create a folder named nRF_BLE and add these files
Add following files to nrf_Libraries
In the end
Create a folder named nRF_BLE_Services and add the file related to services you need. I need “nus” service so I have added files required for that
Go to Solution ‘project name’ right click, go to “options” go to “Code” go to “Preprocessor” go to “User Include Directories” and add the paths to the following folders. These are the path of the folders containing “.h” files required to clear the build errors.
For me paths were…
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers\nrf52
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\drivers_nrf\nrf_soc_nosd
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\timer
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\mutex
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\atomic_fifo
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\common
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_advertising
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_gatt
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_qwr
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_services\ble_nus
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_link_ctx_manager
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\pwr_mgmt
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\common E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\examples\peripheral\Lynkgrid_base_ble\nRF_SoftDevice
Go to Project‘project name’, right click, go to “options” select “Common” go to “Code” go to “Preprocessor” go to “Preprocessor Definitions” and add the following defines
BOARD_PCA10056
BSP_DEFINES_ONLY
CONFIG_GPIO_AS_PINRESET
FLOAT_ABI_HARD
INITIALIZE_USER_SECTIONS
NRF52840_XXAA
NO_VTOR_CONFIG
NRF_SD_BLE_API_VERSION=7
S140
SOFTDEVICE_PRESENT
APP_TIMER_V2
APP_TIMER_V2_RTC1_ENABLED
Go to Project‘project name’, right click, go to “options” select “Common” go to “Code” go to “Linker” go to “Section Placement Macros” and set the flash and ram values as given
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x100000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x40000
FLASH_START=0x27000
FLASH_SIZE=0xd9000
RAM_START=0x20002ae8
RAM_SIZE=0x3d518
Go to Project‘project name’, right click, go to “options” select “Common” go to “Debug” go to “Loader” go to “Additional Load File[0]” and add the path to softdevice.hex
For me it was…
E:/nRF5_SDK_17.0.0_9d13099/nRF5_SDK_17.0.0_9d13099/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex
If you face an error while building the code that look like this Error : undefined reference to `__start_sdh_req_observers'
Replace the “flash_placement.xml” file of your project with the flash_placement.xml file of the ble_app_template project.
Merger the sdk_config.h file of your project with the sdk_config.h of ble_app_template project. You may need to do some changes in your sdk_config.h file according to requirement. I have made changes related to the “nus” service I need in my project.
Nordic Semiconductor Infocenter
Nordic Semiconductor Infocenter
NordicPlayground/nRF5x-custom-ble-service-tutorial (github.com)
I have successfully added Bluetooth in my project .
Here is the step by step guide if any one needs it.
Create a folder named nRF_SoftDevices and add these files
Create a folder named nRF_BLE and add these files
Add following files to nrf_Libraries
In the end
Create a folder named nRF_BLE_Services and add the file related to services you need. I need “nus” service so I have added files required for that
Go to Solution ‘project name’ right click, go to “options” go to “Code” go to “Preprocessor” go to “User Include Directories” and add the paths to the following folders. These are the path of the folders containing “.h” files required to clear the build errors.
For me paths were…
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\s140\headers\nrf52
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\drivers_nrf\nrf_soc_nosd
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\timer
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\mutex
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\atomic_fifo
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\common
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_advertising
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_gatt
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\nrf_ble_qwr
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_services\ble_nus
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\ble\ble_link_ctx_manager
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\pwr_mgmt
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\libraries\sortlist
E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\components\softdevice\common E:\nRF5_SDK_17.0.0_9d13099\nRF5_SDK_17.0.0_9d13099\examples\peripheral\Lynkgrid_base_ble\nRF_SoftDevice
Go to Project‘project name’, right click, go to “options” select “Common” go to “Code” go to “Preprocessor” go to “Preprocessor Definitions” and add the following defines
BOARD_PCA10056
BSP_DEFINES_ONLY
CONFIG_GPIO_AS_PINRESET
FLOAT_ABI_HARD
INITIALIZE_USER_SECTIONS
NRF52840_XXAA
NO_VTOR_CONFIG
NRF_SD_BLE_API_VERSION=7
S140
SOFTDEVICE_PRESENT
APP_TIMER_V2
APP_TIMER_V2_RTC1_ENABLED
Go to Project‘project name’, right click, go to “options” select “Common” go to “Code” go to “Linker” go to “Section Placement Macros” and set the flash and ram values as given
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x100000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x40000
FLASH_START=0x27000
FLASH_SIZE=0xd9000
RAM_START=0x20002ae8
RAM_SIZE=0x3d518
Go to Project‘project name’, right click, go to “options” select “Common” go to “Debug” go to “Loader” go to “Additional Load File[0]” and add the path to softdevice.hex
For me it was…
E:/nRF5_SDK_17.0.0_9d13099/nRF5_SDK_17.0.0_9d13099/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex
If you face an error while building the code that look like this Error : undefined reference to `__start_sdh_req_observers'
Replace the “flash_placement.xml” file of your project with the flash_placement.xml file of the ble_app_template project.
Merger the sdk_config.h file of your project with the sdk_config.h of ble_app_template project. You may need to do some changes in your sdk_config.h file according to requirement. I have made changes related to the “nus” service I need in my project.
Nordic Semiconductor Infocenter
Nordic Semiconductor Infocenter
NordicPlayground/nRF5x-custom-ble-service-tutorial (github.com)