"atsamv" BSP legacy network driver status

Christian Mauderer christian.mauderer at embedded-brains.de
Tue Jan 28 09:46:46 UTC 2020


Hello Peter,

On 27/01/2020 22:10, Peter Dufault wrote:
> The "rtems-libbsd" "if_atsam.c" driver is derived from the legacy one.

Correct.

>  What's the status of the two drivers?  I ask because I'm trying to do some small memory testing with the legacy stack on the .  It is building but not working, I don't think network packets are going out even though the build is definitely receiving broadcast packets because I see the number of incoming receive interrupts increasing.

The last one I tried is the one in rtems-libbsd in commit
c1e05b9ea378b2971e3d7704779112b4bc4296da on the 5-freebsd-12 branch.
That one worked and is used by some of our customers. Since then nothing
changed at that driver (neither on master nor on the branch). So I would
expect that it still works.

It is a long time since I last tried the one inside the legacy stack.

> 
> My first attempts crashed because the attach function unconditionally de-referenced "config->hardware_address", most legacy drivers conditionalize the de-reference.  I modified the driver to do something similar to what the "libbsd" driver does.>
> After that everything appears to work except networking isn't working.  I put the system on its own little section of a managed switch and I don't see any packet activity.  The app is running a shell with "netstat" and I can see the count of receive interrupts going up.
> 
> Before I go much further I have a few questions.
> 
> - What's the usage of the "atsamv" driver?  I know there are issues associated with the external SRAM, clock speeds, and maybe clock references.  But is the legacy driver used, only the "libbsd" driver used, or neither?

Before our customers migrated to libbsd (to get some of the features
there) the driver in legacy worked. But that is a few years back.
Currently I only know of applications using the libbsd driver.

Best regards

Christian

> 
> Thanks -
> 
> Peter
> 
> 
> **** The diffs I made to the driver are:
> 
> diff --git a/bsps/arm/atsam/net/if_atsam.c b/bsps/arm/atsam/net/if_atsam.c
> index 9665aa1..5c84cdc 100644
> --- a/bsps/arm/atsam/net/if_atsam.c
> +++ b/bsps/arm/atsam/net/if_atsam.c
> @@ -1181,6 +1181,10 @@ static int if_atsam_driver_attach(struct rtems_bsdnet_ifconfig *config)
>         const if_atsam_config *conf = config->drv_ctrl;
>         int unitNumber;
>         char *unitName;
> +    /* This is sort of what the libbsd library does for the lack of a MAC address.
> +     * except the final byte is 0x11 + unit.
> +     */
> +    static const uint8_t mac_addr[] = { 0x0e, 0xb0, 0xba, 0x5e, 0xba, 0x11 /* + unit */ };
>  
>         if (conf != NULL) {
>                 sc->Gmac_inst.retries = conf->mdio_retries;
> @@ -1191,7 +1195,11 @@ static int if_atsam_driver_attach(struct rtems_bsdnet_ifconfig *config)
>         }
>  
>         /* The MAC address used */
> -       memcpy(sc->GMacAddress, config->hardware_address, ETHER_ADDR_LEN);
> +    if (config->hardware_address) {
> +        memcpy(sc->GMacAddress, config->hardware_address, ETHER_ADDR_LEN);
> +    } else {
> +        memcpy(sc->GMacAddress, mac_addr, ETHER_ADDR_LEN);
> +    }
>         memcpy(sc->arpcom.ac_enaddr, sc->GMacAddress, ETHER_ADDR_LEN);
>  
>         /*
> 
> 
> 
> *** Configuration command is:
> 
> ../rtems/configure \
>     --target=arm-rtems5 \
>     --enable-rtemsbsp=atsamv \
>     --prefix=/opt/customer/rtems-5/ \
>     --enable-networking \
>     --enable-posix \
>     --disable-smp \
>     --disable-multiprocessing \
>     --enable-tests \
>     --enable-cxx \
>     --enable-maintainer-mode
> 
>  
> Peter
> -----------------
> Peter Dufault
> HD Associates, Inc.      Software and System Engineering
> 
> This email is delivered through the public internet using protocols subject to interception and tampering.
> 
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
> 

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list