no <sys/stat.h> and <sys/types.h>
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: no <sys/stat.h> and <sys/types.h>
Following is the ip settings of my lwipthread.h
Code: Select all
/** @brief IP Address. */
#if !defined(LWIP_IPADDR) || defined(__DOXYGEN__)
#define LWIP_IPADDR(p) IP4_ADDR(p, 192, 168, 8, 20)
#endif
/** @brief IP Gateway. */
#if !defined(LWIP_GATEWAY) || defined(__DOXYGEN__)
#define LWIP_GATEWAY(p) IP4_ADDR(p, 192, 168, 8, 1)
#endif
/** @brief IP netmask. */
#if !defined(LWIP_NETMASK) || defined(__DOXYGEN__)
#define LWIP_NETMASK(p) IP4_ADDR(p, 255, 255, 255, 0)
#endif
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: no <sys/stat.h> and <sys/types.h>
Hi,
I would double check the settings of I/O pins and PHY-related clocks. The lwIP demos are working on several boards I have, the problem must be specific of your setup.
Giovanni
I would double check the settings of I/O pins and PHY-related clocks. The lwIP demos are working on several boards I have, the problem must be specific of your setup.
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
Ok, I will try to read/write frames without lwIP. At the other side, I havn't setup any clocks of PHY. Which file contains the code of PHY clocks setup.
Delphi
Delphi
Re: no <sys/stat.h> and <sys/types.h>
My phy board is from waveshare. The pins it provided should be MII. But i read some post say MII is using 25MHz crystal buy my board come with a 50MHz crystal. Should I configure it to RMII? Sorry that I know not much about MII and RMII.
Delphi
Delphi
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: no <sys/stat.h> and <sys/types.h>
Can't help, you should be able to understand that from the PHY board schematic and how it is connected to the Discovery, BTW, keep wires *very* short.
Why don't you get one of the supported boards? this one for example: https://www.olimex.com/Products/ARM/ST/ ... e-hardware
Giovanni
Why don't you get one of the supported boards? this one for example: https://www.olimex.com/Products/ARM/ST/ ... e-hardware
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
Yea, I checked with the schematic of my PHY board and read some articles about MII and RMII. I am pretty sure RMII needs to be used for my PHY board and double checked the wire connections.
Then i try to read the raw incoming frame data from MAC. Can you tell if the following code can do so? If no, what is the proper way to read raw incoming frame from MAC.
Thanks.
Delphi
Then i try to read the raw incoming frame data from MAC. Can you tell if the following code can do so? If no, what is the proper way to read raw incoming frame from MAC.
Thanks.
Delphi
Code: Select all
static WORKING_AREA(waTH21,128);
static msg_t thFunc_MAC(void *arg)
{
MACConfig MACConf;
static uint8_t MAC_addr[6];
msg_t msg;
MACReceiveDescriptor rdp;
size_t len;
uint8_t buf[1500];
MAC_addr[0] = 0xAA;
MAC_addr[1] = 0x55;
MAC_addr[2] = 0x13;
MAC_addr[3] = 0x37;
MAC_addr[4] = 0x01;
MAC_addr[5] = 0x10;
MACConf.mac_address = MAC_addr;
macStart (ÐD1, &MACConf);
while(true)
{
if(macPollLinkStatus (ÐD1))
palSetPad(GPIOD, GPIOD_LED6);
else
palClearPad(GPIOD, GPIOD_LED6);
msg=macWaitReceiveDescriptor (ÐD1, &rdp,TIME_IMMEDIATE );
if(msg==RDY_OK)
{
len=mac_lld_read_receive_descriptor(&rdp,buf,1500);
sdWrite(&SD3, buf, len);
macReleaseReceiveDescriptor (&rdp);
}
}
}
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: no <sys/stat.h> and <sys/types.h>
It looks OK except you use a LLD function, you should use the high level equivalent.
Giovanni
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
cool , I can read the ARP request from my computer when i am pinging the board now. I can sure the clock and the RX part of RMII is no problem now. I will then try to write raw frames to MAC by following codes.
Do I need to release the Transmitt Descriptor after i wrote it?
Delphi
Code: Select all
MACTransmitDescriptor tdp;
msg=macWaitTransmitDescriptor (ÐD1, &tdp,TIME_IMMEDIATE );
len= macWriteTransmitDescriptor (&tdp,buf,len);
Do I need to release the Transmitt Descriptor after i wrote it?
Delphi