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

Using nRF52 as slave 'device'

Hi.

I am developing PCB where there is a Wifi module ESP32-WROOM and a nRF52833 connected via 2-wire UART interface (TX/RX only), there is no way to use 4-wire UART because there is no enough pins at ESP32-WROOM.

Is there a way to use the ESP32 as a master device and the nRF52833 as a slave device? The nRF would be commanded by ESP32, but I suppose that for this I need to implement a protocol between them over the UART, in order the BLE configurations and functions of the nRF, from basic to advanced, could be controlled by the ESP32 module. Maybe there is ready some firmware for nRF52 to make it work this way? What is a good method to implement what I need? Something like the nRF52 be commanded via AT commands or something similar, some protocol. And if I need to implement an own protocol, what are all the things that should be covered?

Remembering that we want to use the Direction Finding capability of nRF52833

Regards.

  • I don't have any experience with the direction finding project, but I would have looked at the lpuart example project to get started with implementing UART communication:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/peripheral/lpuart/README.html

    The lpuart can be used as reference on how to use UART, however you are only using 2 pins (RX/TX) so you will not be able to achieve any low power operation here, instead the UART must be kept in RX continously in case the ESP have data to send. So simply connect the request pin to fixed level should keep the UART active.

    That said, you still would need to figure out how to / and which commands you want to trigger on the nRF52833, and the data format either way. Have in mind that data might be corrupted on UART interface (very small chance, but should still be considering), so you should likely have some timeout on every command, such that if there is no data in reverse direction in for instance 10ms then resend the command. Typically a command can consist of a fixed start byte, length, data, checksum. By using your own developed commands, you are much more free in terms of minimizing the amount of data that is sent between the ESP and nRF52833, and can focus on the actual data you are interested in sharing between the two. Unfortunately I am not aware of any ready made example or protocol for the serial communication in this case.

    Best regards,
    Kenneth

  • Hi. There is no need for low power operation in this project.

    So I need to connect one GPIO of nRF52833 to GND and configure this pin (input at the 833) as the lpuart CTS signal in order the uart be always active? And also configure one GPIO of nRF52833 as RTS signal (output) and keep it level low?

    2-pin UART is not possible? (TX/RX only?)

    And one problem of implementing an own protocol would be a possible need to update the nRF firmware in field if something is missing, so I think a UART bootloader in the 833 would be ideal, is there an official bootloader from Nordic that could be used for the nRF52833?

    Regards.

Related