Ethernet demo falshing to TC299B

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
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/collaboration/library/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?
0 Likes
4 Replies
Not applicable
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?
0 Likes
Not applicable
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?
0 Likes
Not applicable
This link: http://aschauf.landshut.org/fh/linux/udp_vs_raw/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?
0 Likes
Not applicable
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,myMacAddress);
}

/*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 = extMacAddress;
}
/* SA */
for (i = 0; i < 6; i++)
{
pTxBuf[i+6] = myMacAddress;
}

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

for (i = HEADER_SIZE; i < (HEADER_SIZE + packetSize); i++)
{
pTxBuf = 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 != myMacAddress)
{
++errors;
}
}

/* SA */
for (i = 0; i < 6; i++)
{
if (pRxBuf[i + 6] != myMacAddress)
{
++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 != (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");*/
}
}
0 Likes