[FX3] GPIF Link Auto & Manual DMA Concurrently?

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

cross mob
HuYa_4249091
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi, our FPGA will send two different format data:

  1. Img Data: It needs to send out to PC.
  2. Info Data: FX3 parses this data and don’t need to send out.

There is one pin “Switch_pin” which provided by FPGA to decide the data format is Img Data or info data.

Therefore, in the GPIF, I want to use “Switch_pin” to judge how to handle this data in FX3. Pseudo code:

pseudo GPIF.jpg

If the data is Img Data, FX3 uses CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE to receive it, and then send out to PC by USB bulk endpoint directly.

If the data is Info Data, FX3 uses CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE to receive it, and parse it inside the FX3 CPU.

It means that GPIF can decide that it want to use Auto DMA or Manual DMA to receive one piece of data, and the data will be handled differently in FX3.

Is it possible to achieve?

Any help will be highly appreciated!

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?

If yes, only one DMA channel can be created at a time with particular producer and consumer sockets. 

In the firmware, based on the status of the GPIO (switch_pin) an  interrupt (like CY_U3P_GPIO_INTR_LOW_LEVEL/ CY_U3P_GPIO_INTR_HIGH_LEVEL) can be registered and based on the interrupt trigger the DMA channel can be created (this is the case when no DMA channel was created earlier). Please note that if the gpio interrupt is triggered when a DMA channel (for example: CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) is already created, the existing DMA channel (CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) should be destroyed before creating new (CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE)

Please let me know if any queries on this

Regards,
Rashi

View solution in original post

3 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?

If yes, only one DMA channel can be created at a time with particular producer and consumer sockets. 

In the firmware, based on the status of the GPIO (switch_pin) an  interrupt (like CY_U3P_GPIO_INTR_LOW_LEVEL/ CY_U3P_GPIO_INTR_HIGH_LEVEL) can be registered and based on the interrupt trigger the DMA channel can be created (this is the case when no DMA channel was created earlier). Please note that if the gpio interrupt is triggered when a DMA channel (for example: CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) is already created, the existing DMA channel (CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE) should be destroyed before creating new (CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE)

Please let me know if any queries on this

Regards,
Rashi

Dear Rashi:

Thanks for your quickly reply!

From the description I understand that based on the status of the GPIO the DMA channel type need to be changed. Is that correct?

Yes!

According to your description, the switch_pin is detected by FW(not GPIF), so the flow is like:

switch_pin is triggered --> FW create correspond DMA channel --> GPIF receive data

Therefore, GPIF need to be announced(by FW_TRG action) after the correspond DMA channel has been created as the pseudo code:

pseudo GPIF2.jpg

Besides, GPIF don't need to judge that the incoming data is Img_Data or Info_Data.

Is my understanding correct?

Thank you!

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Yes, your understanding is correct.

The pseudo state machine seems fine.

Regards,
Rashi