Forum Discussion
NIOS : INTERNICHE stack without ucOSII
Hello
I'd like to use the interniche stack and the TSE ethernet mac, but without ucOSII.. I've heard, it exist a superloop example but it seems a lot of files patching is mandatory. Do you have experience about it ? it works ? Do you have an example of project which already working as standalone ? What about niche task, the free "OS" provided by Interniche. Thanks a lot dvb_man Etienne19 Replies
- Altera_Forum
Honored Contributor
Hello everybody,
thanks for all your advice! I finally got the superloop running!!! :D @jens: yes, I made changes to my create-this-app script simular to your example. The reason for the error mentioned before was indeed that the nios system was not able to use assembler code as dsl mentioned. in cksum.c a C-or assembler routine is chosen depending on C_CHECKSUM. I defined C_CHECKSUM, then it worked with ccksum(..) which is a C-routine. --- Quote Start --- unsigned short cksum (void *ptr, unsigned count) { switch (cksum_select) { case 1: default: return (ccksum(ptr, count)); # ifndef C_CHECKSUM case 2: return (asm_cksum(ptr, count));# endif --- Quote End --- What I still do not understand is, why your example worked withoud choosing the c-function...? However thanks once more for your valuable help!!! br Frank - Altera_Forum
Honored Contributor
Frank, I'm happy with you :)
Regarding the checksum ... I have a asm_cksum.S in the source tree. (C:\altera\91\nios2eds\components\altera_iniche\HAL\src\nios2\) In my example the asm_cksum.S is copied to software_examples\superloop_iniche_lib\iniche\src\nios2 Have a look in the create-this-lib script. There you can see the source files which are copied. May be it isn't in your Altera source tree? Jens - Altera_Forum
Honored Contributor
the asm_cksum.S is included and appears in the library in the given path. So the patch was applied correctly. Nevertheless when using asm_cksum, the error mentioned before appears:
--- Quote Start --- iniche/src/misclib/cksum.c:105: undefined reference to `asm_cksum' --- Quote End --- - Altera_Forum
Honored Contributor
You can also use UDP with no checksum at all. For local networks (usually how UDP will be used) there are not packet errors to worry about but more total packet loss (dropped packets) to deal with. UDP without implementing it in hardware can be very efficient IF you don't use the Altera TSE or SGDMA libraries - they are horribly inefficient. With an improved TSE driver (plus adopted for lwIP), efficient UDP packet generators and our own SGDMA driver we can do over 940MbS UDP without hardware acceleration (that's with UDP checksums off). Packet loss on the PC was incredible - we only wanted to prove what the Cyclone III was capable of putting on the wire. None of this was easy - I have put over 3 months into optimizing Ethernet and UDP on the Cyclone III.
Like Jens, we use TCP for control and UDP for large data movement (from the Cyclone III to PC). lwIP is smaller, faster, and IMO better written. It's open source (free) and has decent user-community support. But Interniche with your own UDP protocol would work fine too as long as the TSE/SGDMA driver inefficiencies are resolved. It's entirely possible in NIOS II 9.x that they have been - we're using 8.1. Bill - Altera_Forum
Honored Contributor
I've made available a TSE driver and example program.
See: http://www.alteraforum.com/forum/sho...3638#post93638 (http://www.alteraforum.com/forum/showthread.php?p=93638#post93638) - Altera_Forum
Honored Contributor
hm, this is also an interesting alternative. I will try this one and compare it to the hardware-accelerated design I set up.
- Altera_Forum
Honored Contributor
Hi all,
Has anybody try "create-app" of the superloop under Quartus 9.1 sp2 ?...I've tried it and it doesn't work.I get message errors like these: Info: Compiling iniche/src/ftp/ftpclnt.c to obj/iniche/src/ftp/ftpclnt.o nios2-elf-gcc -xc -MP -MMD -c -Iiniche/inc/ -Iiniche/src/h/ -Iiniche/src/h/nios2 / -Iiniche/src/nios2/ -I../bsp/ -I../bsp//drivers/inc -I../bsp//HAL/inc -DSYSTE M_BUS_WIDTH=32 -D__hal__ -pipe -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREA DED -DRO_ZIPFS -DSUPERLOOP -DALT_INICHE -DALTERA_TRIPLE_SPEED_MAC -O2 -g -Wall -mhw-div -mhw-mul -mno-hw-mulx -o obj/iniche/src/ftp/ftpclnt.o iniche/src/ft p/ftpclnt.c iniche/src/ftp/ftpclnt.c: In function `fc_getreply': iniche/src/ftp/ftpclnt.c:309: error: `EWOULDBLOCK' undeclared (first use in this function) iniche/src/ftp/ftpclnt.c:309: error: (Each undeclared identifier is reported onl y once iniche/src/ftp/ftpclnt.c:309: error: for each function it appears in.) iniche/src/ftp/ftpclnt.c: In function `fc_sendmore': iniche/src/ftp/ftpclnt.c:783: error: `EWOULDBLOCK' undeclared (first use in this function) iniche/src/ftp/ftpclnt.c:784: error: `ENOBUFS' undeclared (first use in this fun ction) iniche/src/ftp/ftpclnt.c: In function `fc_getmore': iniche/src/ftp/ftpclnt.c:838: error: `EWOULDBLOCK' undeclared (first use in this function) iniche/src/ftp/ftpclnt.c: In function `fc_dataconn': iniche/src/ftp/ftpclnt.c:987: error: `EWOULDBLOCK' undeclared (first use in this function) iniche/src/ftp/ftpclnt.c:1018: error: `EINPROGRESS' undeclared (first use in thi s function) iniche/src/ftp/ftpclnt.c: In function `fc_connopen': iniche/src/ftp/ftpclnt.c:1407: error: `EISCONN' undeclared (first use in this fu nction) iniche/src/ftp/ftpclnt.c:1413: error: `EINPROGRESS' undeclared (first use in thi s function) make: *** [obj/iniche/src/ftp/ftpclnt.o] Error 1 Copying library sources from installation tree... Any suggestions? Thanx in advance - Altera_Forum
Honored Contributor
Soin, the example included in the qar project file (page 1 in this thread) contains a creat-this-app script which runs correct.
Does the patch succeeds (create-this-lib for iniche and tse) ? Could you post the create-this-app script? Jens - Altera_Forum
Honored Contributor
thank u jens,
I had downloaded the design from Nios Wiki...now i will try the one downloaded from the post...