Arm Mbed OS support forum

Possible/How to use a different Ethernet Phy in customized PCB than Mbed reference board?


As title indicated, I am wondering if we can use a different Ethernet Phy in customized PCB. We have a board that was developed around STM32F407VE, with Ethernet Phy IC DP83848C as the one used by Arch_Max board.

Is it possible to replace STM32F407VE with STM32F437VE? Mostly for TRNG which STM32F407 doesn’t have and also for more RAM which will be needed when working with TLS. u-blox C030-R412M board uses STM32F37 but uses a different Ethernet Phy. It will be ideal if we can just replace the MCU then build a derivative of u-blox C030-R412M .

Please advise. Thanks.

Looks like the Ethernet config for that board can be found here: mbed-os/features/netsocket/emac-drivers/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C030 at 5.15.2 · ARMmbed/mbed-os · GitHub

I can’t seem to dig up what Ethernet PHY is on the C030 board (U-Blox doesn’t provide a schematic?!?) , but importing this code into a custom target would probably be a good start.

Hello Li,

Another alternative is to use an Ethernet Phy equipped with SPI interface rather than RMII. In contrary to RMII an SPI controller is available on almost any Mbed board (custom boards included) and it requires less number of signals to connect the Phy to the MCU.
You can find an Mbed EMAC-driver for the ENC28J60 Phy here. The actual SPI pins used in your program for the given (official or custom) target shall be specified in a mbed_app.json file.
For example like:

        "target_overrides": {
            "*": {
                "platform.callback-nontrivial": true,
                "enc28j60-emac.mosi":  "D11",
                "enc28j60-emac.miso":  "D12",
                "enc28j60-emac.sck" :  "D13",
                "enc28j60-emac.cs"  :  "D10"

Since the ENC28J60 Phy doesn’t provide any MAC address by default one shall be specified in your program.

For example:

    const uint8_t       MAC[6] = { 0, 1, 2, 3, 4, 5 };
    EthernetInterface   net;


int main()
        net.get_emac().set_hwaddr(MAC);             // set MAC address

Since there are no other differences the rest of your program can be the same as when using an RMII Phy.

However, please notice that the ENC28J60 Phy supports only 10 mbps speed (100 mbps is not available).

1 Like

C030 uses KSZ8091RNACA. The link to schematic is not obvious.

This is actually a good idea. The only downside is ENC28J60 is only 10M, but that is more than enough for most applications.