WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2009-Mar-13 02:54:32

vsantu88
Member
Registered: 2009-Feb-05
Posts: 5

Generation of Custom Packets

I am using OFDM_Refernce_Design_V11.2. I want to create custom Macframe packets with a pre-defined data length. For the DMA transfer of the data, I used

XDmaCentral_Transfer(&DmaCentralInst, (u8 *) Custom_Data, (u8 *)warpphy_getBuffAddr(controlStruct.txBuffIndex)+NUM_HEADER_BYTES, Custom_Data_length);

where Custom_Data is a character array. However before doing the transfer, I check for DMA BUS Status as usual and it is always busy and hence the transfer fails. Am I proceeding in the right direction or is there any alternative.

Offline

 

#2 2009-Mar-13 08:23:03

HT
Member
Registered: 2008-May-12
Posts: 31

Re: Generation of Custom Packets

Hi.
I was wondering should i use DMA or not for my custom payload transfer to phy buffer.. but as my payload length for the custom packet is quite small i am using memcpy to copy the payload to its PHY TX buffer.  Maybe someday i will do it proper with DMA transfer.

For you just check in more detail how the DMA is used in warpmac.c also xdmacentral.h&c are good check out.

Offline

 

#3 2009-Mar-13 10:23:52

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Generation of Custom Packets

vsantu88 wrote:

where Custom_Data is a character array. However before doing the transfer, I check for DMA BUS Status as usual and it is always busy and hence the transfer fails. Am I proceeding in the right direction or is there any alternative.

Are you working in CSMAMAC.c? Where in the state machine are you trying to use the DMA? Keep in mind the same DMA engine handles other transfers (PHY->Ethernet, Ethernet->PHY), so you may be trying to use it when one of these transfers is active.

HT wrote:

I was wondering should i use DMA or not for my custom payload transfer to phy buffer.. but as my payload length for the custom packet is quite small i am using memcpy to copy the payload to its PHY TX buffer.  Maybe someday i will do it proper with DMA transfer.

For short transfers, memcpy is probably faster. We've never characterized it directly, but setting up and starting a DMA transfer definitely takes time. Also keep in mind the DMA engine can't access the iocm or docm memory spaces (DMA masters the PLB, but the OCM memory blocks aren't on the PLB), so memcpy may be your only option.

In the OFDM reference design, we use memcpy to move packet headers around and DMA for the (much larger) payloads.

Offline

 

#4 2009-Mar-13 11:05:44

vsantu88
Member
Registered: 2009-Feb-05
Posts: 5

Re: Generation of Custom Packets

My goal is to demonstrate Relay channel with XOR coding, using 3 Warp nodes. I started with halfmac. For now, at the client, I made the UP button's service routine to create a custom Macframe with certain data length and was calling another custom routine in warpmac.c, with a pointer to the Custom_Data, for the DMA transfer to PHY TX buffer. 

I think the problem lies in DMA engine failing to transfer the data from iocm or docm, as it is inaccessible. I will try with memcpy anyway.

Thanks

Offline

 

Board footer