No Transmission from GMAC using +TCP on SAME70

heinbali01 wrote on Wednesday, February 07, 2018:

Hi Ralph, you’re very quick to try it out.
It is a long time ago that I worked with this driver. Tomorrow I will set-up my SAM board.
Which board, what hardware are you using?
Did your PHY get initialised well?
Thanks.

rhornecker wrote on Wednesday, February 07, 2018:

Hi Hein,
I am using the SAME70-Xplained.
I believe that the PHY is properly initialised. I implememted a log via uart to see if the ID is the same and the Autonegotioation works.

PHY ID 221560
xPhyReset: phyBMCR_RESET 0 ready
+TCP: advertise: 01E1 config 3100
prvEthernetUpdateConfig: LS mask 00 Force 1
>> Autonego ready: 0000786d: full duplex, 100 mbit ,high status

Is there any other way to check for a proper initalisation? Maybe check some GMAC registers?

Ralph

svlas wrote on Wednesday, February 07, 2018:

got compilation arror
tcp/portable/networkinterface/same70/gmac_SAM.c:357:39: error: ‘GMAC_TSR_UND’ undeclared (first use in this funct
what is the value of GMAC_TSR_UND
for SAMe70 KSZ8081RNA PHY ?

heinbali01 wrote on Thursday, February 08, 2018:

got compilation error
same70/gmac_SAM.c:357:39: error: 'GMAC_TSR_UND' undeclared
what is the value of GMAC_TSR_UND

The UND stands for “Transmit Under Run”, and it only exists in SAM4E :

/* Transmit Status Register */
#define GMAC_TSR_UND (0x1u << 6) /* (GMAC_TSR) Transmit Under Run */

There is also a Transmit Under Run field, and that exists in both the SAM4E and SAME70:

#define GMAC_ISR_TUR (0x1u << 4) /* (GMAC_ISR) Transmit Under Run */
#define GMAC_IER_TUR (0x1u << 4) /* (GMAC_IER) Transmit Under Run */
#define GMAC_IDR_TUR (0x1u << 4) /* (GMAC_IDR) Transmit Under Run */
#define GMAC_IMR_TUR (0x1u << 4) /* (GMAC_IMR) Transmit Under Run */

You can safely define this default:

#ifndef GMAC_TSR_UND
    #define GMAC_TSR_UND    0ul
#endif

heinbali01 wrote on Saturday, February 10, 2018:

Hi Serhii Vlasiuk ( and other users ), there is still a problem with the driver that I attached (SAM4E_E70_driver_v1.0.7z).
It worked fine for SAM4E, but on a SAMe70 I see DMA errors while transmitting, probably the same problem as Ralph reported.
I’m diving into it and report back here. Hein

heinbali01 wrote on Saturday, February 10, 2018:

Please find attached a driver that should both work for SAME70 as well as SAM4E.
The DMA errors were solved when I set the bit GMAC_DCFGR_TXPBMS to ‘1’ (see PDF).
Regards,

rhornecker wrote on Wednesday, February 21, 2018:

Thanks Hein for providing the driver. After some simple tests with the board I reached a
writing throughput of about 1Mbits/s and reading about 15Mbit/s. I think that this can be further improved.

rhornecker wrote on Wednesday, February 21, 2018:

Thanks Hein for providing the driver. After some simple tests with the board I reached a
writing throughput of about 1Mbits/s and reading about 15Mbit/s. I think that this can be further improved.

rhornecker wrote on Friday, February 23, 2018:

After some tweeking I reached 30 Mbits/s reading and writing.

dibosco wrote on Friday, February 23, 2018:

I really hope this isn’t an inappropriate posting and apologies if it is.

Now you have this working nicely, would you be kind enough to put it on
the interactive forum please? I am taking delivery of the SAME70 dev kit
today and would like to get this up and running with Crossworks. I’ve
got a few Atmel Studio projects going on Crossworks, so it shouldn’t be
too onerous a task. I will, likewise, put the Crossworks one on the
forum when it’s going.

rtel wrote on Friday, February 23, 2018:

Unfortunately the host of the Interactive forums no longer allow attachements, so we are looking for an alternative. For now the code can be attached to a forum post here, or you can just post a link to the code in the Interactive site.

heinbali01 wrote on Wednesday, February 28, 2018:

I’m sorry to respond so late. Sourceforge had troubles forwarding me emails. Only today it seems to work again: I received 50+ emails.

Ralph wrote:

After some tweeking I reached 30 Mbits/s reading and writing.

That is good!
As you work with a SAME70, we might have a look at memory caching.
Can you tell what you did to get this better performance?
Did you change the driver or just the settings?

rhornecker wrote on Wednesday, February 28, 2018:

Mainly my task priority settings were wrong. The iperf-task had the same priority as the ip-task, which made the whole system slower. Rookie mistake I guess. Furthermore, I increased the buffer and window size.

rkyrk wrote on Wednesday, February 28, 2018:

We are having the same issue with a SAMV71 Xplained board, PHY can receive but we cannot transmit anything. (With both FreeRTOS+TCP and LWIP examples).