Background:We have a RX72N microcontroller on an own hardware platform and are using both ethernet controllers in it. They are each connected to an own PHY.We would like to use the option to forward/relay packets between these two ethernet ports so it acts like a simple switch.I have set-up a project with e2studio and the smart configurator using FreeRTOS including FreeRTOS+TCP and added the software components ‘r_ether_rx’ and ‘r_ptp_light_rx’.The ‘r_ether_rx’ component is configured so it matches the hardware using RMII.
Situation:Our own hardware platform with the RX72N controller is used between 2 Windows computers and its main function is to act like a simple switch. Let’s call the first computer ‘PC1’, the second computer ‘PC2’ and the hardware platform with the RX72N controller in between ‘HW72N’.The PTP light interface can be set in two transfer modes, cut-through mode (CT_THR) or store and forward mode (ST_FOR).After starting the software that configures the RX72N controller with both ethernet ports, then resets PTP (R_PTPL_Reset()), initializes the PTP (R_PTPL_Init()), sets promiscuous mode on and then select the transfer mode to both direction enabled (using function R_PTPL_SetTran()) data can be exchanged between the two ethernet ports.
Part of source code in NetworkInterface.c:
/* ==== Set PTP configuration ==== */ /* Reset EPTPC */ R_PTPL_Reset(); /* Initialize EPTPC */ ptpl_ret = R_PTPL_Init(&ptplc); if (PTPL_OK != ptpl_ret) { return pdFALSE; } for (ch = 0; ch < NUM_CH; ch++) { /* Set promiscuous mode */ pcuous.channel = ch; pcuous.bit = ETHER_PROMISCUOUS_ON; ectrl.p_ether_promiscuous = &pcuous; R_ETHER_Control(CONTROL_SET_PROMISCUOUS_MODE, ectrl); /* Clear extended promiscuous mode */ R_PTPL_SetExtPromiscuous(ch, false); /* Set frame filter */ R_PTPL_SetSyncConfig(ch, &fil1, &fil2, NULL, NULL); } /* Set transfer mode to cut-through mode (CT_THR) or Store and forward mode (ST_FOR) */ //mode = CT_THR; mode = ST_FOR; /* Set relay enable both directions */ dir = ENAB_BT; /* ==== Set inter ports transfer mode ==== */ ptpl_ret = R_PTPL_SetTran(&mode, &dir); if (PTPL_OK != ptpl_ret) { return pdFALSE; }
2 problems:
1. When using the ‘cut-through’ mode (CT_THR) I can start a transfer of a file from PC1 to PC2 with HW72N in between, but it stops after a few seconds. Most of the time within a second. Biggest problem is that this isn’t recovered by waiting a few minutes. The forward mode just stops and can only be recovered by restarting the HW72N module. However, when starting a transfer again it repeats itself, and stops again after a few seconds.To be sure it wasn’t my own software that causes this issue I connected e2studio with a debugger (e2lite) and, when HW72N was correctly initialized, I paused my software with the debugger. Forwarding was still available (because this is processed by the hardware (EPTPC)). However when starting the 1GB binary file transfer again it exactly has the same behavior.My question is, what can cause this problem? Is it an incorrect setting in a register?
2. When using the ‘Store and forward’ mode (ST_FOR) I can transfer a 1GB binary from PC1 to PC2 with HW72N in between. This works fine, however I see in Wireshark that there are retries/retransmissions with the 1GB binary. With another switching module (not a RX72N) there are no retries/retransmissions. It this a known issue?
Hi There,
Thanks for your question online and our apologies for the late response.
Let us check this and will get back to you.
Best regards,
PM_Renesas
Any progress on my issues yet? RX72N is now on a prototype, we need to know what causes these issues.
My apologies for the delayed response. I have forwarded it to your local disti and I have asked you to reach out to you directly. So, will reach out to you offline from the forum.