2023-05-04 08:06 AM
I'm using : the X-Nucleo-bnrg2A1
and I already tried to Flash my bluetooth with the examples on the firmware ST BLUENRG DK, especially the DTM. And tried the BLE_chat but I can't see the bluetooth in my phone using BLE Scanner.
2023-05-16 07:13 AM
Hello,
You should flash the BlueNRG-M2SP with BLE serial port from latest SDK BlueNRG-1_2 DK 3.2.3 available on st.com.
Of course, you should rebuilt BLE serial port example (server) with the proper pre processing option for M2SP (see DT0137).
Your BlueNRg-M2SP will then act as a BLE to UART bridge.
Regards
Laurent
2023-05-16 07:19 AM
Thank you so much Laurent for your answer,
I've already flashed my x-nucleo-bnrg2a1 with the serial_port example from the latest SDK, but I can see the bluenrg on my phone to communicate with the module, I tried with BLE scanner and nrF connect.
The 0 ohm resistors that I soldered on my x-nucleo-bnrg2a are R87, R86, R73
and removed the R76 to properly communicate using UART pins.
My board works correctly i tried the st bluenrg GUI and it works using USB to UART
The problem I'm having now is that I cannot connect to my phone using the bluenrg
Thank you in advance
Anas
2023-05-16 07:26 AM
Have you just flashed serial_port example or have you rebuilt the project to adpat it to M2SP as I wrote previously?
2023-05-17 06:23 AM
Hello, yes it works but i'm not able to receive more than 20 bytes data on my characteristic
Anas
2023-05-17 06:45 AM
Hi,
Good to read.
It should be logical as characteristic is defined with 20B.
Please keep in mind this is just a code example and you can adapt it (more characteristics or characteristic size)
Below is code showing 20 is defined.
ret = aci_gatt_add_char(SerialPortServHandle, UUID_TYPE_128, &char_uuid, 20, CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, 0,
16, 1, &TXCharHandle);
Regards
Laurent
2023-05-17 07:29 AM
thank you Laurent for your response, meanwhile I tried to modify the char_value_length which is 20 to 124 by doing this : ret = aci_gatt_add_char(SerialPortServHandle, UUID_TYPE_128, &char_uuid, 124, CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, 0,
16, 1, &TXCharHandle); but when I flash the bluenrg M2SP, I cannot see it anymore on my phone
Regards
Anas
2023-05-17 09:06 AM
Hello ,
You may also have to increase array size for attribute table (see below code from serialport_config.h
As can be seen here, we have a max of 80 defined for Rx and Tx size.
Increasing this value should allow you to increase characteristic size.
#define ATT_VALUE_ARRAY_SIZE (44 + 80 + OTA_ATT_VALUE_ARRAY_SIZE) //(GATT + GAP) = 44 + serial port (TX (41) + RX (39) characteristics) Services
Regards
Laurent
2023-05-22 02:53 AM
Hello,
Thank you for your response,
I increased the array size for attribute table by doing
#define ATT_VALUE_ARRAY_SIZE (44 + 496 + OTA_ATT_VALUE_ARRAY_SIZE) //(GATT + GAP) = 44 + serial port (TX (249) + RX (247) characteristics) Services
becasue I wan't to send 124B,
I can see again the Bluetooth device on the BLE Scanner, but meanwhile the read characteristic doesn't surpass 20B,
Regards,
Anas