Hi,
I use idkam437x with ccs 6.1.2, sysbios 6.45.1.29, sdk 2.1.1.2 and ndk 2.24.3.35.
By the use of ethernet_mac example from sdk packet I established two IP addresses at PHYs connected to PRU0 and PRU1 - a suitable comment is displayed at the console that Networks were added and ping test to both gives the good result.
Now, I would like to add function that handles the data sent through ethernet connection. Based on wiki introduction I added the following definition of callback function to handle the packets of priority higher than for ICSS_EMAC_QUEUE3 value:
/*Packet processing callback*/ ((((ICSS_EmacObject*)icssEmacHandle->object)->callBackHandle)->rxRTCallBack)->callBack = (ICSS_EmacCallBack)processProtocolFrames; ((((ICSS_EmacObject*)icssEmacHandle->object)->callBackHandle)->rxRTCallBack)->userArg = icssEmacHandle;
Now, the definition of processProtocolFrames() function uses the ICSS_EmacRxPktGet() function to copy the data into appropriate location. Then, some questions appear:
1. Should the above scheme be supplemented by anything? E.g. do I also need to open a socket for data transmission? I read that they are needed only for non-real time operations so the above should be sufficient for me.
2. I cannot check its operation - ping test does not trigger my processProtocolFrames() function (and I think its correct as it uses only transmission layer). Can I use one of winapps in ndk packet to do that: e.g. send, testudp etc?
3. When using ICSS_EmacRxPktGet() function I need to specify the port on which the data was sent. What if I do not know which port was used by the PC?
4. processProtocolFrames() is specified in icssEmacHandle as RTcallback function with one argument defined by userArg pointer. However, in the definiton of processProtocolFrames() in wiki, the first argument of the function is uint32_t* queue_number. Is it a general rule, that the gueue number is passed to callback functions somehow?
Thank you in advance for your help - the ethernet examples and most of the APIs are quite unclear for me.
JJ