Hai all,
I am using TMS570LC4357. I am tring to receive an ethernet frame which is sent from the host PC. I'm using ColaSoft Packet Builder software for this purpose.
So when I send an ethernet frame from PC, Program control of TMS570LC4357 gets into the Rx Interrupt routine (I checked with breakpoint) and hence I assumed that receive operation is happening well.
But the problem is I don't know how to see the received values in the watch window,
because, the value of buffer pointer in the Header Packet is showing like 0xEA1A0008. But according to trm, this location is the reserved one in the memory table.
So I can't view the content of this memory location. But since the buffer pointer have this value, my received elements may not be stored there or elsewhere, right? This what I Assumed. Please Correct me if I am Wrong.
So How can I view the elements of received frame in watch window?
I'm using HalCoGen example code only with no loopback mode enabled (I just untick the Enable LoopBack Communication checkbox).
And in main(),
I've made my own modifications.
I've given my main code here.
Please help me anyway.
For Transmission, no problem. TMS570 perfectly sends the frame I expect, to the Host PC.
Only problem is receiving.
i.e:
1. I don't know whether receiving is happening or not and
2. If happening well then where the received elements are stored and
3. how can I access them?
These are my doubts.
CODE:
#include "HL_sys_common.h"
#include "HL_system.h"
/* USER CODE BEGIN (1) */
#include "HL_emac.h"
#include "HL_hw_reg_access.h"
/* USER CODE END */
/* USER CODE BEGIN (2) */
uint8 emacAddress[6U] = {0x00U, 0x08U, 0xEEU, 0x03U, 0xA6U, 0x6CU};
uint32 emacPhyAddress = 1U;
extern hdkif_t hdkif_data[1];
pbuf_t pack[5];
uint32 size1 = 470,size2=94;
void create_packet()
{
int i,j;
for(i=0;i<5;i++)
{
pack[i].tot_len = size1;
pack[i].len = size2;
for(j=0;j<6;j++)
{
data[i][j] = 0xffu;
}
for(j=0;j<6;j++)
{
data[i][j+6]= emacAddress[j];
}
data[i][12] = 0;
data[i][13] = 80;
for(j=0;j<80;j++)
{
data[i][j+14] = i+5;
}
pack[i].payload = &data[i][0];
if(i!=4)
pack[i].next = NULL;//&pack[i+1];
}
pack[4].next= NULL;
}
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
_enable_IRQ();
EMACHWInit(emacAddress);
create_packet();
EMACTransmit(&hdkif_data[0], &pack[0]);
size1=600;
size2=120;
create_packet();
// EMACTransmit(&hdkif_data[0], &pack[0]);
while(1);
/* USER CODE END */
}
Expecting a Guidance.
Thanks & Regards,
Karthikeyan.K