This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Communication on CC2541 with serial BLE_Bridge

Other Parts Discussed in Thread: CC2540

Hello,

I have CC2541EM with BLE_Bridge firmware connected to smartRF05 that is connected via RS232 to PC. There is also CC2540 usb dongle with that I want to communicate using Btool. When I send some data to CC2541EM trough UART then it works and I can read these data as UUID FF:F4 in Btool. The problem is how to send something using Btool to CC2541EM and read it through UART.

Thanks for any help.

Best regards

Jan

  • Hello. The bridge is bi-directional. From the wiki...

    This project also includes the capability to forward received GATT data to the host MCU via UART / SPI. This was accomplished by modifying the simpleGATTprofile which is used in the simpleBLEperipheral project: simple Profile Characteristic 3 is now a 20-byte writeable characteristic. simpleProfileChangeCB() in the application code is called when this characteristic is written to which in turn will call sendDataToHost() to send the received data serially to the host. Data written over-the-air to this characteristic must be of the following format: one "length" followed by "length" data bytes. The serial data transmitted to the host MCU will be of the format "AB" "AD" "LEN" "data[0]" "data[1]" ... "data[LEN]"

  • That is what I expected how it works, but it doesnt work like this in my case. When I try to write more than 1 byte in Btool, it gives me status "INVALID_SIZE". If i put there only one byte, for example "03" then it send data to MCU but they looks like this: AB AD 00 00 12. Do you know where can be the problem?

    Thanks
    Jan
  • It looks like the project is using the standard simpleGATTprofile.c/.h instead of simpleGATTprofile_Bridge.c /.h. This should be the only change you need to make. I'll try to test this and upload a modified project tomorrow.
  • Yes, in file BLE_bridge.c is included simpleGATTprofile.c, not simpleGATTprofile_Bridge.c so can you please upload simpleGATTprofile_Bridge.c or project where it is correctly?

    Thank you
    Jan

  • Hello Jan. The wiki page and patch have been updated accordingly. Let me know if there are any issues.
  • Thank you so much, it works now.

    Best regards,
    Jan