ATSAMV71 / ATSAMRH71 ethernet POC with RTEMS-LIBBSD

Dariusz SabaƂa <dariusz.sabala-5+J3KXwDsBirDJvtcaxF/[email protected]> Thu, 27 Jun 2024 09:22:11 +0000
Newsgroups gmane.os.rtems.user
Message-ID <PAVPR07MB92645DC4A32351327EE8566299D72@PAVPR07MB9264.eurprd07.prod.outlook.com>
--===============3462518582108065830==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_PAVPR07MB92645DC4A32351327EE8566299D72PAVPR07MB9264eurp_"

--_000_PAVPR07MB92645DC4A32351327EE8566299D72PAVPR07MB9264eurp_
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Hi

I am working on RTEMS LibBSD Ethernet networking POC on ATSAMV71 and on ATS=
AMRH71

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

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 fr=
om PC and ping PC from RH71 RTEMS Shell console, it works very well until r=
andom microcontroller freeze. Sometimes program freezes after 20 ping reque=
sts + replies, sometimes after 250, but it always freezes and then debuggin=
g session is broken too, I have to disconnect and attach to see the microco=
ntroller state and it is trapped in endless loop I put in bootloader startu=
p code to give me a time to inspect the microcontroller state.

It might be a misleading clue, but changing GMAC interrupt priority to be n=
umerically bigger than Systick interrupt makes this stress test to endure m=
ore ping requests.
Also an AHB Bus Matrix peripheral of SAMRH71 reports some errors, but I lac=
k knowledge and documentation on how this certain MCU peripheral (AHB matri=
x 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 recommendation=
s 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 regis=
ters macros a bit
  *   change pins configuration to reflect which pins are used on my evalbo=
ard
  *   change "rtems_bsd_if_atsam_get_if_media_props" to return is_fixed=3Dt=
rue and duplex=3DIFM_FDX
  *   change SYSINIT_DRIVER_REFERENCE(ukphy, miibus); to SYSINIT_DRIVER_REF=
ERENCE(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 purp=
oses and that's why I'm asking, maybe someone can tell me what should be ch=
anged in it to make it work reliably? Do you have any other resources to su=
ggest I can use to learn how this stack works beside two readme files in rt=
ems-libbsd repo and obviously freebsd documentation?

Anyway, guys - nice job creating rtems-libbsd. I hope to learn more about i=
t and use it in our projects.

Best regards

Dariusz Saba=B3a
Embedded software engineer
Creotech Instruments

--_000_PAVPR07MB92645DC4A32351327EE8566299D72PAVPR07MB9264eurp_
Content-Type: text/html; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
2">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Hi</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am working on RTEMS LibBSD Ethernet networking POC on ATSAMV71 and on ATS=
AMRH71</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
My tries on ATSAMV71 were limited due to very small amount of SDRAM memory =
on evaluation board - its only 2MB.</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I managed to do the most on &nbsp;SAMRH71F20-EK (CQFP package) evaluation b=
oard:</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
evaluation board is connected to my workstation and I can both ping RH71 fr=
om PC and ping PC from RH71 RTEMS Shell console, it works very well until r=
andom microcontroller freeze. Sometimes program freezes after 20 ping reque=
sts + 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.</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It might be a misleading clue, but changing GMAC interrupt priority to be n=
umerically bigger than Systick interrupt makes this stress test to endure m=
ore ping requests.</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Also an AHB Bus Matrix peripheral of SAMRH71 reports some errors, but I lac=
k knowledge and documentation on how this certain MCU peripheral (AHB matri=
x controller) works.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
I doubt it, but SAMRH71F20-EK evaluation board could be a source of problem=
 too, since it seems they completely ignored hardware design recommendation=
s of KSZ8061 PHY.</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In order to make if_atsam driver work on ATSAMRH71 I had to:</div>
<ul data-editing-info=3D"{&quot;orderedStyleType&quot;:1,&quot;unorderedSty=
leType&quot;:2}" style=3D"margin-top: 0px; margin-bottom: 0px;">
<li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); list-s=
tyle-type: &quot;- &quot;;">
<span style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">cop=
y and mass sed GMAC driver files, since they changed name of registers macr=
os a bit<br>
</span></li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFo=
ntService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0=
, 0); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">cha=
nge pins configuration to reflect which pins are used on my evalboard<br>
</span></li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFo=
ntService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0=
, 0); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">cha=
nge &quot;rtems_bsd_if_atsam_get_if_media_props&quot; to return is_fixed=3D=
true and duplex=3DIFM_FDX<br>
</span></li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFo=
ntService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0=
, 0); list-style-type: &quot;- &quot;;">
<span style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService,=
 Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">cha=
nge SYSINIT_DRIVER_REFERENCE(ukphy, miibus); to SYSINIT_DRIVER_REFERENCE(ks=
z8091rnb, miibus); &nbsp;leaving ukhpy
 lead to crashesh after printing long &quot;sssss&quot; strings</span></li>=
</ul>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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?</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
I understand that most of the RTEMS BSP is made only for demonstration purp=
oses and that's why I'm asking, maybe someone can tell me what should be ch=
anged in it to make it work reliably? Do you have any other resources to su=
ggest I can use to learn how this
 stack works beside two readme files in rtems-libbsd repo and obviously fre=
ebsd documentation?</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Anyway, guys - nice job creating rtems-libbsd. I hope to learn more about i=
t and use it in our projects.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best regards</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dariusz Saba=B3a</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Embedded software engineer&nbsp;</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Creotech Instruments</div>
<div id=3D"Signature" style=3D"color: inherit;"></div>
</body>
</html>

--_000_PAVPR07MB92645DC4A32351327EE8566299D72PAVPR07MB9264eurp_--

--===============3462518582108065830==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
users mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/users
--===============3462518582108065830==--