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);
}

Parents
  • みみみさん

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

    RXマイコンや関連ソフトを担当しております。
    本件ですが、PHYチップとの通信に用いるPHYアドレスの設定(RX71Mマイコン側ソフト)が怪しいです。

    セミナー資料を添付します。

    以下のURLからダウンロードしてください:
    <upload.hdedrive.com/.../SB1538049512-d48bd5d6-5c00-416b-8444-d5c03c924aac>
    ダウンロードパスワード: Dn/9JhmJ5XVP
    URLの有効期限: 2018年10月11日 午後8時59分

    page156にGR-SAKURAにおけるPHYアドレスの解説を書いてありますので参考にしてください。
    あと貼って頂いたMPCの設定も、実験に使っているボードの実際の配線と合致しないと
    PHYチップとの通信がうまくいかずlan_open()失敗します。

    逆にPHYアドレスの値とMPCの設定がただしければlan_open()を正常終了で抜けてきます。
    ここまでこればTCP/IP通信も動くと思います。動かなければまたご質問ください。

    以上です
  • Hi !シェルティ,
    I read to you provide Information,page 93~page 105,but I can ping 192.168.0.3

    why?
    thank you for your help
  • jg-san,
    Hello.

    > but I can ping 192.168.0.3
    Do you mean ping failed??

    How about open API?
    To where you have seen it is working and from where it is not working?

  • Hi !  ,

     

    ・開発環境

    CPU:RX64M 176pin

    統合開発環境:e2studio v7.0

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

    デバッガ:E1

     

    images are  setting and  result

       

  • jg-san,
    Thank you.
    However, it seems too hard to implement the driver all by yourself.

    Please try using "FIT configurator" as follows:
    1. Launch e2 studio
    2. Create a new RX64M project, configure C language spec as C99, remove ./generate/*.c files (need only ./generate/iodefine.h)
    3. Open FIT Configurator (If no such views, you'll find it in "Renesas Views")
    4. Add FIT module named r_t4_rx and add all other dependency modules (r_bsp, r_ether_rx, r_sys_time_rx).
    5. Press "Generate Code" and build

    Please also see related documents found at <project_folder>/r_t4_rx/doc/.
    Hope it works.

  • HI! ほや,
    How can use FIT api in the main.c .
    Have sample ?
    Thank you for your help
  • jg-san,

    FIT module r_t4_rx doesn't work alone. It works together with other related modules.
    I don't think you can (and me neither) make it work in main.c.

    If you use Smart Configurator, you need to use the way it is, or use FIT configurator as I told.

  • Hi ほや,

    I use FIT and I can't solve  this error.

    What am I missing api or setting?

    thank you for your help.

  • 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
Reply
  • 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
Children
No Data