nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Examples from SDK (ble_app_hrs_c)

Hello, I want to understand why some example with the "nrf52832"  crash. My project is about to scan BLE device to found tags.

To start, I have tried multiples examples from the SDK library. I am interested in these :

example : ble_app_hrs_c

I didn't make them work. (RTT Log)

<info> app_timer: RTC: initialized.
<error> app: Fatal error

Function : nrf_sdh_enable_request() return error 7. (Wrong parameters ?)

This beacon example work with my hardware ble_app_beacon.

What can be the problem, and how can I make the example work ? I suspect wrong configuration in my sdk_config.h

My setup:

Software:

- Firmware:  pca10040 / s132

- Stack Bluetooth : SoftDevice S132.

- SDK : nRF5_SDK_17.1.0_ddde560

Hardware:

- MDBT42Q-512KV2 from Raytac with a nrf52832.

- J-Link Debug Probes

- Voltage : 1.8V

- 32KHz qwartz is present.

Environment:

- Kubuntu (Linux)

- arm-none-eabi-gcc (v10.3.1) (xpack) + make

Regards,

lilian

  • For my  application, I want to get information about "beacon" of Bluetooth devices in range of my module. I want my application run in the module nrf52832.

    To start with Nordic SDK, I have tried to compile and tests some examples like "ble_app_hrs_c". The example does not work in my case and I created this ticket for it.

    I guess I was wrong, since I can't compile now from a fresh restart with this Makefile from SDK:

    "examples/ble_central/ble_app_hrs_c/pca10040/s132/armgcc/Makefile"

    components/libraries/bsp/bsp_btn_ble.c:50:35: error: 'BSP_BUTTON_ACTION_RELEASE' undeclared (first use in this function)

    I have opened the ticket when I used the "ser_s132_uart" version that I don't want to use.

    Some points I learned:

    - I didn't know "Serialization"  and I wasn't expected this feature. I don't want to use it for now, but it seems interesting, and I will maybe create a ticket for it if needed.

    - I have created my custom header "custom_board.h" (no button, one led)

    My goal:

    I want just try Bluetooth Scan API and log information scanned with RTT to test it.

  • ZaltoEver said:
    I have opened the ticket when I used the "ser_s132_uart" version that I don't want to use.

    OK, that makes sense. The "normal" ble_app_hrs_c projects for S132 on the nRF52832 is under,  examples/ble_central/ble_app_hrs_c/pca10040/s132/ which you are now using, so that is good.

    ZaltoEver said:
    - I have created my custom header "custom_board.h" (no button, one led)

    The example should run out of the box on the DK, but will need adaptations for your custom board, as I understand you have started with following this guide. Copy the pca10040.h and modify to fit your board. Also, adjust the project configuration (Makefile if you use that) so that you define BOARD_CUSTOM and remove the definition of BOARD_PCA10040. As you have no buttons and 1 LED you also should modify the example code (examples/ble_central/ble_app_hrs_c/main.c) to note use it. I would simply remove everything related to the BSP. Lastly, adjust sdk_config.h as needed, for instance if you don't have an external LF crystal. (Remember that the sdk_config.h file used by projects under examples/ble_central/ble_app_hrs_c/pca10040/s132/ is examples/ble_central/ble_app_hrs_c/pca10040/s132/config/sdk_config.h).

    ZaltoEver said:
    I want just try Bluetooth Scan API and log information scanned with RTT to test it.

    For this you can remove almost everything of the example and just keep the scanning part, potentially adjusting the scan filter depending on what advertising packets you are interested in. See Scanning Module documentation.

  • Hello,

    I have removed BSP source files and code, changed defines, enable RTT log.

    Compilation work, Scan work (see it in log).

    I will take a look on the scan API.

    I got some hard fault when I use the debugger breakpoint. (J-Link)

    Thank you

  • Hi,

    That is good to hear.

    ZaltoEver said:
    I got some hard fault when I use the debugger breakpoint. (J-Link)

    That is expected. The SoftDevice will assert if you halt execution (for instance with a breakpoint) and then continue again. To overcome this when debugging with a SoftDevice you should reset after hitting a breakpoint (then you can move the breakpoint before resetting to simulate stepping if needed).

Related