Author Topic: Converting a Teensy4.1 to a MicromodTeensy, Ethernet RMII breaks ethernet sim  (Read 33 times)

Offline Ray

  • Newbie
  • *
  • Posts: 18
    • View Profile
I found an old link where Paul S confirmed that RMII can be implemented on the MicroModTeensy. 
Most of this was already setup in the uTasker kinetis_ENET.h   

I needed to add a #define ENET2_REF_CLK2_ON_EMC
I added a new #define  ENET2_ON_MICROMOD   (copy/pasted from the default)[/img]
        #elif defined ENET2_ON_MICROMOD
        _CONFIG_PERIPHERAL(GPIO_B0_12, ENET2_TDATA00, (PORT_DSE_MID | PORT_SRE_FAST)); // ENET2_TDATA00 on GPIO2-12 (alt. function 8)
        _CONFIG_PERIPHERAL(GPIO_EMC_31, ENET2_TDATA01, (PORT_DSE_MID | PORT_SRE_FAST)); // ENET2_TDATA01 on GPIO4-31 (alt. function 8)
        _CONFIG_PERIPHERAL(GPIO_EMC_32, ENET2_TX_EN, (PORT_DSE_MID | PORT_SRE_FAST));    //
        IOMUXC_ENET2_IPP_IND_MAC0_RXDATA_SELECT_INPUT_0 = IOMUXC_ENET2_IPP_IND_MAC0_RXDATA_SELECT_INPUT_0_GPIO_SD_B0_03_ALT8;
        _CONFIG_PERIPHERAL(GPIO_SD_B0_03, ENET2_RDATA00, 0);                // ENET2_RX_DATA00 on GPIO2-20 (alt. function 8)
        IOMUXC_ENET2_IPP_IND_MAC0_RXDATA_SELECT_INPUT_1 = IOMUXC_ENET2_IPP_IND_MAC0_RXDATA_SELECT_INPUT_1_GPIO_SD_B0_04_ALT8;
        _CONFIG_PERIPHERAL(GPIO_SD_B0_04, ENET2_RDATA01, 0);                // ENET2_RX_DATA01 on GPIO2-21 (alt. function 8)
        IOMUXC_ENET2_IPP_IND_MAC0_RXERR_SELECT_INPUT = IOMUXC_ENET2_IPP_IND_MAC0_RXERR_SELECT_INPUT_GPIO_B1_00_ALT8; // special case to select the pad involved in daisy chain
        _CONFIG_PERIPHERAL(GPIO_B1_00, ENET2_RX_ER, 0);                  // ENET2_RX_ER on GPIO2-16 (alt. function 8)


The simulator shows the correct peripheral configuration when I define IP_ETHERNET_INTERFACE_COUNT 2
Also created:
        #define ETHERNET_COUNT    2   // because of 2 ETH_CONTROLLERS
        #define ENET2_REF_CLK2_ON_SD
        #define ENET2_ON_MICROMOD

Unfortunately, something is miss-configured because the simulator is showing a red connect light, and ping, nor http is working now that I have made modifications from the original TEENSY4.1   I'm guessing this is probably nothing more than a #define mistake somewhere, I haven't added any code yet.

I attached a bmp of the simulator showing the peripheral configuration while running