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

S130 can't be a central and Peripheral at the same time

As a peripheral,S130 can work ok,but when I add a central role, there is a error at central start to connect a peripheral.err_code = sd_ble_gap_connect(&addr,&m_scan_param,&m_connection_param); APP_ERROR_CHECK(err_code);here,err_code=0x00000005,the return value is out of the legal returns.I don't know what happen. whether is the m_scan_param or the m_connection_param value wrong?

  • The headline is incorrect. The S130 indeed can handle both GAP Central and Peripheral roles at the same time and several nRF5 SDK examples show it. It's your FW which is buggy.

    From very little you shared it's impossible to help you. Please identify which exact HW do you use, which SD version, which nRF5/nRF51 SDK version, what example project you started from and also go back in your project history to be as close as possible to the example (ideally to the moment when all major features worked as expected). Then we can do something together. Otherwise your question is as effective as screaming from the window.

  • I used NRF51822FFAC,SD is S130 V1.0,SDK is 9.0,example is ble_app_hrs_rscs_relay.I used the S130 as a central and peripheral before,but the connection between central and other peripheral offen breaks,and the connection never release as a slaver role.The gap connect param as a central is #define MARSTER_MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(200, UNIT_1_25_MS) /**< Determines minimum connection interval in millisecond 1.25 ms units. 200=250ms*/ #define MARSTER_MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(360, UNIT_1_25_MS) /**< Determines maximum connection interval in millisecond 1.25 ms units. 360=450ms*/ #define MARSTER_SLAVE_LATENCY 0 /**< Determines slave latency in counts of connection events. */ #define MARSTER_SUPERVISION_TIMEOUT MSEC_TO_UNITS(400, UNIT_10_MS) /**< Determines supervision time-out in units of 10 millisecond.4000ms */

  • The connect param as a slave is`#define SLAVER_MIN_CONN_INTERVAL MSEC_TO_UNITS(125, UNIT_1_25_MS) /< Minimum acceptable connection interval (150ms). */ #define SLAVER_MAX_CONN_INTERVAL MSEC_TO_UNITS(188, UNIT_1_25_MS) /< Maximum acceptable connection interval (235ms). / #define SLAVER_SLAVE_LATENCY 0 /< Slave latency. */ #define SLAVER_CONN_SUP_TIMEOUT MSEC_TO_UNITS(600, UNIT_10_MS) /< Connection supervisory timeout (6 seconds)/

    The scan param is: #define MARSTER_SCAN_INTERVAL 560 /< Determines scan interval in units of 0.625 millisecond. //350ms */ #define MARSTER_SCAN_WINDOW 80 /< Determines scan window in units of 0.625 millisecond. //50ms */ when remove the central role ,the slaver role can work well. `

  • Do you want to say that "ble_app_hrs_rscs_relay" example in nRF51 SDK on nRF51 DK with S130 V1.0.0 doesn't work? That sound weird because I expect Nordic application engineers to test it before release. So if you are able to make that work with 3 other boards (or does it work with phone app in the up-stream?) then I stay by my claim that you killed the functionality in some of your modifications.

  • Maybe.But in the example,before modify,the program can't work stability.

Related