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.

CCS/TMS320F28388D: unable to run Ethernet examples

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi, 

I have a question about F28388D ethernet examples. 

I was trying to run ethernet_ex1_basic_tx_rx_loopback. Here is what I did:

1. I built and ran ethernet_c28x_config example on CPU1. 

2. Then I built and debugged ethernet_ex1_basic_tx_rx_loopback on CM. 

The program stuck at Line 158 pInitCfg = Ethernet_initInterface(initInterfaceConfig);

I looked into it. It seems it was trapped in the loop of ethernet.c file, Ethernet_resetModule function, line 3171,

//Wait till the Soft Reset is done
//

while((HWREG(base + ETHERNET_O_DMA_MODE) & ETHERNET_DMA_MODE_SWR) ==
ETHERNET_DMA_MODE_SWR)
{
}

I have several questions about this example.

1. Why does the program stop there? 

2. I was trying to delete the line in ethernet.c to avoid this problem. But I did not succeed. The program still runs to that blank line and it seems ethernet.c is not complied. Does that mean I am not allowed to change library file? 

3. I understand the purpose of running ethernet_c28x_config is to configure peripherals. But when I load the ethernet_ex1_basic_tx_rx_loopback example, how can I check GPIO pins are configured correctly. I feel like configuration by ethernet_c28x_config  is removed after I loaded ethernet_ex1_basic_tx_rx_loopback.

Thanks. 

Cheng

  • Cheng,

    We are working to find the correct person in the team to help out here. We should be able to get a response out later today.

    Best,

    Matthew

  • Cheng,

    1) I don't see the application getting stuck there. In the CPU1 application, set breakpoint on line 136, make sure it reaches that, and then do a single step to cover that line execution. You want to load CPU1, then load CM, then run CPU1 app, then run CM app.

    2) To edit that file, you need to edit the source, and then rebuild the driverlib. The driverlib project is at: C2000Ware_3_03_00_00\driverlib\f2838x\driverlib_cm

    3) Make sure that the CPU1 project is running successfully (see the #1) and then you can view the register window in CCS when CPU1 is selected to verify that configurations are happening there. Configurations won't be removed once loading the CM application, only CPU1 can do the GPIO configuration.

    Best regards

    Chris

  • Hi Chris, 

    That helps a lot! Thanks. 

    Regards,

    Cheng

  • Hi Chris, 

    I have a follow-up question about ethernet_ex4_ptp_basic_master and slave example. 

    I am connecting two F28388D through ethernet cable. I noticed both master and slave need to have MAC address set (line 366 - 395), but in slave code, it only sets the MAC address for itself (line 381-385)

    The master code is transmitting to slave code one packet per second. I found slave is not responding to master properly. As a result, I just saw the change of delayMS, but delaySM is always zero. I attached the gPtpSlaveState status below. It seems the slave is not sending out packets, or it's not picking up Delay Request signal. Do you know what is going on by any chance? I didn't change the original codes except the MAC address. Thanks for the help!

    Regards,

    Cheng

  • Cheng,

    I'm replying on behalf of Chris and Yashwant; due to holiday schedules(Thanskgiving in US) there is going to be a bit of delay in the next response.  Yashwant should be able to get back to you by Tuesday of next week.  If there is any change here I'll update you.

    Apologies for the delay, just trying to be as upfront as possible on the situation.

    Best,

    Matthew

  • Hi Matthew, 

    Thanks for the reply. I will wait for the reply.

    I want to add more information to my question though 

    I notice there are two Ethernet_setMACAddr function in ethernet_ex4_ptp_basic_master 

    Ethernet_setMACAddr(EMAC_BASE,
    0,
    0x00000506U,
    0x01030304U,
    ETHERNET_CHANNEL_0);

    Ethernet_setMACAddr(EMAC_BASE,
    1,
    0x00000000,
    0x00191B01,
    ETHERNET_CHANNEL_0);

    I am not sure why there are MAC address defined here. In addition, what is the order for encoding MAC address here? The first one seems suggesting 01:02:03:04:05:06, But the latter one is defined as "01:1B:19:00:00:00" according to the code. Thanks and happy Thanksgiving. 

    Regards,

    Cheng

  • Hi Cheng,

    1) Is you code still getting stuck in Ethernet Software Reset (ETHERNET_DMA_MODE_SWR) after incorporating the suggestions by Christopher?

    The Software reset doesnt work when the Clock to the ethernet is not properly configured or when the GPIO pins of ethernet are not properly configured. Make sure both the boards have the same pll so that they have correct aux pll and sys pll clock set.

    If you are using 20MHz oscillator control card make sure you use the predefined symbol USE_20MHZ_XTAL . 

    2) PTPD flow uses a multicast address to receive the packets. Hence that address is also programmed in MAC Address register to receive the packets.

    The MAC address configuration uses first 4 bytes of the addr in the MACAddrLow value and the next 2 bytes in the MACAddrHigh value.

    Ex: For A8-63-F2-00-00-80  MAC Id Correct usage is as follows.

    Ethernet_setMACAddr(EMAC_BASE,
    1,
    0x00008000,
    0x00F263A8,
    ETHERNET_CHANNEL_0);

    Thanks,

    Yashwant

  • Dear Yashwant, 

    Thanks for the help. 

    I found what is the problem. Actually  "01:1B:19:00:00:00" is the default standard multicast address for PTP and it is not supposed to be modified. After I changed MAC address back to "01:1B:19:00:00:00", the program ran. 

    I am still not sure what is the function of the codes below.

    Ethernet_setMACAddr(EMAC_BASE,
    0,
    0x00000506U,
    0x01030304U,
    ETHERNET_CHANNEL_0);

    Thanks again for the advice!

    Regards,

    Cheng

  • Hi Cheng,

    Good to hear it is working. MACaddr instanceNum 0 is for the own MAC ID and instanceNum 1 is the multicast addr filter.

    Thanks,

    Yashwant