SK-S7G2 Ethernet Connection reliability test

s7g2

#1

Hello

I have created a very basic test project to understand network connection reliability of SK-S7G@ board
using XWare->Netx Due->protocol->DHCP IPV4 Client, and network driver is Ethernet (LAN) added.

My configuration screenshot as below,

Use any of GUIX project to display board IP address. This LAN IP address assigned by Router.
Once you find IP address assigned for board, On PC command line window type network test command

ping board_ipaddress -t. For example, my board IP address is 192.168.0.114

c:>ping 192.168.0.114 -t

This will display following results,

Reply from 192.168.0.114: bytes=32 time=1ms TTL=128
Reply from 192.168.0.114: bytes=32 time=1ms TTL=128
Reply from 192.168.0.114: bytes=32 time<1ms TTL=128
Reply from 192.168.0.114: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.102: Destination host unreachable. ****** THIS IS NOT GOOD *****
Reply from 192.168.0.1: Destination host unreachable.

This shows some reason S7G2 Ethernet not responding to ICMP packets after few minutes. Once failed like this you have reset the power to work again. That also only works few seconds to minutes.

Source code for this test below


/************************** CONFIGURATION NOTE /
//Ethernet channel 1
//Reset port : 08_06 SK-S7G2 board
/
*********************************************/

/* Network Thread entry function */
void ethernet_thread_entry(void)
{

/* LED type structure */
bsp_leds_t leds;

/* LED state variable */
ioport_level_t level = IOPORT_LEVEL_HIGH;

/* Get LED information for this board */
R_BSP_LedsGet(&leds);
g_ioport.p_api->pinWrite(leds.p_leds[0], level);
g_ioport.p_api->pinWrite(leds.p_leds[1], level);


char *ip_name      = NULL;
UINT actual_status = NX_IP_INITIALIZE_DONE;
ULONG link_status  = NX_IP_INITIALIZE_DONE;

//to switch on/off LED without IF/ELSE
bool level_state = true;

nx_system_initialize();
tx_thread_sleep (10);


UINT status = 0;
ULONG ip_mask, ip_mtu, ip_mac1, ip_mac0, ip_status = 0;

while (1) {

    status = nx_ip_interface_status_check(&g_ip0, 0, NX_IP_LINK_ENABLED, &link_status, 100);
    if (status != NX_SUCCESS) {
        lan_ip_address = 0;
        link_status  = NX_IP_INITIALIZE_DONE;

        //set RED LED on
        g_ioport.p_api->pinWrite(leds.p_leds[1], 0);
        while (status != NX_SUCCESS) {
            tx_thread_sleep (100);
            status = nx_ip_interface_status_check(&g_ip0, 0, NX_IP_LINK_ENABLED, &link_status, 100);
            level_state = !level_state;
            g_ioport.p_api->pinWrite(leds.p_leds[2], level_state);

        }

        //once LINK is up stop DHCP and start
        status = nx_dhcp_stop(&g_dhcp_client0);
        tx_thread_sleep (100);
        status = nx_dhcp_start(&g_dhcp_client0);

        //Check IP address resolved from router
        actual_status = NX_IP_INITIALIZE_DONE;
        nx_ip_status_check(&g_ip0, NX_IP_ADDRESS_RESOLVED, &actual_status, 100);
        while ((actual_status & NX_IP_ADDRESS_RESOLVED) == NX_IP_ADDRESS_RESOLVED) {
            tx_thread_sleep (100);


            nx_ip_status_check(&g_ip0, NX_IP_ADDRESS_RESOLVED, &actual_status, 100);
            level_state = !level_state;
            g_ioport.p_api->pinWrite(leds.p_leds[2], level_state);
        }
        lan_ip_address = 0;
        while (lan_ip_address == 0) {
            nx_ip_interface_info_get(&g_ip0, 0, &ip_name, &lan_ip_address, &ip_mask, &ip_mtu,
                         &ip_mac1, &ip_mac0);
            tx_thread_sleep (100);
            level_state = !level_state;
            g_ioport.p_api->pinWrite(leds.p_leds[2], level_state);
        }
        g_ioport.p_api->pinWrite(leds.p_leds[1], 1);
    }
    level_state = !level_state;
    g_ioport.p_api->pinWrite(leds.p_leds[0], level_state);
    tx_thread_sleep (100);
}

}


Same question posted on “Renesas Syenrgy Forum”,
http://renesasrulz.com/synergy/f/synergy---forum/8206/sk-s7g2-ethernet-connection-reliability-test

Thanks
Mariya


#2

Renesas forum community confirmed that SSP1.2.0 release has bug with network driver level code. IF you add any network driver (Xware frameworks) there will be packet_pool_netx added and default value is 640 bytes 16 such a packets.

This default value or anything lower than 1568 bytes cause network link to failure on the board. i.e. board system goes infinite loop and never comeback.

if any production level code uses default value like this 640bytes and any network communication to device cause problem.

So fix is make sure always use 1568 bytes (32 byte alignment) in the configuration.

Case solved


#3

Wow, thanks for this critical information!


#4

It is Craig. As default value that should be verified by Renesas quality control team, some how they left out this bug. Not sure they already know internally or based on my test.

Do you know what mean by channel as we can see many driver/framework required to set correct channels. Do we know where to learn this ?