2 Then bing a switchboard between them,"PING" is not stable, often come to a timeout.
3 connect two PC each at home ,PING is not stable,often come to a timeout.That's impenetrable~
I have explored this issue for 2 days,and still can't work out.
Key CODE shows below:
#define ENET_IPADDR IPADDR(192,168,1,4)
#define ENET_MASKADDR IPADDR(255,255,255,0)
#define ENET_GATEWAYADDR IPADDR(192,168,1,1)
#define DEMOCFG_DEFAULT_DEVICE BSP_DEFAULT_ENET_DEVICE
void hello_task(uint_32 initial_data)
{
printf("RTSC ICMP IS CONFIG ing... PAGE-312\r\n");
int_32 error;
_enet_address address;//mac eq char[6]
IPCFG_IP_ADDRESS_DATA ip_data;
ip_data.ip = ENET_IPADDR;
ip_data.mask = ENET_MASKADDR;
ip_data.gateway = ENET_GATEWAYADDR;
//step1:create RTCS
error = RTCS_create();
if(error == RTCS_OK)
{
printf("RTCS_create is OK\r\n");
}
else
{
printf("Failed!!");
_task_block();
}
//step2:get mac to address
if(1 == ENET_get_mac_address(DEMOCFG_DEFAULT_DEVICE, ip_data.ip, address))
{
printf("ENET_get_mac_address is OK\n ");
}
else
{
printf("Failed!!");
_task_block();
}
//step3:INIT PHY
error = ipcfg_init_device(DEMOCFG_DEFAULT_DEVICE,address);
if (error == 0)
{
printf (" init ethernet device OK \n");
}
else
{
printf("Failed!!");
_task_block();
}
//step4:bind ip
error = ipcfg_bind_staticip(DEMOCFG_DEFAULT_DEVICE,&ip_data);
if(error == IPCFG_OK )
{
printf("Bind OK \n");
}
else
{
printf("Failed!!");
_task_block();
}
while(1)
{
GPIO_ToggleBit(HW_GPIOE, 6);//ToggleLED
_time_delay(200);
}
Project is compiled in IAR 6.30, MQX version is 3.7.
Original Attachment has been moved to: MQX_3_7_20170307ping_not_OK.rar
phy ship is KSZ4041
Hi Yong
Which board you are using, TWR-K60N512 or TWR-K60D100M board, or custom board?
Regards
Daniel
sry for delayed reply ,my lovely boy is just 36 days old .I have little time to open my PC these days。。
I use a custom board, all the pins of 8041 ship on board are confirmed according to the PCB. CLOCK frequency is changed based on the board 50Mhz.
I thought it should be easy to porting MQX on my board since the default PHY ship is kzs8041 in MQX 3.7.However....
Is it possible if I ignored something that need to be changed ?
THX for your help very much!
Congratulations, Yong! Wish your baby a healthy and happy life:)
Since ping is OK at office and timeout at home, I would suggest check if there is IP address conflict, or MAC address conflict?
Regards
Daniel