Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

Using the TSE without interniche

Altera_Forum
Honored Contributor II
1,685 Views

Hi, 

 

Sorry for bugging you guys again but I'm hoping to use the triple speed ethernet in a very simple application that captures ethernet frames at low rates. 

 

I was hoping to do this via the HAL but there seem to be a number of problems 

 

- __ALTERA_AVALON_SGDMA isn't set (note there is a SGDMA for TX and RX) so the functions in altera_avalog_tse.c that do DMA aren't compiled 

- the TRIPLE_SPEED_ETHERNET_INIT() macro is defined as 'while(0)' so the ethernet isn't initialized in alt_sys_init.c 

 

So is it possible to use the HAL to access the ethernet controller without using the iniche stack? If so can anybody point me at some documentation or (if I'm really lucky) an example program? 

 

The documentation for the triple speed Ethernet isn't much help as many of the functions it mentions only seem to be present if uCosII is being used.  

 

The file ./ip/altera/triple_speed_ethernet/lib/sopc_builder/altera_triple_speed_ethernet/ 

UCOSII/src/iniche/ins_tse_mac.c looks like a potential option but it seems to be tied to uCosII. I guess grabbing a copy and hacking it may work but it seems unlikely that this is the right approach! Hopefully there is a cleaner answer. 

 

Thanks, 

Darren.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
702 Views

Hi All, 

 

Sorry to respond to my own post. 

 

In the end I took the interniche version of the code, stripped-out the interniche dependencies and modified the code so that it uses macros for packet allocation and delivery of rx packets. 

 

If anybody needs it contact me and I'll send it along. 

 

Darren,
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

Hello Darren, 

 

I'm just trying to do the same. Which files did you modify? Could you send them to me? Thanks in advance, Sergio
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

 

--- Quote Start ---  

Hello Darren, 

 

I'm just trying to do the same. Which files did you modify? Could you send them to me? Thanks in advance, Sergio 

--- Quote End ---  

 

 

Hi Sergio, 

 

I've attached the files in a zip file to this message. The changes are marked by __REMOVED__.  

 

Call tse_mac_init() to get things started. 

 

In ins_tse_mac.h you need to supply your own definitions for the dprintf() _PKT_ALLOC() and _PKT_RXD() macros. Note that the last two may be called from an interrupt context so avoid any blocking operations. 

 

I have done some minor testing but nothing extensive - it does receive packets, and they seem to have sensible looking data but I haven't tested for handling of large bursts of data or any other stress testing. As it's based on working code I don't expect any serious issues but you never know. 

 

I've been testing on a Cyclone III / Nios II evaluation board. You may need other changes if you use a non-supported Ethernet PHY device - see the TSE documentation for some hints on how to support new PHY devices. 

 

If you find a problem please let me know. 

 

Darren.
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

hello  

 

i'm trying to running lwip with TSE + DP83848C with your init files. Thanks a lot ! 

 

but i'm newbie and could you say me what do you do before tse_mac_init() ? 

 

I always get error Error opening TX SGDMA but i've done no initilisation before (i don't know what must be initialised and how). 

 

could you help me by adding a little software project to start corrrectly, please ? 

 

 

thanks a lot 

Etienne
0 Kudos
Altera_Forum
Honored Contributor II
702 Views

 

--- Quote Start ---  

Hi Sergio, 

 

I've attached the files in a zip file to this message. The changes are marked by __REMOVED__.  

 

Call tse_mac_init() to get things started. 

 

In ins_tse_mac.h you need to supply your own definitions for the dprintf() _PKT_ALLOC() and _PKT_RXD() macros. Note that the last two may be called from an interrupt context so avoid any blocking operations. 

 

I have done some minor testing but nothing extensive - it does receive packets, and they seem to have sensible looking data but I haven't tested for handling of large bursts of data or any other stress testing. As it's based on working code I don't expect any serious issues but you never know. 

 

I've been testing on a Cyclone III / Nios II evaluation board. You may need other changes if you use a non-supported Ethernet PHY device - see the TSE documentation for some hints on how to support new PHY devices. 

 

If you find a problem please let me know. 

 

Darren. 

--- Quote End ---  

 

 

Hello, 

 

I am trying to send data from SDRAM to another device using Ethernet connectivity.  

 

would you mind send me your design to be used as a reference. 

 

Thanks & Regards
0 Kudos
Reply