Help using a co-processor for Ethernet transport of Zephyr sockets

Hi,

I'm using an nRF52840 on a custom board with nCS 2.0.0.

The board I'm working with has a serial connection to a PIC that has Ethernet, so I'm trying to use that as my physical Ethernet transport layer.

I am in control of the PIC code, too, so the protocol can be whatever it needs to be. So far I've written a simple SPI protocol so that I can tell it to open a TCP connection to a remote site and send and receive data - but I've realized that in order to do TLS I'm going to have to use Zephyr's socket capabilities.

Some questions:

1) Is there an API document or an example that might help me figure out how to get Zephyr to use my low level transport calls and what I need to make my functions do?

2) Do I need to figure out how to implement SLIP or is there another protocol people use for this kind of thing?

3) Maybe I just have to figure out how to implement every function in socket.h over my interface?

4) Has anyone done what I'm doing with a Nordic-to-PIC solution?

Thanks!

Glen

Parents
  • Hello Glen,

    1) Is there an API document or an example that might help me figure out how to get Zephyr to use my low level transport calls and what I need to make my functions do?

    Zephyr has several drivers for ethernet devices, among others the ENC424J600, but none for PIC it seems. Though you can try and follow what is being done in the drivers they do have.

    3) Maybe I just have to figure out how to implement every function in socket.h over my interface?

    Zephyr also has multiple socket samples that can demonstrate this for you.

    2) Do I need to figure out how to implement SLIP or is there another protocol people use for this kind of thing?

    Slip is implemented here.

    Otherwise, you could also do something like the SLM with AT commands. Or use OpenAMP or something similar to do inter-processor calls (a bit like our modem in the 9160).

    4) Has anyone done what I'm doing with a Nordic-to-PIC solution?

    Not that I am aware of, though there seems to be a few cases on PIC on devzone. So you might find some of your questions answered by searching around here.

    Regards,

    Elfving

  • Hi Elfving,

    Thanks for the quick reply. So our board actually has the Nordic, then the PIC, then an ENC424J600. I'm going to look through the schematics for that Phytec Ethernet board and see if I can just no-pop the PIC and wire the ENC424J600 straight to the Nordic part. That would be ideal if I can make that work - saves an entire processor plus a lot of firmware effort.

    I think at that point all I would need to do is figure out how to set up my devicetree file and add something to my kconfig or prj.conf that will pull in that ETH_ENC424J600 stuff.

Reply
  • Hi Elfving,

    Thanks for the quick reply. So our board actually has the Nordic, then the PIC, then an ENC424J600. I'm going to look through the schematics for that Phytec Ethernet board and see if I can just no-pop the PIC and wire the ENC424J600 straight to the Nordic part. That would be ideal if I can make that work - saves an entire processor plus a lot of firmware effort.

    I think at that point all I would need to do is figure out how to set up my devicetree file and add something to my kconfig or prj.conf that will pull in that ETH_ENC424J600 stuff.

Children
  • Yeah if you do not need the PIC for anything else then that does sound easier to me atleast.

    Glen M said:
    I think at that point all I would need to do is figure out how to set up my devicetree file and add something to my kconfig or prj.conf that will pull in that ETH_ENC424J600 stuff.

    That sounds like a plan. Have a look at the dts and config files that are added when using the ETH_ENC424J600 shield.

    -DSHIELD=link_board_eth

    You can simply add these, and modify them as you need to.

    Regards,

    Elfving

Related