Skip to main content
mkuma.1
Associate II
December 19, 2020
Question

St ble NRG2 (BLUENRG-M2SP) : reading the characteristic issue : hi Every one i using BLUENRG-M2SP chip , i using st ble sensor app to communicate the chip , the problem statement , AS below

  • December 19, 2020
  • 4 replies
  • 2231 views

1. if i read and write  characteristic in the service  its working fine

  1. if write one characteristic and read on other characteristic of same service , its not working . after that its not able to reconnect , during this scenario i need to restart ble chip , can you any one please help me out to solve the issue .
  2. if any flow diagram or any command sequence in this situation , can you share us .

Regards

Manukumar

    This topic has been closed for replies.

    4 replies

    Winfred LU
    ST Employee
    December 21, 2020

    BLE Sensor Demo project was tested? I am not aware of a command sequence for this demo.

    mkuma.1
    mkuma.1Author
    Associate II
    December 21, 2020

    I tested BLE Sensor Demo project , To test Demo project i Used STEVAL -IDB008V1M board (BLUE NRG2M2SA) chip its working fine, but in our custom board we are using blue NRG2 M2SP chip , here facing above issue

    mkuma.1
    mkuma.1Author
    Associate II
    December 21, 2020

    here i using following command Sequence

    void Read_Request_CB(uint16_t handle)

    {

     if(handle == (Unithandle + 0x100))

     {

      

       

      BLE_LOAD_WIND_UNIT_READ('A');

      

     }

     if((connection_handle !=0) )

     {

        __asm nop;__asm nop;__asm nop;

       __asm nop;__asm nop;__asm nop;

       __asm nop;__asm nop;__asm nop;

      ret = aci_gatt_allow_read(connection_handle);

      if (ret != BLE_STATUS_SUCCESS)

      {

       __asm nop;__asm nop;__asm nop;

       __asm nop;__asm nop;__asm nop;

       __asm nop;__asm nop;__asm nop;

       __asm nop;__asm nop;__asm nop;

      }

       

       

     }

    void Attribute_Modified_CB(uint16_t handle, uint8_t data_length, uint8_t *att_data)

    {

     unsigned int i=0;

     if(handle == Unithandle + 0x100)

     {

      for(i = 0; i < GS820_LOAD_WIND_UNIT_CHAR_LENGTH_READ_WRITE; i++)

      {

      Data_Recived_Mobile_App[i]= *att_data;

      ++att_data;

      }}

    }

    tBleStatus BLE_LOAD_WIND_UNIT_READ( unsigned char Index)

    {

       tBleStatus ret;

       

        Gs820Unit_Charcterstic();

       

       

       ret = aci_gatt_update_char_value_ext(connection_handle, ConfigSerhandle, Unithandle, 1, GS820_LOAD_WIND_UNIT_CHAR_LENGTH_READ_WRITE, 0, GS820_LOAD_WIND_UNIT_CHAR_LENGTH_READ_WRITE,(uint8_t*)&Gprotocol_Read_Buff[0]);

        if (ret != BLE_STATUS_SUCCESS)

     {

      //PRINTF("Error while updating Humidity characteristic.\n") ;

      return BLE_STATUS_ERROR ;

     }

     return BLE_STATUS_SUCCESS;

    }

    }

    void aci_gatt_read_permit_req_event(uint16_t Connection_Handle,

                      uint16_t Attribute_Handle,

                      uint16_t Offset)

    {

     Read_Request_CB(Attribute_Handle);   

    }

     void aci_gatt_attribute_modified_event(uint16_t Connection_Handle,

                        uint16_t Attr_Handle,

                        uint16_t Offset,

                        uint16_t Attr_Data_Length,

                        uint8_t Attr_Data[])

    {

     Attribute_Modified_CB(Attr_Handle, Attr_Data_Length, Attr_Data);    

    mkuma.1
    mkuma.1Author
    Associate II
    December 21, 2020

    Hi Winfred

    i verified both hardware and software its same . Can you please Share the any documents , its give the information on ble Diagnostic check (like if Error command Sent in between ble communication , how ble Behaviour and how we can bring the normal State , or if we missed any command how we can retry ) . its help me lot to resolve this issue , or if any link its give information on above problem .

    Regards

    Manukumar

    Winfred LU
    ST Employee
    December 22, 2020

    >i verified both hardware and software its same

    OK then, maybe the procedures or environment of testing were different?

    Documents for ACIs (including ACI commands and events) can be found under BlueNRG GUI folder, by default at

    C:\Users\<user id>\ST\BlueNRG GUI 4.0.0\Docs\gui_aci_html\bluenrg_1_v2_x.html

    PM0257 BlueNRG-1, BlueNRG-2 BLE stack v2.x programming guidelines

    would also be a good reference

    mkuma.1
    mkuma.1Author
    Associate II
    December 22, 2020

    hi Winfred i found the issue , the issue lied on below st library function i.e list .c

    int list_get_size (tListNode * listHead)

    {

     int size = 0;

     tListNode * temp = listHead->next;

     while (temp != listHead)

     {

      size++;

      temp = temp->next;

     }

     return (size);

    in this case software is hanging , its not coming out of loop , in this case , i check if uart line receive any junk data , its also not receive any junk data . if you have any suggestion on this .

    Tesla DeLorean
    Guru
    December 22, 2020

    You'll need to figure out why the linked list is broken or circular.

    Check you have heap space, and check list integrity periodically to narrow down when failure occurs.

    Check if you have thread safe implementation, and that use in interrupts or callbacks creates race conditions.​

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..