RX71M TCP/IP M3S-T4-Tinyサンプルプログラムのlan_open()でエラー

お世話になっております。

RX71MとLAN8710をRMIIで配線した基板で、TCP/IP M3S-T4-Tinyサンプルプログラムを組み込んだところ、main() -> lan_open()でエラーが返ってきてしまい先に進めなくなってしまいました。

(phy_init関数内でタイムアウトエラーとなっているようでした)

他社製のTCP/IPプロトコルスタックのライブラリを使用したプログラムではRMIIでTCP/IP通信が行えていますので、ハードウェアは問題ないと考えています。

何が原因かわかりますでしょうか?

 

・サンプルプログラム入手先

https://www.renesas.com/jp/ja/software/D6000791.html

 

・開発環境

CPU:RX71M 176pin

統合開発環境:e2studio v6.3.0

コンパイラ:CC-RX v2.08.00

デバッガ:E1

 

・サンプルプログラム変更箇所

\rx71m_rsk\r_config\r_ether_rx_config.hのdefineを変更

#define ETHER_CFG_MODE_SEL 1

#define ETHER_CFG_USE_LINKSTA 0 
 
\rx71m_rsk\r_pincfg\r_pinset.cに以下を追加

/***********************************************************************************************************************
* Function Name: R_ETHER_PinSet_ETHERC0_RMII
* Description : This function initializes pins for r_ether_rx module
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
void R_ETHER_PinSet_ETHERC0_RMII()
{
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_MPC);

/* Set REF50CK0 pin */
MPC.P76PFS.BYTE = 0x12U;
PORT7.PMR.BIT.B6 = 1U;

/* Set RMII0_TXD_EN pin */
MPC.P80PFS.BYTE = 0x12U;
PORT8.PMR.BIT.B0 = 1U;

/* Set RMII0_TXD1 pin */
MPC.P82PFS.BYTE = 0x12U;
PORT8.PMR.BIT.B2 = 1U;

/* Set RMII0_TXD0 pin */
MPC.P81PFS.BYTE = 0x12U;
PORT8.PMR.BIT.B1 = 1U;

/* Set RMII0_RXD1 pin */
MPC.P74PFS.BYTE = 0x12U;
PORT7.PMR.BIT.B4 = 1U;

/* Set RMII0_RXD0 pin */
MPC.P75PFS.BYTE = 0x12U;
PORT7.PMR.BIT.B5 = 1U;

/* Set RMII0_RX_ER pin */
MPC.P77PFS.BYTE = 0x12U;
PORT7.PMR.BIT.B7 = 1U;

/* Set RMII0_CRS_DV pin */
MPC.P83PFS.BYTE = 0x12U;
PORT8.PMR.BIT.B3 = 1U;

/* Set ET0_MDC pin */
MPC.P72PFS.BYTE = 0x11U;
PORT7.PMR.BIT.B2 = 1U;

/* Set ET0_MDIO pin */
MPC.P71PFS.BYTE = 0x11U;
PORT7.PMR.BIT.B1 = 1U;

R_BSP_RegisterProtectEnable(BSP_REG_PROTECT_MPC);
}

/***********************************************************************************************************************
* Function Name: R_ETHER_PinSet_ETHERC1_RMII
* Description : This function initializes pins for r_ether_rx module
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
void R_ETHER_PinSet_ETHERC1_RMII()
{
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_MPC);

/* Set REF50CK1 pin */
MPC.PG0PFS.BYTE = 0x15U;
PORTG.PMR.BIT.B0 = 1U;

/* Set RMII1_TXD_EN pin */
MPC.P60PFS.BYTE = 0x15U;
PORT6.PMR.BIT.B0 = 1U;

/* Set RMII1_TXD1 pin */
MPC.PG4PFS.BYTE = 0x15U;
PORTG.PMR.BIT.B4 = 1U;

/* Set RMII1_TXD0 pin */
MPC.PG3PFS.BYTE = 0x15U;
PORTG.PMR.BIT.B3 = 1U;

/* Set RMII1_RXD1 pin */
MPC.P95PFS.BYTE = 0x15U;
PORT9.PMR.BIT.B5 = 1U;

/* Set RMII1_RXD0 pin */
MPC.P94PFS.BYTE = 0x15U;
PORT9.PMR.BIT.B4 = 1U;

/* Set RMII1_RX_ER pin */
MPC.PG1PFS.BYTE = 0x15U;
PORTG.PMR.BIT.B1 = 1U;

/* Set RMII1_CRS_DV pin */
MPC.P92PFS.BYTE = 0x15U;
PORT9.PMR.BIT.B2 = 1U;

/* Set ET1_MDC pin */
MPC.P31PFS.BYTE = 0x14U;
PORT3.PMR.BIT.B1 = 1U;

/* Set ET1_MDIO pin */
MPC.P30PFS.BYTE = 0x14U;
PORT3.PMR.BIT.B0 = 1U;

R_BSP_RegisterProtectEnable(BSP_REG_PROTECT_MPC);
}

  • jg-san,

    It's because you have two startup codes.
    Smart Configurator and FIT can't use together.
    BTW, sample code is available here:
    https://www.renesas.com/jp/ja/products/software-tools/software-os-middleware-driver/protocol-stack/m3s-t4-tiny-for-rx.html

  • Hi jg-san

    Thank you for using RX64M.

    I think first of your trial is near correct state.
    japan.renesasrulz.com/.../_F764D653_5.PNG

    Please confirm following 2 point of view.

    1) MPC settings on "pins" tab on Smart Configurator
    RX64M has pins with multi function. So user needs to set MPC (Multi function Pin Controller) to bind the function to each pins.
    I think you use your original board and your pin (MPC) settings on Smart Configuration is not corresponding to your board.
    Could you confirm your board circuit and RX64M user's manual MPC setting section?

    2) PHY-LSI address settings on "r_ether_rx" on "components" tab on Smart Configurator
    "r_ether_rx" has value to set the PHY-LSI address. Please confirm your PHY-LSI by confirming your PHY-LSI on your board.

    If you would set correct setting to MPC, lan_open() will return 0 (=OK).
    You would be able to confirm Ping behavior after this.

    If you have RX64M Renesas Starter Kit board, you do not need to setup your TCP/IP code.
    As ほや-san said, you can download assembled project from following download link.
    www.renesas.com/.../m3s-t4-tiny-for-rx.html

    Best Regards,
    Shelty.
  • Hi! シェルティ,

    thank you for your reply!

    I read Multi function Pin Controller ,I have question .

     

    The PHY LSI address ether0 value is 0 or 30?                  Am I MII0 setting  ports  this right?

     

    Thank you for your help!

  • Hi jg-san

    Sorry for my late reply.

    >>The PHY LSI address ether0 value is 0 or 30?

    I cannot judge because I do not know your board circuit.
    PHY_LSI address is set by external pins or internal pins of PHY_LSI.
    Please confirm your PHY_LSI datasheet in more carefully.

    >>Am I MII0 setting ports this right?

    I think OK.
    LINKSTA and EXOUT are not needed.
    And please confirm "pins" (端子) tab on you smart configurator.
    "pins" (端子) settings are needed to set fitting your board circuit.
    Please also confirm your board circuit. It is important to confirm connection from RX64M to PHY_LSI and
    what RX64M pins are used for Ethernet MII spec.

    Best Regards,
    Shelty
  • シェルティさん

    こんにちは、SMと申します。

    RX65Nになりますが、みみみさんと同様にTCP/IP M3S-T4-Tinyサンプルプログラムを組み込んだところlan_open()でエラーが返ってきており原因調査をしております。

    この投稿に記載の"セミナー資料"を拝見したいのですが、再度添付して頂けないでしょうか。

    宜しくお願い致します。

  • SMさん

    シェルティです、こんにちは。

    すみません返信が遅くなりました。申し訳ありません。

    セミナ資料をGitHubのRX72N Envision Kitの解説wikiの中のT4のページにアップしておきました。

    https://github.com/renesas/rx72n-envision-kit/wiki/1-Ether-TCP-IP#%E3%82%BB%E3%83%9F%E3%83%8A%E8%B3%87%E6%96%99

    lan_open()でエラーとのことなので、マイコン-PHYチップ間の通信がうまくいってないように思いますね。マイコン側の端子設定(具体的に言うとMPCというマイコン機能)において間違っているところがあると、lan_open()でエラーになることがあります。

    以上です

  • シェルティさん

    SMです、こんにちは。

    ご対応頂き、誠にありがとうございます。

    拝見させて頂きます。

    当方、イーサネット通信を実装するのは初めてでして、いろいろ調査した結果、回路構成から問題がありました。

    通信の検証はしばらく先になるかと思いますが、また問題が発生したら質問させてください。

    以上です。