Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
761 Views

Error: Eclipse (Code Stuck at printf function) Incompatible 2 value with TX_CMD_STAT

InterNiche Portable TCP/IP, v3.1  

 

Copyright 1996-2008 by InterNiche Technologies. All rights reserved.  

prep_tse_mac 0 

Your Ethernet MAC address is 00:07:ed:11:83:04 

prepped 1 interface, initializing... 

[tse_mac_init] 

INFO : TSE MAC 0 found at address 0x0b482000 

INFO : PHY Marvell 88E1111 found at PHY address 0x10 of MAC Group[0] 

INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0] 

INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link... 

INFO : PHY[0.0] - Auto-Negotiation PASSED 

MARVELL : Mode changed to RGMII/Modified MII to Copper mode 

MARVELL : Enable RGMII Timing Control 

MARVELL : PHY reset 

INFO : PHY[0.0] - Checking link... 

INFO : PHY[0.0] - Link not yet established, restart auto-negotiation... 

INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link... 

INFO : PHY[0.0] - Auto-Negotiation PASSED 

INFO : PHY[0.0] - Link established 

INFO : PHY[0.0] - Speed = 100, Duplex = Full 

OK, x=0, CMD_CONFIG=0x00000000 

[tse_mac_init] Error: Incompatible 2 value with TX_CMD_STAT register return TxShift16 value.  

init error -11 on net[0] 

mctest init called 

IP address of : 192.168.1.207 

Created "Inet main" task (Prio: 2) 

Created "clock tick" task (Prio: 3) 

 

Simple Socket Server starting up 

 

Initillize the Enhanced Interrupt.. 

Enhnace interrupt ENABLED, Return value = 0 

Created "simple socket server" task (Prio: 4) 

RS232 Port Open....!! 

 

----Ready to Receive Interrupt---- 

 

# Synchronous Data received...!! 

 

and then code stuck after displaying "#synchronous data received...!!" 

void SSSSimpleSocketServerTask() { unsigned int LPktCount = 0; unsigned int Count = 0; unsigned int DataCount = 0; unsigned char ImgData = 0; unsigned int test = 0; //--------------------------Receive From RS-422 Port @ 1 mbps------------------------------------------- printf("\n\t\t----Ready to Receive Interrupt----\n"); while(1) { do { if( edge_capture) //w.r.t. clock or LOAD Pulse from "sync_detect" { edge_capture = 0; ImgBuff = IORD_ALTERA_AVALON_PIO_DATA(DATA_BASE); } if(Count == PktSize-1) { Count = 0; LPktCount++; } }while(LPktCount != (PktCount+1)); printf("\n\t#Synchronous Data received...!!"); //Code stuck at this Line //----------------------Sending to RS-232 ------------------------------------------------------- printf("\n\t#Sending Data at RS232 Port at 115kbps...\n"); Xstart = 0; Ystart = 0; LPktCount = 0; printf("\n\t# Send Sync Word.."); for(Count = 0; Count<=2;Count++) { fprintf(fp,"%c",strt_sync); printf("\t%d",strt_sync); } for(LPktCount = 0+Ystart; LPktCount<mPktCount;LPktCount++) // { for(DataCount = 0; DataCount<mPktSize;DataCount++) { ImgData = ImgBuff; fprintf(fp,"%c",ImgData); } printf("#"); } } }
0 Kudos
7 Replies
Highlighted
Valued Contributor III
13 Views

the error 

 

[tse_mac_init] Error: Incompatible 2 value with TX_CMD_STAT register return TxShift16 value.  

init error -11 on net[0] 

 

Adding check mark on "align packet header to 32 bit boundary" will remove the above error 

 

but still code stuck after printf
0 Kudos
Highlighted
Valued Contributor III
13 Views

Ok for the tse_mac_init error: the tse user guide indeed recommends you enable the "align packet header to 32 bit boundary" option if you want to use tse with Interniche TCP stack. 

Does your code gets stuck even if you remove all those printf? What's the rate that printf is expected to be called in that while loop? 

Also try adding a sleep calls just before the for(Count...) loop or inside the loop itself in order to see if your code get's there: printf needs to be processed by the HAL driver before you can see them in the terminal console, so there could be more messages in the printf queue but you can't see them because the whole OS gets stuck.
0 Kudos
Highlighted
Valued Contributor III
13 Views

Hello Cris, 

 

Thanking you for your support,  

 

its behavioral is random, now it stuck after "Auto-Negotiation PASSED" and won't go further. 

 

attached is the 1. print screen of console 

2. Sopcinfo file 

 

kaushal
0 Kudos
Highlighted
Valued Contributor III
13 Views

 

--- Quote Start ---  

Ok for the tse_mac_init error: the tse user guide indeed recommends you enable the "align packet header to 32 bit boundary" option if you want to use tse with Interniche TCP stack. 

Does your code gets stuck even if you remove all those printf? What's the rate that printf is expected to be called in that while loop? 

Also try adding a sleep calls just before the for(Count...) loop or inside the loop itself in order to see if your code get's there: printf needs to be processed by the HAL driver before you can see them in the terminal console, so there could be more messages in the printf queue but you can't see them because the whole OS gets stuck. 

--- Quote End ---  

 

 

yes it stuck even i remove printf, now i have remove all printf from my code , then i change the priorities
0 Kudos
Highlighted
Valued Contributor III
13 Views

Please clarify a main point: does your program get stuck when you register and enable the LOAD interrupt or even without the irq? 

In the first case, as I said in the other thread, the LOAD irq must have the HIGHEST priority: infact I see in your current sopc system the timer priority is still higher and this will either prevent LOAD irq (priority 1) to be serviced, or possibly mess up the whole system. Those priorities should be inverted.
0 Kudos
Highlighted
Valued Contributor III
13 Views

Hello Cris , 

It stuck during initial phase , while loading the elf file to nios-ii, it is not yet come to the application this is the initial phase of initialization.  

During initialization it stuck at (Attached Print –Screen of Eclipse Console) 

 

INFO : PHY [0.0] – Auto-Negotiation PASSED  

 

I have switch the priority of LOAD and as you mentioned  

 

*I am using Altera DE2-115 Board 

 

kaushal
0 Kudos
Highlighted
Valued Contributor III
13 Views

hello There, 

 

1. during porting the elf file to nios-ii eclipse generate a error saying "system console model is invalid", and then i run the run configuration and it port the elf file without any error  

 

2. now with little modification in sopc like improving tse_mac receive buffer and on_chip memory...this code pass from stuck position (auto negotiations). 

and initilize tse_mac , butit won't respond to ping request it seems that tse_mac is not initialize. 

 

3. after that i send data toward this system, it receive data, but at the same time the entire system re-initialize the interniche and every time i send data toward this system, it re-initilize and it keep reinitialize in loop mode. 

 

 

attached is print-screen of following events 

1. As soon as i click on run to nios-ii hardware eclipse generate an error saying "system console model is invalid" 

2. initilization and porting of elf file to nios and do not responding to ping request 

3. As soon as it receive data, entire system is reinitiliza the InterNiche 

 

Regard 

 

kaushal
0 Kudos