CPU as DMA port

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

cross mob
WGT_4383351
Level 5
Level 5
First like received

Some reference Using FX3, what is required to use DMA fabric to link Parallel Port sockets to a CPU using MANUAL_IN...  and FX3 CPU to Parallel Port Socket DMA Operation-Manual Out/In

How to connect CPU to PPort in the Master/Slave example?

In the attachment in the above references, there is a GPIF designer project too, but GPIF setting has nothing to do with who will be connected to P Port, right? So can I just use existing GPIF designer projects for Master/Slave example and only modify the DMA initialization code in the Master/Slave firmware to swith one end of some DMA channel from U port to CPU port and keep another end as before?

0 Likes
1 Solution

Hello,

Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference

>> Apart from the modifications you mentioned in previous response, buffers (with data) needs to be sent from CPU - PPORT. This is done by CyFxBulkSrcSinkFillInBuffers API in the reference (gpiftousb) project. In this API the buffer is filled with the pattern AA using this Macro

#define CY_FX_BULKSRCSINK_PATTERN            (0xAA)

after filling the buffer with AA , the buffer is comitted to P PORT / GPIF block

manualout.PNG

manualll.PNG

Please confirm that you have added this to you firmware

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
4 Replies
WGT_4383351
Level 5
Level 5
First like received

Are these the only modification need :

for CPU to PPort:

1. CyU3PDmaChannelCreate: CY_U3P_DMA_TYPE_AUTO -> CY_U3P_DMA_TYPE_MANUAL_OUT

2. dmaCfg.prodSckId: CY_FX_PRODUCER_USB_SOCKET -> CY_U3P_CPU_SOCKET_PROD

    dmaCfg.consSckId: keep as before

for PPort to CPU:

1. CyU3PDmaChannelCreate: CY_U3P_DMA_TYPE_AUTO -> CY_U3P_DMA_TYPE_MANUAL_IN

2. dmaCfg.consSckId: CY_FX_CONSUMER_USB_SOCKET -> CY_U3P_CPU_SOCKET_CONS

    dmaCfg.prodSckId: keep as before

Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference

0 Likes
WGT_4383351
Level 5
Level 5
First like received

"Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference"

The answer is CyU3PDmaChannelGetBuffer and CyU3PDmaChannelCommitBuffer.

Please focus on the reset of the question.

0 Likes

Hello,

Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference

>> Apart from the modifications you mentioned in previous response, buffers (with data) needs to be sent from CPU - PPORT. This is done by CyFxBulkSrcSinkFillInBuffers API in the reference (gpiftousb) project. In this API the buffer is filled with the pattern AA using this Macro

#define CY_FX_BULKSRCSINK_PATTERN            (0xAA)

after filling the buffer with AA , the buffer is comitted to P PORT / GPIF block

manualout.PNG

manualll.PNG

Please confirm that you have added this to you firmware

Regards,

Rashi

Regards,
Rashi
0 Likes