Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Wierd error 7 happening in init

The problem i having seems to be tricky and i spent hours trying to figure out whats happening.
So, i will try to put all details possible. Im two days with this issue and i cant go past it.

Im developing in a nRF52810 in a MS50SFB2 module from minew (just some minimal parts like oscilators  caps and resistors in the board).

Also nRF5_SDK_17.1.0_ddde560 (already tried the 15.3) and segger studio 6.30 on windows 10.

I tried to start the BLE and it seems to be impossible because of some wierd error that keeps happening. At this point i belive its some configuration missing and i hope someone here can give me a light on whats happening, preety please? <3

So, i just got the example in: ble_app_blinky\pca10040e\s112\ses open and tried to upload. So far so good it compiled but i had to remove SEGGER_RTT_Syscalls_SES.c.

Thats the only change i made.

When i try to debug, i keep getting the same crash:

The code is:

err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)DEVICE_NAME,
                                          strlen(DEVICE_NAME));
    APP_ERROR_CHECK(err_code);

I kept like, 8 hours trying to change defines, looking for simuilar errors, combinations of DEVICE_NAME... Nothing!

Then i decided to move to another thing (twi), and when i came back, i started to get the same error in a few line bellow:

    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    APP_ERROR_CHECK(err_code);

Just to put here the whole funcion:

/**@brief Function for the GAP initialization.
 *
 * @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
 *          device including the device name, appearance, and the preferred connection parameters.
 */
static void gap_params_init(void)
{
    ret_code_t              err_code;
    ble_gap_conn_params_t   gap_conn_params;
    ble_gap_conn_sec_mode_t sec_mode;

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

    err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)DEVICE_NAME,
                                          strlen(DEVICE_NAME));
    APP_ERROR_CHECK(err_code);

    memset(&gap_conn_params, 0, sizeof(gap_conn_params));

    gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    APP_ERROR_CHECK(err_code);
}

What made me sure its some kind of misconfiguration is if i remove the sd_ble_gap_ppcp_set at the end of the function, i start to get the error back in the sd_ble_gap_device_name_set.

So put it simple:

  1. sd_ble_gap_device_name_set at line 475
  2. sd_ble_gap_ppcp_set  at line 487
  3. I get an error 0x7 at sd_ble_gap_ppcp_set 
  4. i remove the call of sd_ble_gap_ppcp_set  at 487
  5. sd_ble_gap_device_name_set start to return error 0x7

Yes i tried any combination for parameters to the sd_ble_gap_device_name_set AND sd_ble_gap_device_name_set.

Yes i tried calling nothing but those functions alone, i get the same error.

Additional info:

Memmory Segment: FLASH1 RX 0x0 0x30000;RAM1 RWX 0x20000000 0x5FFF
Preprocessor:

APP_TIMER_V2
APP_TIMER_V2_RTC1_ENABLED
BOARD_PCA10040
CONFIG_GPIO_AS_PINRESET
FLOAT_ABI_SOFT
INITIALIZE_USER_SECTIONS
NO_VTOR_CONFIG
NRF52810_XXAA
NRF52_PAN_74
NRF_SD_BLE_API_VERSION=4
S112
SOFTDEVICE_PRESENT

Section placement macro:

FLASH_PH_START=0x0
FLASH_PH_SIZE=0x30000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x6000
FLASH_START=0x19000
FLASH_SIZE=0x17000
RAM_START=0x200026a0
RAM_SIZE=0x3960

Follows my sdk_config.h

https://pastebin.com/u5PAuc87

Andd maybe its something hardware related? Here's the circuit:

(No extra components, just wires to connected directly on the gpio to read buttons and turn on LED's)

Parents
  • Hi

    I saw that you had created a second case right after replying to your previous one. Since this one is a bit more in detail, we can continue the discussion here. As I said, I was not able to reproduce this on an nRF52DK. I have now tested it on nRF52810 HW as well, where the only change I made to the pca10040e example was to  remove the DEVELOP_IN_NRF52832 and NRFX_COREDEP_DELAY_US_LOOP_CYCLES defines from the compile flags in SES, and the ble_app_blinky project works as expected there as well.

    Since the error pops up in different places, can it be that you have changed something in the example that you didn't realize. Can you try with a fresh version of the SDK and only change the compile flags as recommended? Can you also link to the datasheet of the module? Because the one I found (here) showed that the external LF crystal was included in the module, but from the screenshot here, that does not seem to be the case. If so you need to set the following defines to these values to use the internal RC oscillator instead.

    #define NRF_SDH_CLOCK_LF_SRC 0
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #define NRF_SDH_CLOCK_LF_ACCURACY 1

    Best regards,

    Simon

  • Okay, its everything working as intended. I belive i really should say whats been done.

    I decided to take another approach. Got a machine with ubuntu, installed the very same setup and got the same errors. 
    Segger IDE 6.30 and SDK 17.0
    Tried swapping the compiler... nothing seems to work without major changes in the codebase.

    Then i decided to wipe the Segger IDE 6.3 install  the 5.70a version.
    Everything worked as intended.

    It seems the last version of ses have some incompatibilities with the nrf5 sdk.

    So yeah, just downgrading the version i got all examples to work without issues.

  • Best guess: Change

    NRF_SD_BLE_API_VERSION=4

    to:

    NRF_SD_BLE_API_VERSION=7

Reply Children
Related