This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tricky HalCoGen 04.04.00 Pinmux and Ethernet Problem

Other Parts Discussed in Thread: HALCOGEN, RM57L843, TMS570LC4357, DP83640

Thought I'd briefly write this up in case someone else runs into the same issue.

There is a checkbox on the "Pin Muxing" tab for MII in HalCoGen - shown here as checked:

I always considered these buttons as shortcuts to select all pins of a module - sometimes creating conflicts which you then have to manually
resolve based on the idea that most of the peripherals can operate with a subset of their functional pins.

However,  these devices also have a 'Special Pin Muxing' group - where the IOMM module registers are used to select some other device level configuration options that are not strictly speaking related to pin muxing.    

One of these 'Special Muxing' options is whether to tell the Ethernet MAC to operate in MII mode or RMII mode.   On the RM57L843 and TMS570LC4357 this choice is controlled by PINMUX160[24].

However - HalCoGen doesn't provide a checkbox on the "Special Pin Muxing" tab that corresponds to the choice of MII v.s. RMII.   Instead - the value of PINMUX160[24] is determined by how the MII and RMII buttons are set on the normal 'Pin Muxing" tab.

So now that we have dedicated pins for Ethernet MII mode on RM57L843 and TMS570LC4357 - it's tempting to leave these boxes unchecked if you have a board that is using the new dedicated (and also default) location for MII.     If you check the MII box,  you then have to go back and change the location of each MII pin back to the default (instead of alternate) manually - which is a pain.   You also need to make sure the change is consistent on the "Input Pin Muxing" tab.


However, if you don't check MII - HalCoGen infers that you want the MAC in RMII mode, and it will program Special Muxing  PINMUX160[24] for RMII mode.

In which case you wind up with the MAC running in RMII mode, but the MII pins selected in the pinmux - recipe for a non-working project!

So - for now you -- if you are using the new default locations for Etherent on the RM57L843 or TMS570LC4357 - you should either:

   a) check the MII box - but then manually put each MII signal back in it's default location in the muxing matrix.

   -or-

   b)   add some code in a /* USER CODE */ block to put PINMUX160[24] in the correct mode (MII/RMII) after HalCoGen may have put it in an incorrect mode.


Both are a bit tricky - if you go with (a) you need to find all the pins on the HalCoGen GUI tab.   Just a bit tedious / easy to miss one.

If you go with (b) you need to be aware that the PINMUX registers are 'locked' by kicker registers. 

It's probably best to do something like this:

/* USER CODE BEGIN (4) */

    /* Enable Pin Muxing */
    pinMuxReg->KICKER0 = 0x83E70B13U;
    pinMuxReg->KICKER1 = 0x95A4F1E0U;

    PINMUX_ETHERNET_SELECT(MII);


    /* Disable Pin Muxing */
    pinMuxReg->KICKER0 = 0x00000000U;
    pinMuxReg->KICKER1 = 0x00000000U;


/* USER CODE END */

Right at the end of HL_pinmux.c.  

Many thanks to Charles Tsai for helping to figure out what was going wrong with the pinmuxing and how to solve the problem.

  • Thanks Anthony. I see that the "Special Multiplexing" tab is eliminated and the functionality is merged with "pin muxing" tab. May be this change was only made for the other parts and left alone for the RM57x and LC43x parts.

    Regards, Sunil

  • We are working on RM57 with HALCOGEN 04.05.01 . We got problem with Ethernet Phy loopback receive. Will the above discussion and solution holds good for HALCOGEN 04.05.01 also?

    Thanks

    Santosh

  • Santhosh,

    As far as I know - there is now a "Ethernet MII/RMII select" option in the General group on the "PINMUX->Special Pin Muxing" tab in HalCoGen. This was added to address the issue mentioned above but I haven't tried it myself. You should check that this box is set correctly for your hardware though.

    -Anthony
  • Dear Anthony,

    Thanks for the quick reply.

    Using CCS Version: 6.1.0.00104, and HalCoGen ver 04.05.01., PHY DP83640.

    We were trying to check the Working of Ethernet on RM57L HDK, in loopback. (Note: We are trying for PHY loopback and hence Disabled EMAC loopback)

    We have generated the Ethernet code with HalCoGen as per settings attached. (Used the settings as mentioned in "example_EMAC_Loopback_TxRx.c" from folder "RM57Lx").

    Then we are running the code. We saw no interrupt generated for Tx or Rx. We assume that some data is transmitted via "EMACTransmit()" function. We saw in EMAC register "TXGOODFRAMES 0x00000002 Total number of good frames transmitted [Memory Mapped]"

    But we are not getting any good frames received "RXGOODFRAMES 0x00000000 Good RX Frames [Memory Mapped]"

    Also we saw "RXFILTERED 0x00000002 Filtered Receive Frames [Memory Mapped]" , we assume that we have received 2 frames but are filtered and so have no RXGOODFRAMES.

    Please let us know if we are missing any settings or any thing.

    Our idea is to prove Working of Ethernet on RM57L HDK, in loopback.

    Thanks for the support .

    Santosh

    0312.Ethernet_IF.rar