ATSAMV71 / ATSAMRH71 ethernet POC with RTEMS-LIBBSD

Christian MAUDERER christian.mauderer at embedded-brains.de
Thu Jun 27 13:35:53 UTC 2024


Hello Darius,



On 2024-06-27 13:31, Matthew J Fletcher wrote:
> Hi Darius,
> 
> The if_atsam driver is used extensively on industrial / custom ATSAME71 
> boards with external SDRAM with LibBSD. The reliability has been very 
> good, you can see in the LibBSD change log for if_atsam some changes a 
> couple of years back that resolved the last issues.
> 
> regards, Matthew.
> 
> 
> 
> On Thu, 27 Jun 2024, 05:22 Dariusz Sabała, <dariusz.sabala at creotech.pl 
> <mailto:dariusz.sabala at creotech.pl>> wrote:
> 
>     Hi
> 
>     I am working on RTEMS LibBSD Ethernet networking POC on ATSAMV71 and
>     on ATSAMRH71

Please note that the SAMRH71 and the SAMV71 are two quite different 
chips with different peripherals (like a different SDRAM controller). 
The V71 (and family) is a bit buggy (see notes below). But I don't think 
that you will see any of the problems of the V71 on the RH71. But at the 
moment, there is no public BSP for the RH71 in the repositories.

> 
>     My tries on ATSAMV71 were limited due to very small amount of SDRAM
>     memory on evaluation board - its only 2MB.
> 

On the ATSAMV71 (and similar ones like the SAME70), you can only really 
use libBSD with an external SDRAM. If you create a really small 
configuration, you might can use libBSD with 4MB of RAM. But I would 
recommend planning at least 16MB if you build a new hardware. For 
smaller systems, you should consider lwIP. I'm not sure whether we have 
a driver for the SAMV71 for that.

We had that atsamv BSP running on an SAMV71XPlained evaluation board 
which had an SDRAM on board when we used it and as far as I remember, 
Ethernet worked on that board together with libBSD, but it was a tight 
fit. It works better on custom boards with the SAMv71/E70 with more SDRAM.

But please be aware that the SAMV71/E70 has some serious problems with 
the SDRAM controller. Using it adds jitter to the PLLs. Therefore, you 
can't use the USB controller and the SDRAM at the same time. Most other 
parts seemed to work stable most of the time. But the problems were 
severe enough that Microchip now tells you in the Chip Errata not to use 
the SDRAM at all. There are some other bugs, so I would recommend 
reading the Errata thoroughly if you plan to use the controller in a new 
project.

>     I managed to do the most on  SAMRH71F20-EK (CQFP package) evaluation
>     board:
>     evaluation board is connected to my workstation and I can both ping
>     RH71 from PC and ping PC from RH71 RTEMS Shell console, it works
>     very well until random microcontroller freeze. Sometimes program
>     freezes after 20 ping requests + replies, sometimes after 250, but
>     it always freezes and then debugging session is broken too, I have
>     to disconnect and attach to see the microcontroller state and it is
>     trapped in endless loop I put in bootloader startup code to give me
>     a time to inspect the microcontroller state.
> 
>     It might be a misleading clue, but changing GMAC interrupt priority
>     to be numerically bigger than Systick interrupt makes this stress
>     test to endure more ping requests.
>     Also an AHB Bus Matrix peripheral of SAMRH71 reports some errors,
>     but I lack knowledge and documentation on how this certain MCU
>     peripheral (AHB matrix controller) works.
>     I doubt it, but SAMRH71F20-EK evaluation board could be a source of
>     problem too, since it seems they completely ignored hardware design
>     recommendations of KSZ8061 PHY.
> 
>     In order to make if_atsam driver work on ATSAMRH71 I had to:
> 
>       * copy and mass sed GMAC driver files, since they changed name of
>         registers macros a bit
>       * change pins configuration to reflect which pins are used on my
>         evalboard
>       * change "rtems_bsd_if_atsam_get_if_media_props" to return
>         is_fixed=true and duplex=IFM_FDX
>       * change SYSINIT_DRIVER_REFERENCE(ukphy, miibus); to
>         SYSINIT_DRIVER_REFERENCE(ksz8091rnb, miibus);  leaving ukhpy
>         lead to crashesh after printing long "sssss" strings
> 
> 
>     Please tell me about a maturity and status of ATSAMV71 if_atsam
>     driver, is it tested on any atsamv71 board? Then how, since there is
>     so little memory on Xplained Ultra?
>     I understand that most of the RTEMS BSP is made only for
>     demonstration purposes and that's why I'm asking, maybe someone can
>     tell me what should be changed in it to make it work reliably? Do
>     you have any other resources to suggest I can use to learn how this
>     stack works beside two readme files in rtems-libbsd repo and
>     obviously freebsd documentation?

Regarding BSPs in RTEMS: A lot of the published ones are for some vendor 
evaluation boards. But in many cases, they are used on custom 
applications with just some changed BSP options. Of course there are 
exceptions like the RPi or the BBB which are often used during GSoC 
projects and therefore there are a lot of new programmers working on 
them. Best method is usually to take a look at the commit history who 
was working heavily on the boards and just ask them directly.

Best regards

Christian


> 
>     Anyway, guys - nice job creating rtems-libbsd. I hope to learn more
>     about it and use it in our projects.
> 
>     Best regards
> 
>     Dariusz Sabała
>     Embedded software engineer
>     Creotech Instruments
>     _______________________________________________
>     users mailing list
>     users at rtems.org <mailto:users at rtems.org>
>     http://lists.rtems.org/mailman/listinfo/users
>     <http://lists.rtems.org/mailman/listinfo/users>
> 
> 
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users

-- 
--------------------------------------------
embedded brains GmbH & Co. KG
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email:  christian.mauderer at embedded-brains.de
phone:  +49-89-18 94 741 - 18
mobile: +49-176-152 206 08

Registergericht: Amtsgericht München
Registernummer: HRA 117265
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the users mailing list