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++
12600 Discussions

NicheStack tk_crnos.h compiling problem

Altera_Forum
Honored Contributor II
2,427 Views

Hi there, 

I have problem compiling my NIOSII App SimpeSock Server under Cyclone3 (FireFighter board), I'm using NIOSII 10.0sp1 and i get an error in file: tk_crnos.h when i want to compile it. Error looks like that: 

expected '=', ',', ';', 'asm' or '__attribute__' before '*' token tk_crnos.h  

Line in tk_crnos.h: 

extern OS_EVENT *rcvdq_sem_ptr;  

Can anyone could help me solve this problem?
0 Kudos
12 Replies
Altera_Forum
Honored Contributor II
554 Views

No one knows what is going on with it?? maybe there is other way to build up a Ethernet connection between 2x Cyclone III platforms?? plz help me ppl

0 Kudos
Altera_Forum
Honored Contributor II
554 Views

That looks as though the typedef for OS_EVENT is absent.

0 Kudos
Altera_Forum
Honored Contributor II
554 Views

but OS_EVENT is described in 'ucos_ii.h' file so i don't understand why program get error :( i need to do that ethernet connection for my engineer project:( 

this is code of tk_crnos.h file, code which is provided by altera originally, and should work: 

# ifndef TK_CRNOS_H# define TK_CRNOS_H # ifndef CHRONOS# error - must define CHRONOS in ipport.h to use this file# endif extern void TK_OSTaskResume(u_char * Id); /* define the default priority for all net related tasks */# define NET_PRIORITY 0 /* not used on ChronOS */ # ifdef NOT_DEF /* * Altera Niche Stack Nios port modification: * OS_PRIO_SELF defined in ucosii.h, as is OS_EVENT */ /* Self-ID token for pass to ChronOS primitives */# ifdef ALT_INICHE# include "ucos_ii.h"# else# define OS_PRIO_SELF 0xFF# endif /* ALT_INICHE */ # endif /* Define the CHRONOS object control TK_ macros... */ /* macros for task type, entry, and name */# define TK_ENTRY(name) void name(void * parm)# define TK_OBJECT(name) u_char name# define TK_OBJECT_PTR(name) u_char * name# define TK_OBJECT_REF(name) TK_OBJECT(name)# define TK_ENTRY_PTR(name) void(*name)(void*) # define TK_THIS TK_OSTaskQuery() # ifndef TK_RETURN_ERROR# define TK_RETURN_ERROR() return# endif# ifndef TK_RETURN_OK# define TK_RETURN_OK() return# endif /* * synchronization primitives * * Need one or the other of LOCK_NET_RESOURCE/UNLOCK_NET_RESOURCE and * ENTER_CRIT_SECTION/EXIT_CRIT_SECTION. These should be implementable * as either functions or macros, so we allow e.g. ipport.h_h to * override these definitions by defining the names as macros. * CHRONOS targets generally use LOCK_NET_RESOURCE/UNLOCK_NET_RESOURCE * so we default to function declaractions for them. */ extern void LOCK_NET_RESOURCE(int res); extern void UNLOCK_NET_RESOURCE(int res); extern void irq_Mask(void); extern void irq_Unmask(void); # define ENTER_CRIT_SECTION(p) irq_Mask()# define EXIT_CRIT_SECTION(p) irq_Unmask() # ifdef NOTDEF /* set up pointers to CHRONOS semaphores as void * so we don't * have to include ChronOS includes in every file in the build. In Addition * RXQ_RESID and FREEQ_RESID are not real semaphores, but just placeholders. * See the LOCK_NET_RESOURCE() code for details. */# ifndef NET_RESID extern void * net_task_sem_ptr;# define NET_RESID (net_task_sem_ptr)# endif# ifndef PINGQ_RESID extern void * pingq_sem_ptr;# define PINGQ_RESID (pingq_sem_ptr)# endif# ifndef FTPCQ_RESID extern void * ftpcq_sem_ptr;# define FTPCQ_RESID (ftpcq_sem_ptr)# endif# ifndef RXQ_RESID extern void * receiveq_sem_ptr;# define RXQ_RESID (receiveq_sem_ptr)# endif# ifndef FREEQ_RESID extern void * freeq_sem_ptr;# define FREEQ_RESID (freeq_sem_ptr)# endif # endif /* declare tasks which may need to be accessed by system code */ extern TK_OBJECT(to_pingcheck); extern TK_OBJECT(to_netmain); extern TK_OBJECT(to_emailer); extern TK_OBJECT(to_ftpclnt); /* map TK_ macros to CHRONOS: */# define TK_BLOCK() OSTaskSuspend(OS_PRIO_SELF) extern OS_EVENT *rcvdq_sem_ptr;# define TK_NETRX_BLOCK() { INT8U err; OSSemPend(rcvdq_sem_ptr, TPS, &err); if ((err != OS_NO_ERR) && (err != OS_TIMEOUT)) dtrap(); } # define TK_SLEEP(count) OSTimeDly(count + 1) /* (Id) is always of type TK_OBJECT_PTR */# define TK_WAKE(Id) OSTaskResume(*(u_char*)(Id)) /* (ev) is always of type TK_OBJECT_REF */# define TK_WAKE_EVENT(ev) OSTaskResume((u_char)(ev)) /* Do tk_yield() as a function to avoid pointless delays */ void tk_yield(void);# define TK_YIELD() tk_yield() /* For ChronOS SignalPktDemux() is a routine which manually sets the net * task to runnable. This is so we can call it from an ISR and not have * ChronOS enable interrupts on us. */# define SignalPktDemux() OSSemPost(rcvdq_sem_ptr)# define SignalEmailTask() OSTaskResume(to_emailer)# define SignalFtpClient() OSTaskResume(to_ftpclnt) # endif /* TK_CRNOS_H */
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

there could be a syntax error, or use of an undefined type/macro in the definition of OS_EVENT itself. 

 

It could happen if you are not including all the required files, are doing it in a wrong order, or missing some defines in the top level project.
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

Adding -E to the compiler command line (not sure how you would do this with the altera makefiles) will white the preprocessor output to the .o file. 

You can then look at what the compiler sees.
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

I added -E option to compiler :) waiting for result. 

----------------- 

ok i understand that but i'm doing everything like Altera write in NicheStack tutorial and still it can't build BSP :( u think i may forgot something when i was creating SOPC project?? Or maybe again Altera change names of ports, like it was when i compiling the sof file :( I'm so disappointed of Altera work because of they tutorials which doesn't tell anything abut problems which may appeared when you will compile program in new version of their Compiler:( their updates their tutorials to new version by their didn't check software is it really work
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

Unfortunately I never had this kind of error on the tutorial, so it is difficult to help you... it could be a bug in the BSP, such as a missing define, bad configuration... 

I don't think that a bad definition in the SOPC project would generate something like that. It would either print an error during run time, or when you compile the Altera TSE driver.
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

You did enable uC OS/II in your project? Did you modify anything in your project's ipport.h file?

0 Kudos
Altera_Forum
Honored Contributor II
554 Views

i added -E option to compiler and it successfully compiled BSP i get only error in simple program which i need to rewrite to my board. 

Thx for help :) 

 

I don't know did i enabled UCOSII but i set in BSP creator Micrium OS and added altera_iniche in BSP editor. Also ipport.h was edited by altera and i get that file with MotionFire project.
0 Kudos
Altera_Forum
Honored Contributor II
554 Views

I'm getting sick of this :( I don't know why i gets always errors. Can anyone help me with it? I attached bsp folder in this post can somebody make simply connection under nios and try to compile it under NIOSII 10.0 sp1?or make Simple Sock Server app, which i can use to connect and get an message when i connect that I'm successfully connected to Cyclone III.:(

0 Kudos
Altera_Forum
Honored Contributor II
554 Views

Did anyone ever resolve this?

0 Kudos
Altera_Forum
Honored Contributor II
554 Views

I solve my problem, i realized that under Quartus II project there is no reposition to Ethernet Driver coz it isn't implement on this project. ;/

0 Kudos
Reply