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

NRF52 ble_app_uart example Android getting wrong data

Hi,

nrf52 using  from ble-peripheral->  ble_app_uart examle

In that ble_app_uart example receive the data from the android is ok.

But,i want transmit array type of data to Android using ble_nus_data_send. In that android side, we receive wrong data.

Kindly give the solution.

For Example,

uint8_t string1[10]={9,10,12,13,14,15,16,17,18,19};

uint8_t length =10;

err_code = ble_nus_data_send(&m_nus, string1, &length, m_conn_handle);

Output:

In the Android receives - > ^I^J^^L^M^N^O^P^Q^R^S

Parents Reply Children
  • hi,

    i need example program for magnetic sensor (TLV493) interface using i2c.

    intialize process ok. after that, try to read data i can't get actual data.

    it shows the error ERROR 33281 [NRF_ERROR_DRV_TWI_ERR_ANACK].

    Then,i disable the "APP_ERROR_CHECK(err_code);" function after it doesn't show that error.

    it will communicate sometime only. Continuous read operation i have not receive the data.

    reagrds

    senthilkumar

  • Hello senthilkumar,

    Ask313 said:
    Then,i disable the "APP_ERROR_CHECK(err_code);" function after it doesn't show that error.

    By doing this you have only removed the symptom of the error, not the underlying cause.
    NRF_ERROR_DRV_TWI_ERR_ANACK error is caused by the slave not acknowledging the targeted address.
    Could you attempt to run the TWI Sensor example, to see if you may find the address?
    There could be many reasons for the slave not acknowledging the address, but a common pitfall is an erroneous hardware connection. Do you have access to a logic analyzer?

    Best regards,
    Karl

  • Hi,

    Thanks for your reply.

    i have test with TWI Scanner example, i got the below address details.

     address is correct. 

    <info> app: TWI scanner started.
    <info> app: TWI device detected at address 0x5E.

    In that project, we are using two i2c

    1. TLV493 - SCL- 29, SDA - 30

    2. EEPROM - SCL- 7 SDA- 6 

    i have  tested EEPROM separately its working fine.

    now, i only try to interface TLV493 magnetic sensor.

    once i will check the program and update will soon.

    if you have TLV493 magnetic sensor related example, kindly share with us.

    Regards,

    Senthilkumar

     

  • Hello Senthilkumar,

    This issue is no longer connected to your original ticket, and it would be better to post it as a separate ticket to keep the forum tidy.
    If you still require more help with the TWI communication with your TLV493 sensor after this reply, then please open a new ticket for that separate matter.

    Ask313 said:

    1. TLV493 - SCL- 29, SDA - 30

    2. EEPROM - SCL- 7 SDA- 6 



    Please check the Pin Assignment before assigning pins to your peripherals. As you can see, pin 30 is used for the Antenna.
    When it comes to using the pins on your nRF-52 DK I recommend taking a look a the Connector Interface documentation.

    Ask313 said:
    if you have TLV493 magnetic sensor related example, kindly share with us.

    I do not have such an example at the ready, but I am sure a driver for the sensors TWI interface already exists publicly available.
    I do not know if this is the sensor module you have, but a brief search on github yielded this repository, which might be helpful to have a look at.
    If this is not the sensor module you currently have, then I would suggest finding or implementing a driver based on the TWI interface described in its datasheet.

    Best regards,
    Karl

Related