HI,                I am a basic level programer in MCF528...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HI,                I am a basic level programer in MCF528...

3,434 Views
venki_02
Contributor I

HI,
               I am a basic level programer in MCF5282. I have been getting confusion about the functionalities of FEC(Fast Ethernet Controller).
              My  confusion is that whether FEC  generate IP address or not. If anybody knows about the
 functionalities of  FEC and IP address generation or any related programs. Please suggest me
in this regard would be helpful for My project requirement.
                                                                                                      
venkat

Labels (1)
0 Kudos
Reply
7 Replies

870 Views
mccPaul
Contributor I
Hi
 
The FEC doesn't generate any addresses. It is a low level device that will either take a properly constructed Ethernet frame from memory and will transmit it to physical interface to the Ethernet, or it will receive a frame from the Ethernet and store it in memory.
 
An Ethernet frame contains a header that describes the content of the frame and also contains MAC addresses for the source and destination of the frame.
 
The content of the frame may be an IP packet, in which case the frame header will be followed by an IP header. This may then be followed by a UDP header, and so on. This site has some good descriptions of the various headers:
 
 
Also try Wikipedia.
 
The MAC address is a hardware level address, which you can make up yourself for testing. For a product that is distributed, you need to use a registered MAC address, to ensure that you do not conflict with any other device.
 
The IP address is provided by the TCP/IP stack and will be set by the user or by DHCP.
 
Cheers,
 
Paul.
0 Kudos
Reply

870 Views
venki_02
Contributor I
HI.
    Mr paul
                  
           I have problem with FEC driver creation. I use MCF5282.  I've simplified driver and now it's just initialization function then I've not idea for Tx and Rx data to external devices via tranceiver.
       
          If you have any program for thit please help me that  helpful to my project. I am expecting for your
suggestion. 
 
 
             venkat
 
     
0 Kudos
Reply

870 Views
venki_02
Contributor I
HI.
    Mr paul
                  
           I have studied FEC in 5282 as well as getting driver program from forums.freescale.
  Now, I am trying  to write FEC program for Tx the vedio signal to the FEC  hardware.

          In my project is that how to Tx  vedio data  to hardware device like 5272,528x.....etc
  via FEC.
                  
        ->  First I check IP address of required  device needed vedio data then,
         -> I will Tx vedio data to hardware device  which IP address  matched.

  If i will have any  confusion that i will ask you.so, I agree that you are  a genius.

     Thank you
     

            venkat
 
    
0 Kudos
Reply

870 Views
venki_02
Contributor I
    HI
         Mr paul
         Mr  Joel
         Mr Alban
                       
            Whenever I am trying to compile my source code that I get a lot of errors in fec.c kernel program.
    Can anyone help me with this? .If anyone have a currect program for fec.c then please you  will give  me
    that  very helpful to my project.

     fec.c: In function ‘fec_enet_start_xmit’:
     fec.c:362: error: dereferencing pointer to incomplete type
     fec.c:363: error: expected ‘)’ before ‘fec_t’
     fec.c:363: error: dereferencing pointer to incomplete type
     fec.c:371: warning: assignment from incompatible pointer type
     fec.c:374: error: request for member ‘cbd_sc’ in something not a structu        re or union
     fec.c:378: error: dereferencing pointer to incomplete type
     fec.c:385: error: request for member ‘cbd_sc’ in something not a structu        re or union
    228 fec.c:389: error: request for member ‘cbd_bufaddr’ in something not a st        ructure or union
    229 fec.c:390: error: request for member ‘cbd_datlen’ in something not a str        ucture or union
    230 fec.c:412: error: request for member ‘cbd_sc’ in something not a structu        re or union
    231 fec.c:415: error: dereferencing pointer to incomplete type
    232 fec.c:418: error: request for member ‘fec_x_des_active’ in something not         a structure or union
      233 fec.c:422: error: request for member ‘cbd_sc’ in something not a structu        re or union
    234 fec.c:423: warning: assignment from incompatible pointer type
    235 fec.c:428: error: request for member ‘cbd_sc’ in something not a structu        re or union
    236 fec.c: In function ‘fec_timeout’:
    237 fec.c:443: error: dereferencing pointer to incomplete type
    238 fec.c:445: error: dereferencing pointer to incomplete type
    239 fec.c: In function ‘fec_enet_interrupt’:
    240 fec.c:491: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ befor        e ‘*’ token
    241 fec.c:491: error: ‘fecp’ undeclared (first use in this function)
    242 fec.c:499: error: expected ‘)’ before ‘fec_t’
    243 fec.c:499: error: dereferencing pointer to incomplete type
    244 fec.c:503: error: ‘int_events’ undeclared (first use in this function)
    245 fec.c: In function ‘fec_enet_tx’:
    246 fec.c:556: error: dereferencing pointer to incomplete type
    247 fec.c: In function ‘fec_enet_rx’:
    248 fec.c:651: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ befor        e ‘*’ token
    249 fec.c:651: error: ‘fecp’ undeclared (first use in this function)
    250 fec.c:657: error: dereferencing pointer to incomplete type
    251 fec.c:658: error: expected ‘)’ before ‘fec_t’
252 fec.c:658: error: dereferencing pointer to incomplete type
    253 fec.c:663: error: ‘bdp’ undeclared (first use in this function)
    254 fec.c:734: warning: assignment makes pointer from integer without a cast    255 fec.c:737: error: dereferencing pointer to incomplete type
    256 fec.c: In function ‘fec_enet_open’:
    257 fec.c:1465: error: dereferencing pointer to incomplete type
    258 fec.c: In function ‘fec_enet_get_stats’:
    259 fec.c:1508: error: dereferencing pointer to incomplete type
    260 fec.c: In function ‘set_multicast_list’:
    261 fec.c:1526: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ befo        re ‘*’ token
    262 fec.c:1526: error: ‘ep’ undeclared (first use in this function)
    263 fec.c:1528: error: dereferencing pointer to incomplete type
    264 fec.c:1529: error: ‘immap_t’ undeclared (first use in this function)
    265 fec.c:1529: error: expected ‘)’ before ‘IMAP_ADDR’
    266 fec.c:1531: error: dereferencing pointer to incomplete type
    267 fec.c:1534: error: dereferencing pointer to incomplete type
    268 fec.c:1540: error: dereferencing pointer to incomplete type
    269 fec.c: In function ‘fec_enet_init’:
    270 fec.c:1595: error: ‘dma_addr_t’ undeclared (first use in this function)
    271 fec.c:1595: error: expected ‘;’ before ‘mem_addr’
      re ‘*’ token
    273 fec.c:1598: error: ‘immap’ undeclared (first use in this function)
    274 fec.c:1601: error: ‘bd_t’ undeclared (first use in this function)
    275 fec.c:1601: error: ‘bd’ undeclared (first use in this function)
    276 fec.c:1606: error: ‘immap_t’ undeclared (first use in this function)
    277 fec.c:1606: error: expected expression before ‘)’ token
    278 fec.c:1608: error: expected expression before ‘)’ token
    279 fec.c:1610: warning: assignment makes pointer from integer without a cas        t
    280 fec.c:1614: error: dereferencing pointer to incomplete type
    281 fec.c:1616: error: ‘fecp’ undeclared (first use in this function)
    282 fec.c:1651: error: dereferencing pointer to incomplete type
    283 fec.c:1661: error: dereferencing pointer to incomplete type
    284 fec.c:1662: error: ‘mem_addr’ undeclared (first use in this function)
    285 fec.c:1679: error: dereferencing pointer to incomplete type
    286 fec.c:1712: warning: passing argument 2 of ‘request_irq’ from incompatib        le pointer type
    287 fec.c:1737: error: dereferencing pointer to incomplete type
    288 fec.c:1740: error: dereferencing pointer to incomplete type
    289 fec.c:1741: error: dereferencing pointer to incomplete type
    290 fec.c:1742: error: dereferencing pointer to incomplete type
    291 fec.c:1743: error: dereferencing pointer to incomplete type


    fec.c:1744: error: dereferencing pointer to incomplete type
    293 fec.c:1745: error: dereferencing pointer to incomplete type
    294 fec.c:1746: error: dereferencing pointer to incomplete type
    295 fec.c:1760: error: ‘SPRN_IMMR’ undeclared (first use in this function)
    296 fec.c:1785: error: dereferencing pointer to incomplete type
    297 fec.c:1791: error: dereferencing pointer to incomplete type
    298 fec.c: In function ‘fec_restart’:
    299 fec.c:1822: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ befo        re ‘*’ token
    300 fec.c:1822: error: ‘immap’ undeclared (first use in this function)
    301 fec.c:1826: error: ‘immap_t’ undeclared (first use in this function)
    302 fec.c:1826: error: expected expression before ‘)’ token
    303 fec.c:1831: error: ‘fecp’ undeclared (first use in this function)
    304 fec.c:1833: error: dereferencing pointer to incomplete type
    305 fec.c: In function ‘fec_stop’:
    306 fec.c:1958: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ befo        re ‘*’ token
    307 fec.c:1958: error: ‘immap’ undeclared (first use in this function)
    308 fec.c:1962: error: ‘immap_t’ undeclared (first use in this function)
    309 fec.c:1962: error: expected expression before ‘)’ token
    310 fec.c:1965: error: ‘fecp’ undeclared (first use in this function)
    311 fec.c:1971: error: dereferencing pointer to incomplete type


                           venkat




0 Kudos
Reply

870 Views
mccPaul
Contributor I
Venkat,
 
The first error in the list of errors you provide "fec.c:362: error: dereferencing pointer to incomplete type" means that on line 362 of fec.c you are referencing a struct that has not been defined.
 
For example, you are writing something like:
 
Code:
struct some_struct_type *ptr;p->member = something;

 
But you have never defined the structure like this:
 
Code:
struct some_struct_type {  int member;};

 
I suspect that you have copied source code, and you haven't copied the definitions from a header. This is a simple programming error.
 
Most, if not all, FEC drivers are written to work with the particulary network protocol stack that is in use so I doubt if anyone will have code that you can just copy into your application. As I said before, if you are not going to use an existing operating system or stack you need to fully understand the way that the FEC works to write your own driver.
 
Look at section 17.4.2 in the MCF5282 user manual, it tells you how to initialise the FEC - I know that this works. Then look at section 17.6.1 and 17.6.1.1, it tells you how to pass a buffer of data to the FEC. If you make a buffer that is a UDP packet and follow the instructions you will put a UDP packet onto the network. Use Ethereal http://www.ethereal.com/download.html to see the packets on the network.
 
Paul.
 
 
0 Kudos
Reply

870 Views
venki_02
Contributor I
HI
   Mr paul
           
          First I thank for your suggestion.
            I got  following errors while compiling my codes. Do you know why this kind of errors occur while 
            compiling my codes.
           I know that you can solve this errors.

       ----->SPRG.c  is my  source code
       ----->libgcc2.h is kernel code

////**********
this is the code in "libgcc2.h"

       #if W_TYPE_SIZE == 8
# define Wtype_MAXp1_F  0x1p8f
#elif W_TYPE_SIZE == 16
# define Wtype_MAXp1_F  0x1p16f
#elif W_TYPE_SIZE == 32
# define Wtype_MAXp1_F  0x1p32f
#elif W_TYPE_SIZE == 64
# define Wtype_MAXp1_F  0x1p64f
#else
# error "expand the table"
#endif

*************///////////

    libgcc2.h:214:3: error: #error "expand the table"

    In file included from SPRG.c:5:
    tm-m68k.h:117:7: warning: extra tokens at end of #endif directive
    SPRG.c: In function ‘main’:
    SPRG.c:166: warning: ‘struct fec_enet_private’ declared inside parameter list

                                      venkat
0 Kudos
Reply

870 Views
mccPaul
Contributor I
Hi
 
I have made a few posts on FEC driver creation - http://forums.freescale.com/freescale/tracker?user.id=3717 - this link will display all my posts, and you should be able to find a few code snippets if you search the forums and look at the resources available on Freescale's web page for the 5282..
 
You will need to understand the FEC chapter in the MCF5282 user manual before you will be able to follow any of the available source code examples. If you want to see working FEC drivers then you can look at the ColdfireLite stack or uTasker (these are for the MCF52235 but the FEC is the same) or look at the source code for dBug.
 
Cheers,
 
Paul.
 
(Edit: spelling)


Message Edited by mccp on 2007-09-18 10:30 AM
0 Kudos
Reply