This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_app_uart_c problem using a WT51822-S4AT board

Hi,
 
I have a couple of WT51822-S4AT boards I would like to use to send data from a PC to one board via UART and then pass the data to a microcontroller connected to the other board via its UART.
So: PC --> n51822 --> n51822 --> microcontroller.
 
I managed to get the ble_app_uart peripheral example working by changing the RX/TX pins and changing the flash layout and compiling for BOARD_WT51822 instead of for example BOARD_PCA10028.
 
Using the nRF toolbox app on my phone I can send data to that peripheral board.
 
But, now I would like to use the other board as a central and I can't seem to get it working. I get stuck in the sd_ble_gap_scan_start function which returns the error code 0x00000007 and then the device is reset.
Do you have any clue why I'm getting this error?
 
 
Thanks in advance,
Samuel
Parents
  • I can add that the working peripheral example has the following clock settings:

    In main header

    #if MODULE_WT
    #undef NRF_CLOCK_LFCLKSRC
    #define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_SYNTH, \
    .rc_ctiv = 0, \
    .rc_temp_ctiv = 0, \
    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
    #endif

    In ble_stack_init:

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

    // Initialize SoftDevice.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

    The central example looks a bit different. In ble_stack_init, the SDK example doesn't pass a struct to SOFTDEVICE_HANDLER but only a defined value as:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);

    When setting the clock source to NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, I get the error code 7 as I wrote earlier. 

    However, when setting the clock source to NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, I get the error code 0x1000.

Reply
  • I can add that the working peripheral example has the following clock settings:

    In main header

    #if MODULE_WT
    #undef NRF_CLOCK_LFCLKSRC
    #define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_SYNTH, \
    .rc_ctiv = 0, \
    .rc_temp_ctiv = 0, \
    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
    #endif

    In ble_stack_init:

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

    // Initialize SoftDevice.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

    The central example looks a bit different. In ble_stack_init, the SDK example doesn't pass a struct to SOFTDEVICE_HANDLER but only a defined value as:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);

    When setting the clock source to NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, I get the error code 7 as I wrote earlier. 

    However, when setting the clock source to NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, I get the error code 0x1000.

Children
No Data
Related