Dear Sirs,
How to advertise with nRF52810 (peripheral mode) in order to be seen by BT4 devices (Smartphones)?
Is it necessary to make a special configuration (settings)? If yes, where can I find an example?
I try to use
Dear Sirs,
How to advertise with nRF52810 (peripheral mode) in order to be seen by BT4 devices (Smartphones)?
Is it necessary to make a special configuration (settings)? If yes, where can I find an example?
I try to use
Thank you very much for your reply.
Unfortunately, your SDK examples are very complex and hard to understand, using event handlers, LEDS, buttons etc.
On my PCB board I have not LEDS and buttons.
I have already tried with your SDK example, I have even began with it, but I could not understand it.
It is my reason to ask you a simpler one.
It MUST work on my custom board, not on your proprietary board...
I need a an example of advertising with a minimum initialization and without communication (no services), not depending of hardware.
Is it possible?
Cordially yours
Andre
Again, our tutorials is a good starting point for understanding how to use the Softdevice.
A custom board would require a new board file that maps the pins accordingly to your custom board. More info can found here.
Dear Jared,
I really do not understand your position.
Two times I asked you for simpler example. I KNOW and USE your current SDK examples.
Before ask you anything, I had already read your tutorials. Several times, but could not deeply understand them.
Or they are not good, or I am an imbecile...
I use custom board without LEDS and buttons, so your example from SDK is not adapted at all for me....
However, I try to use your SDK example, but I get run time errors.
Even if your example works with your board, it seems to bee very problematic with the custom board because of missing of LEDS, buttons and its event handlers.
In general, your examples use too much functionalities at the same time, so they are too hard to understand.
I repeat, I need a SIMPLE example of advertisement, without any communication, witout LED & button usage.
So, could you help me or not?
Could you have a look on my code?
BTW, what is happened with my code I had added to my post yesterday?
I will add it once more...
Cordially
Andre
My initialization sequence:
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
//conn_params_init();
// Start execution
advertising_start();
for (;;); // debug break
Unfortunately the conn_params_init() function gives an error (value 3, internal error).
I do not know what it means.
Is it possible to start advertisement without this initialization?
This function is copied from your SDK example, only with light modification of error management (no LEDS but UART)
/**@brief Function for initializing the Connection Parameters module.
*/
static void conn_params_init(void)
{
printf("nRF52: conn_params_init\r\n");
nrf_delay_ms(200);
ret_code_t err_code;
ble_conn_params_init_t cp_init;
memset(&cp_init, 0, sizeof(cp_init));
cp_init.p_conn_params = NULL;
cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY;
cp_init.max_conn_params_update_count = MAX_CONN_PARAMS_UPDATE_COUNT;
cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;
cp_init.disconnect_on_fail = false;
cp_init.evt_handler = on_conn_params_evt;
cp_init.error_handler = conn_params_error_handler;
err_code = ble_conn_params_init(&cp_init);
//APP_ERROR_CHECK(err_code);
if (err_code!=NRF_SUCCESS)
{
printf("nRF52: conn_params_init ERROR %d\r\n", err_code);
nrf_delay_ms(200);
return;
}
printf("nRF52: conn_params_init done\r\n");
nrf_delay_ms(200);
}
What is happened with my code I had added to my post yesterday?
I will add it once more...
Unfortunately, your SDK examples are very complex
Unfortunately, Bluetooth is not simple!
https://devzone.nordicsemi.com/f/nordic-q-a/42551/nrfgo-studio-dont-detect-my-nrf52840/165776#165776
It MUST work on my custom board, not on your proprietary board...
I would strongly recommend that you start on a Nordic board - it will be far easier to learn and gain familiarity & understanding in that way.
Once you have gained sufficient familiarity & understanding, then you will be in a position to move on to a custom board.
This is exactly why all manufacturers - not just Nordic - make development/evaluation/demo boards!
Unfortunately, your SDK examples are very complex
Unfortunately, Bluetooth is not simple!
https://devzone.nordicsemi.com/f/nordic-q-a/42551/nrfgo-studio-dont-detect-my-nrf52840/165776#165776
It MUST work on my custom board, not on your proprietary board...
I would strongly recommend that you start on a Nordic board - it will be far easier to learn and gain familiarity & understanding in that way.
Once you have gained sufficient familiarity & understanding, then you will be in a position to move on to a custom board.
This is exactly why all manufacturers - not just Nordic - make development/evaluation/demo boards!
I can only repeat my post I sent to Jared...
I understand the necessity of your demo board, I used it for my first codes a year ago.
Now I have the pre-manufacturing prototype board (without LEDS, without buttons), so how to make working your SDK example on this board?
I have never said, that your example does not work on your demo board!!!
I really do not understand your position.
Two times I asked you for a simpler example. Nothing more...
I KNOW and USE your current SDK examples.
Before ask you anything, I had already read your tutorials. Several times, but could not deeply understand them. Or they are not good, or I am an imbecile...
I use custom board without LEDS and buttons, so your example from SDK is not quite adapted for me.... However, I try to use your SDK example, but I get run time errors.
Even if your example works with your board, it seems to bee very problematic with the custom board because of missing of LEDS, buttons and its event handlers.
In general, your examples use too much functionalities at the same time, so they are too hard to understand.
I repeat, I need a SIMPLE example of advertisement, without any communication, without LED & button usage.
So, could you help me or not?
Could you have a look on my code?
Cordially
Andre
My initialization sequence:
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
//conn_params_init();
// Start execution
advertising_start();
for (;;); // debug break
Unfortunately the conn_params_init() function gives an error (value 3, internal error).
I do not know what it means.
Is it possible to start advertisement without this initialization?
This function is copied from your SDK example, only with light modification of error management (no LEDS but UART)
/**@brief Function for initializing the Connection Parameters module.
*/
static void conn_params_init(void)
{
printf("nRF52: conn_params_init\r\n");
nrf_delay_ms(200);
ret_code_t err_code;
ble_conn_params_init_t cp_init;
memset(&cp_init, 0, sizeof(cp_init));
cp_init.p_conn_params = NULL;
cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY;
cp_init.max_conn_params_update_count = MAX_CONN_PARAMS_UPDATE_COUNT;
cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;
cp_init.disconnect_on_fail = false;
cp_init.evt_handler = on_conn_params_evt;
cp_init.error_handler = conn_params_error_handler;
err_code = ble_conn_params_init(&cp_init);
//APP_ERROR_CHECK(err_code);
if (err_code!=NRF_SUCCESS)
{
printf("nRF52: conn_params_init ERROR %d\r\n", err_code);
nrf_delay_ms(200);
return;
}
printf("nRF52: conn_params_init done\r\n");
nrf_delay_ms(200);
}
Event handlers are necessary to receive events from the Softdevice. You can't use it without them. If you don't want to modify the board file you can just remove every reference to it in the main file. It should work without it. 0x03 returned from the ble_conn_params_init() is NRF_ERROR_INTERNAL, which may indicate that the bug is before the function call. ble_conn_params_init() is necessary first once you connect to the central.
Dear Jared,
Thank you very much for your reply.
I am simply trying to strip unnecessary code.
My board works (advertises) well, and I use, of course, my custom board file, but without LEDS and GPIOS used by your examples...
I was talking about GPIO event handler, not about event handlers in general...
It seems, I have to use services_init() function before advertising, I do not understand why (I do not use any service). Otherwise I get run time error from also from advertising_init function.
Maybe I am wrong, I will check it once more...
Concerning error, I have copied all initialization functions from your example, so I do not understand the bug...
However, I have removed conn_params_init(), since I do not need the connection at this moment.
I would like simply to know, when such error occurs (if I plan to use connection in future).
Cordially yours
Andre
Hi,
Jared
All your examples use LED/button interface, it was a main reason I asked you for a simpler one...
Really, is it impossible for you to give a simple example with a minimum code (without LEDS & buttons handlers) ?
The error 03 (internal error) is from ble_conn_params_init(). Fortunately I do not need it, for instant...
Could you confirm that the following code sequence is sufficient for advertising?
The functions are from https://github.com/NordicPlayground/nrf51-ble-tutorial-advertising/blob/master/nrf52-ble-tutorial-advertising/main.c
ble_stack_init();
gap_params_init();
gatt_init();
advertising_init();
// Start execution
advertising_start();
Cordially
Andre