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.

TMDSIDK437X: How to assert MII_RT MAC signal TX_EN?

Part Number: TMDSIDK437X

hi,

  am working on a demo of PRUSS1 MII_RT to send packet from PRU0 through mii0 port, I can push data into TX FIFO, but can't transmmit data out to phy. I've checked the signal of mii and found that the signal TX_EN is always low, and I think that's why the data remains in FIFO.

  So I want to know the steps to assert TX_EN.

  I've found the notes in TRM:

There are four dependencies that must be true for TX_EN to assert.
1. TX L1 FIFO not empty
2. Interpacket gap (IPG) timer expiration
3. RX_DV to TX_EN timer expiration
4. TX_EN compare timer expiration

  But I don't understand what's the TX_EN timer? and is there any way to check wether the 3 mentioned timers expiried or not?

 Here is my demo code

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdint.h>
#include <pru_cfg.h>
#include <pru_ctrl.h>
#include "pru_mii_rt.h"
#define PKT_SIZE 70
volatile register uint32_t __R30;
volatile register uint32_t __R31;
uint8_t buffer[PKT_SIZE] = {
0xf0, 0xde, 0xf1, 0x9f, 0xbb, 0x91,
0x2c, 0x6b, 0x7d, 0xb3, 0xf8, 0x56,
0x08, 0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c,
0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Some more details.

    1. During debug, I read the R31 register to find its value is always 0x1000000 (bit24 set)

    2. While TX_EN_MODE is enabled, TX_ENABLE is NOT self cleared when TX_EOF cmd set.

  • Hello Junke,

    Are you writing custom PRU Ethernet firmware? TI already provides PRU Ethernet firmware and drivers. Let us know what operating system your ARM core is running and we can point you to the appropriate resources.

    Regards,

    Nick

  • hi Nick,

    yes, am writting a custom PRU firmware.

    and now I just want to verify the function of MII_RT transmit under CCS, so the ARM core is not running any OS.

    What I did under CCS is create a project based on board AM437x IDK, with a default target config. The firmware code is as shown before. And when debug, I first connect the ARM core and run script PRU_ICSS_Init, then disconnect ARM and connect PRUICSS1 PRU0. After all this, I start debug run.

    I am sure that the tx data has been pushed into TX FIFO by watching the MII_RT.TXFLV0 register, which shows there are 0x80 nibbles, that is 64 bytes, in the FIFO, but the data never transmit out due to the lack of TX_EN signal. It seems like the MII_RT is not working at all.

    So, is there any steps I missed? And can you tell me what's the TX_EN compare timer that TX_EN assertion depends on for I didn't find any details in TRM?

    thanks.

  • Hello Junke,

    I am going to reassign this to another team member. Please keep in mind that we do not provide in-depth support on the forums for customers writing custom Ethernet protocols. So we may be limited in the help we can offer.

    Regards,

    Nick

  • hi Nick,

    Thanks for your help.

    I'll be waitting.

  • Hi Junke

    1. RX_DV to TX_EN timer expiration
    you can keep TX_START_DELAY to zero i.e. MII_RT.TXCFG0_bit.TX_START_DELAY = 0x0;


    2. TX_EN compare timer expiration
    This is only applicable for Time Triggered send mode using CMP3 and CMP4.not applicable for current use case

    - We would like to know one point from your end , Are you configuring the pinmux for the ICSS pins?