nrf5340 is unable to trigger rpmsg(ipc) transfer

Hi,

I have quite demanding SPI device which should send its data over BLE.
Thanks to throughput example i was able to achieve maximum transfer speeds for synthetic tests (without SPI).
Sadly after adding real data input, I noticed that no transfer is executed until I finish my commands. 

Thanks to SystemView I was able to narrow this problem to one part of configuration -> rpmsg.

flow

Colors:

Green -> spi thread
Yellow -> bt_hci thread
Orange -> ble host TX
Red (small squere in top) - IRQ 58 from probably ipc, but i wasnt able to find it in manual (not listed)
Blue - probably openAmp mailing work queue thread
purple - systemwork queue

SystemView Data Log
4010.BleProblem.dat

Here is repo with configs etc.
https://github.com/DuMaM/bitly_nrf5x

Parents
  • Hello,

    I am not sure I understand the question? What are you seeing, and how do you expect it to work?

    I noticed that no transfer is executed until I finish my commands. 

    What sort of commands are you talking about here?

    BR,
    Edvin

  •   Thanks for response, and sorry to not be clear enough. 

    This is what i'm doing here:
    -> I have ads129x communication over SPI. It's set to work in continuous mode, so every n seconds it sends data packet (24bytes). To notify that we should get them it pulls up DATA_READY pin. I detect this in ISR callback and via semaphore i'm notifying SPI thread to read data. (GREEN part in picture)
    -> after SPI read this it send that data via pipe to other thread which is packing up data for BLE transfer, every time i get 251 bytes in this thread I'm sending this with `bt_gatt_write_without_response`. (YELLOW part in picture)

    The question is:
    why it takes so long rpmsg to start transmit data and why there are so big delays between each frame. (BLUE part in picture)

  • A Bluetooth Low Energy device can only communicate with the connected device every connection interval.

    In fact, it is a bit more complicated than that. A BLE connection has something called a connection interval. Every connection interval there is a connection event. This event is not initializing a connection, but the connection event is the event that occurs every connection interval, where the two devices are able to communicate.

    In the start of a connection event, the devices can start sending messages. When both devices are done, and don't have any more data, they will turn off their radios and go to sleep (hence Bluetooth Low Power). So even if you wanted to send data immediately after that, the receiving device would not have the radio turned on, and it wouldn't hear it. Therefore they must wait up to one connection intrval, until the next connection event occurs before they can send any more data. 

    Best regards,

    Edvin

Reply
  • A Bluetooth Low Energy device can only communicate with the connected device every connection interval.

    In fact, it is a bit more complicated than that. A BLE connection has something called a connection interval. Every connection interval there is a connection event. This event is not initializing a connection, but the connection event is the event that occurs every connection interval, where the two devices are able to communicate.

    In the start of a connection event, the devices can start sending messages. When both devices are done, and don't have any more data, they will turn off their radios and go to sleep (hence Bluetooth Low Power). So even if you wanted to send data immediately after that, the receiving device would not have the radio turned on, and it wouldn't hear it. Therefore they must wait up to one connection intrval, until the next connection event occurs before they can send any more data. 

    Best regards,

    Edvin

Children
No Data
Related