Banner_AURIX_Security-Solution Banner_AURIX_Security-Solution Banner_AURIX_Security-Solution Banner_AURIX_Security-Solution


+ Reply to Thread
Results 1 to 5 of 5

Thread: Ethernet demo falshing to TC299B

  1. #1
    New Member New Member Claas is on a distinguished road
    Join Date
    Jun 2016
    Posts
    6
    Points
    35

    Ethernet demo falshing to TC299B

    Hello,

    I have used different tools and methods for flashing the board, from simple demos using the HighTec system to SafeRTOS with Tasking.
    I then stumbled upon https://workspace.infineon.com/jsp/c...y/overview.jsp where I could download the SW_Framework, where I got the Infineon Development Environment.

    I found in the ILLD included a lot of demos, specifically and Ethernet demo, which is exactly what I wanted. I have now been able to compile it using my HighTec compiler.
    This has generated .elf files and .map files for the flashing process. But I cannot get it to flash, and neither if I use the other IDE's that I have they give an error to the structure of the project.

    My question therefore is there some description or guide of how to enable flashing using the IDE from SW_Framework? Should I just install UDE or what is needed and which settings ?

    Also the ethernet application, I had hoped a communication link was established but from the code it does not seem to, how can I see the communication in a terminal or command-prompt, as to not only rely on debug output?

  2. #2
    New Member New Member Claas is on a distinguished road
    Join Date
    Jun 2016
    Posts
    6
    Points
    35
    I have now made it possible to flash the project from the HighTec free tooling, the biggest change was following: https://www.eclipse.org/forums/index.php/t/824895/

    The flashing works and the debugging. We can now reach the EthDemo_init(); and the software crashes in this function, the guess is that the .map file has not been properly used by the board.

    Does this make sense? If so how would we use the .map file?

  3. #3
    New Member New Member Claas is on a distinguished road
    Join Date
    Jun 2016
    Posts
    6
    Points
    35
    The code is now running on the device and I can step through the entire src code using UDE.

    But the eth_demo I cannot see any output on a listening linux pc. I have changed the receiving MacAddress in the code to the linux pc's MAC, but nothing has been received. Has anybody made this demo run on a TC29x device and listent to the communication output, so I can have some pointers?

  4. #4
    New Member New Member Claas is on a distinguished road
    Join Date
    Jun 2016
    Posts
    6
    Points
    35
    This link: http://aschauf.landshut.org/fh/linux...w/ch01s03.html shows normal Linux MAC Address communication, and from the sample it seems like the issue is that the message is never send.

    Is this correct?

  5. #5
    New Member New Member Claas is on a distinguished road
    Join Date
    Jun 2016
    Posts
    6
    Points
    35
    This is my current code using the demo. I had to comment out all printfs as they made the debugger crash. I am using the UDE debugger and the HighTec toolchain, all of which is the free or lite toolchain from Infineon homepage.
    The issue is that no communication is made on the ethernet, I have tried listening with wireshark on multiple OS's (Linux and Windows). Could somebody please inform me why nothing is transmitted by the ethernet port on the hardware?

    I have also tried the below code with sending an ARP, and listen and view the information on a switch. No communication seems to be transmitted. Is it possible to get some support on what I might be missing?

    void EthDemo_init(void)
    {
    /* configure Ethermac */
    {
    const IfxEth_RmiiPins pins = {
    &IfxEth_CRSDVA_P11_11_IN,
    &IfxEth_REFCLK_P11_12_IN,
    &IfxEth_RXD0_P11_10_IN,
    &IfxEth_RXD1_P11_9_IN,
    &IfxEth_MDC_P21_0_OUT,
    &IfxEth_MDIO_P21_1_INOUT,
    &IfxEth_TXD0_P11_3_OUT,
    &IfxEth_TXD1_P11_2_OUT,
    &IfxEth_TXEN_P11_6_OUT
    };

    IfxEth_Config config;
    //config.macAddress = myMacAddress;
    IfxEth_initConfig(&config, &MODULE_ETH);

    config.phyInterfaceMode = IfxEth_PhyInterfaceMode_rmii;
    config.rmiiPins = &pins;
    config.phyInit = &IfxEth_Phy_Pef7071_init;
    config.phyLink = &IfxEth_Phy_Pef7071_link;

    IfxEth_init(&g_Eth.drivers.eth, &config);

    /* activate loopback */
    IfxEth_setLoopbackMode(&g_Eth.drivers.eth, 0);

    /* and enable transmitter/receiver */
    IfxEth_startTransmitter(&g_Eth.drivers.eth);
    IfxEth_startReceiver(&g_Eth.drivers.eth);

    IfxEth_setMacAddress(&g_Eth.drivers.eth,myMacAddre ss);
    }

    /*printf("Eth is initialised\n");*/
    }


    /** \brief Demo run API
    *
    * This function is called from main, background loop
    */
    void EthDemo_run(void)
    {
    /*printf("Ethernet transfers in loopback mode are started\n");*/

    /* send 5 packets, each contains 8 bytes */
    const uint32 numPackets = 5;
    const uint32 packetSize = 8;

    uint32 packet;

    for (packet = 0; packet < numPackets; ++packet)
    {
    uint8 *pTxBuf = (uint8 *)IfxEth_waitTransmitBuffer(&g_Eth.drivers.eth);

    /*printf("TX #%d\n", packet + 1);*/

    /* DA */
    const uint8 packetId = 0x10 * packet;
    uint32 i;

    for (i = 0; i < 6; i++)
    {
    pTxBuf[i] = extMacAddress[i];
    }
    /* SA */
    for (i = 0; i < 6; i++)
    {
    pTxBuf[i+6] = myMacAddress[i];
    }

    /* length of payload */
    pTxBuf[12] = packetSize / 256;
    pTxBuf[13] = packetSize % 256;

    for (i = HEADER_SIZE; i < (HEADER_SIZE + packetSize); i++)
    {
    pTxBuf[i] = packetId | (i % 16);
    }

    /* send packet */
    IfxEth_clearTxInterrupt(&g_Eth.drivers.eth);
    IfxEth_setAndSendTransmitBuffer(&g_Eth.drivers.eth , pTxBuf, HEADER_SIZE + packetSize);
    // IfxEth_sendTransmitBuffer(&g_Eth.drivers.eth, HEADER_SIZE + packetSize);

    while (IfxEth_isTxInterrupt(&g_Eth.drivers.eth) == FALSE)
    {}
    }

    /* check the 5 received packets */
    uint32 errors = 0;

    for (packet = 0; packet < numPackets; ++packet)
    {
    /*printf("RX #%d\n", packet + 1);*/

    #if 0

    /* only one interrupt for all the received packets so far... */
    while (IfxEth_isRxInterrupt(&g_Eth.drivers.eth) == FALSE)
    {}

    IfxEth_clearRxInterrupt(&g_Eth.drivers.eth);
    #else

    if (IfxEth_isRxDataAvailable(&g_Eth.drivers.eth) != TRUE)
    {
    ++errors;
    }

    #endif
    uint8 *pRxBuf = (uint8 *)IfxEth_getReceiveBuffer(&g_Eth.drivers.eth); /* we expect that a packet is available */
    IfxEth_freeReceiveBuffer(&g_Eth.drivers.eth);

    /* DA */
    const uint8 packetId = 0x10 * packet;
    uint32 i;

    for (i = 0; i < 6; i++)
    {
    if (pRxBuf[i] != myMacAddress[i])
    {
    ++errors;
    }
    }

    /* SA */
    for (i = 0; i < 6; i++)
    {
    if (pRxBuf[i + 6] != myMacAddress[i])
    {
    ++errors;
    }
    }

    /* length of payload */
    if (pRxBuf[12] != (packetSize / 256))
    {
    ++errors;
    }

    if (pRxBuf[13] != (packetSize % 256))
    {
    ++errors;
    }

    for (i = HEADER_SIZE; i < (HEADER_SIZE + packetSize); i++)
    {
    if (pRxBuf[i] != (packetId | (i % 16)))
    {
    ++errors;
    }
    }
    }

    /*printf("Expect that no additional receive data is available:");*/

    if (IfxEth_isRxDataAvailable(&g_Eth.drivers.eth) != FALSE)
    {
    ++errors;
    }

    IFX_ASSERT(IFX_VERBOSE_LEVEL_ERROR, errors == 0);

    if (errors)
    {
    /*printf("ERROR: Found (%d errors)\n", errors);*/
    }
    else
    {
    /*printf("OK: Checks passed\n");*/
    }
    }
    Last edited by Claas; Jun 21st, 2016 at 07:10 AM.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.