no <sys/stat.h> and <sys/types.h>
Moderators: RoccoMarco, lbednarz, tfAteba
no <sys/stat.h> and <sys/types.h>
Hello,
I am trying to use lwip. It's seems need the syscalls.h in various folder. However, the syscalls.h requests <sys/stat.h> and <sys/types.h> which are not available in my keil MDK environment.
Can someone help?
Delphi
I am trying to use lwip. It's seems need the syscalls.h in various folder. However, the syscalls.h requests <sys/stat.h> and <sys/types.h> which are not available in my keil MDK environment.
Can someone help?
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>
You should not use syscalls.h, it is for newlib support.
Giovanni
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
But there is a lot of function call needed by the files of lwip are in sys calls.h. I attached a linking error list. Any idea?
Delphi
Delphi
- Attachments
-
- 08A0D078-0F20-40CD-AE53-AC4B6AB315A5.png (35.72 KiB) Viewed 9549 times
- 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>
You are not including all the required files, open an existing demo and look at the makefiles.
Giovanni
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
Giovanni, Thanks for your advice. After I read the makefiles from the demo, I can compile my codes without error but it doesn't work. And there is a thread which is blinking the leds also stopped.
I try to make it simple and clear. I go back to my previous project which blinking leds in separate threads only(no LWIP in this project). once i turn the HAL_USE_MAC to TRUE, the leds don't blink.
And the leds blink again when i set the HAL_USE_MAC to FALSE. Any idea?
Delphi
I try to make it simple and clear. I go back to my previous project which blinking leds in separate threads only(no LWIP in this project). once i turn the HAL_USE_MAC to TRUE, the leds don't blink.
And the leds blink again when i set the HAL_USE_MAC to FALSE. Any idea?
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>
Using the debugger, where it stops while enabling the MAC? most likely during PHY initialization. What board are you using? are your board files configured correctly for the PHY you are using?
Giovanni
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
My board is STM32F4 Discovery and the PHY is DP83848. Should I set the Alternative function by my self or the init function of MAC will set for me? Will try debug tool tomorrow since it is almost mid-night in Hong Kong. Thanks anyway.
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>
Drivers never change pin settings by themselves, you need to create board files or change the settings at runtime.
Probably if you search the forum you will find board files for that combination (google search recommended, the forum search is broken).
Giovanni
Probably if you search the forum you will find board files for that combination (google search recommended, the forum search is broken).
Giovanni
Re: no <sys/stat.h> and <sys/types.h>
I did some debug and setups in board.h today. Well the LEDs blink again, but the board still doesn't reply ARP when i ping it. I read the codes in lwipthread.c, at the bottom of the file there is a switch case for determinate if the frame is IP frame or ARP frame,but it looks doesn't handle any. Should i add codes here? or Am I miss anything?
Delphi
Delphi
Code: Select all
switch (htons(ethhdr->type)) {
/* IP or ARP packet? */
case ETHTYPE_IP:
case ETHTYPE_ARP:
#if PPPOE_SUPPORT
/* PPPoE packet? */
case ETHTYPE_PPPOEDISC:
case ETHTYPE_PPPOE:
#endif /* PPPOE_SUPPORT */
/* full packet send to tcpip_thread to process */
if (thisif.input(p, &thisif) == ERR_OK)
break;
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
default:
pbuf_free(p);Re: no <sys/stat.h> and <sys/types.h>
I tried to comment out the lwipthread and wrote a test thread to check if the MAC driver is well configured. The thread init the MAC 's hard address and poll the link status then show on the LEDs. My code shown below
It works. Once I plug the lan cable into the PHY the LED on, and it off when i unplug the cable. I am pretty sure my board files are configured properly. However, the LWIP still don't work. Anyone help?
Delphi
Code: Select all
static WORKING_AREA(waTH21,128);
static msg_t thFunc_MAC(void *arg)
{
MACConfig MACConf;
MACConf.mac_address[0] = 0xAA;
MACConf.mac_address[1] = 0x55;
MACConf.mac_address[2] = 0x13;
MACConf.mac_address[3] = 0x37;
MACConf.mac_address[4] = 0x01;
MACConf.mac_address[5] = 0x10;
macStart (ÐD1, &MACConf);
while(true)
{
if(macPollLinkStatus (ÐD1))
palSetPad(GPIOD, GPIOD_LED6);
else
palClearPad(GPIOD, GPIOD_LED6);
}
}
It works. Once I plug the lan cable into the PHY the LED on, and it off when i unplug the cable. I am pretty sure my board files are configured properly. However, the LWIP still don't work. Anyone help?
Delphi