PING is not stable after porting RTCS ,help.

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

PING is not stable after porting RTCS ,help.

623 Views
tim4146
Contributor I

After porting the MQX3.7 to  K60MK60DN512ZVLQ10 ,I "PING" to MCU and find that:

1 when connecting K60 to PC in OFFICE ,"PING" is OK ,even UDP is OK .

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.

178805_178805.jpg0.jpg

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

Tags (2)
0 Kudos
4 Replies

424 Views
tim4146
Contributor I

phy ship is KSZ4041

0 Kudos

424 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Yong

Which board you are using, TWR-K60N512 or TWR-K60D100M board, or custom board?

Regards

Daniel

0 Kudos

424 Views
tim4146
Contributor I

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!

0 Kudos

424 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos