I am working on a project an nRF52840DK + quectel BG96 modem. I am porting the freeRTOS cellular interface library for the Nordic platform and mainly the FreeRTOS-Plus-TCP library.
I would like to know if anyone has managed to port the FreeRTOS-Plus-TCP library to MCU nordic ( nRF5280 DK) especially the MAC Ethernet driver part, otherwise I tried to look for an ethernet driver for initialization of the ethernet MAC layer.
can you help me on how to port the freeRTOS-plus-tcp port to nRF52840DK,
I was following this support Porting TCP/IP Ethernet drivers to a different MCU, but I don’t know where I could find the ethernet drivers for nRF52840 to create a link with the network, it’s too vague for me.
Exactly, at first I started with a demo using ( FreeRTOS, FreeRTOS-Plus-TCP and FreeRTOS-Cellular-Interface on PC and tested it and it worked ) fine on PC, link below:
Then I wanted to integrate the project on a microcontroller and port the library to our Nordic nRF52840dk platform.
I did the porting and integrate the Cellular Interface Library with MCU platforms part for the hardware (USART driver) using support porting guide and afterwards I noticed that the project also uses the freertos-tcp library to manage the AT commands and that’s why I noticed that it is also necessary to port for our nRF52840DK MCU, usually I need a file networkInterface for our microcontroller.
Hi @ATYQ_1991,
Actually, BG96 handles TCP-IP stack internally, so it’s not necessary to port networkInterface/FreeRTOS-Plus-TCP. But you need to provide an interface for your application to use, you can refer to socket_wrapper and using_mbedtls.
Of course, you need to initialize BG96 properly at runtime, like setupCellular.
I looked at the communication part between the modem and the server and I see that the library uses the MQTT protocol with MbedTLS mutual authentication with an mqtt broker using cellular connectivity so in general it uses the TCP + MbedTLS .
For information I’m still on the windows version and it works well with BG96, and I got this project.
For information I use the nRF52840 kit and do not have an Ethernet port, I just have to interface the evaluation kit with modem via USART.
Is there a guide that can show the steps to port this project to an MCU like nRF52?
on the FreeRTOSConfig.h file in the project, I found remarks on macros but I didn’t really understand especially when I look for these macros in the project, I see that they are not used in the project, can you please enlighten me?
As I mentioned, BG96 handles TCP/IP stacks inside itself, so you don’t need to have it in your platform. You can try to trace the data flow starting from TLS_FreeRTOS_send. It doesn’t use FreeRTOS-Plus-TCP, it uses Sockets_Send in sockets_wrapper.c, which uses Cellular_SocketSend(FreeRTOS-Cellular-Interface) NOTFreeRTOS_send(FreeRTOS-Plus-TCP).