Tool/software: Linux
Hi,
I am trying to integrate the Powerlink stack into the Openmac application. I am facing some issues when I am trying to implement this. I am currently working on Linux MN and I am facing an issue , we are not receiving some packets properly. On debugging this issue , we understood that the Rx interrupt is being triggered even when no packets are being received. But when I comment out the the Powerlink task in my application , my Rx and Tx is working fine. But when I add the Powerlink task the Rx interrupt is triggered even when no Ethernet cable is connected.
Below are the tasks that I am having in my application ,their priorities and the scheduling policies:-
Rx task – 95 (RR)
Tx task – 90 (RR)
Openmac task – 85 (RR)
Powerlink task – 85 (RR)
Kernel event task – 85 (FIFO)
User event task – 75(FIFO)
Firmware load task – 15 (RR)
Debug task – 1 (RR)
RR-Round Robin
FIFO – First In First Out
The Powelink layer uses a circular buffer which is used to post any event that occurs in the layer and is used as a mechaism to communicat ebetween various tasks.
Following are the debugging activities I have done and all these activities are done without connecting any ethernet cable :-
1) Printing the status of the SRSR0 register before and after the memcpy to circular buffer.
intc base+280 before memcpy in writedata = 80
intc base+200 before memcpy in writedata = 80
intc base+280 after memcpy in writedata = 80
intc base+200 after memcpy in writedata = 200080
2) On commenting the memcpy, the interrupt was not triggered.
3) The circular buffer used for memcpy is obtained by the mmap( ) function.
pInstance_p->pCircBuf = mmap(NULL, *pSize_p, PROT_READ | PROT_WRITE, MAP_SHARED,
pArch->fd, pageSize);
4) devmem2 0x4A320200
Memory mapped at address 0xb6fda000.
Read at address 0x4A320200 (0xb6fda200): 0x00200080
This log is obtained after wait_interrupt( ) in RX ISR
I think the 200080 value corresponds to TX but I am getting this value in the RX ISR.
Why am I getting such a behaviour. Looking forward for your support at the earliest.
Regards
Paramesh