About UVC application backflow_detect process

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

cross mob
SuSh_1535366
Level 5
Level 5
Distributor - Macnica (Japan)
10 solutions authored 10 likes given 10 likes received

Hello,

I found the FX3 FAQs (KBA224051), the description of BACKFLOW_DETECT in this article was as follows:

Question: In the AN75779 example, I enabled BACKFLOW_DETECT. When the FX3 Firmware calls CyU3PGpifDisable(), FX3 occasionally stops responding. Why does it happen?

Answer: It may happen because of PIB/GPIF error interrupts invoked in the application. If you enable BACKFLOW_DETECT, you need to disable any interrupt with the CyU3PVicDisableAllInterrupts() function during  the CyU3PGpifDisable() process.

I actually encountered this problem and was able to solve it with the provided workaround, but there are some questions.

In the AN75779 source code, the PIB/GPIF error interupt callback function only sets 1 to the flag.

So I don't think there is a problem with the processing.

What mechanism does FX3 stop responding to?

My application also uses UART interrupts, can I disable only PIB/GPIB error interrupts?

Please let me know if you have any information.

Regards,

Shimamura

0 Likes
1 Solution

Hello Shimamura-san,

Sorry for the delay.

I understood disabling only CY_U3P_VIC_PIB_CORE_VECTOR does not help to resolve its issue.

You can mask PIB_ERR and GPIF_ERR to resolve its issue, not need to mask MMC_ERR.

PIB->intr_mask &= ~(CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR );

Best regards,

Hirotaka Takayama

View solution in original post

0 Likes
5 Replies
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hi Shimamura-san,

The reason for CyU3PGpifDisable is that the CPU is getting blocked with continuous interrupts as soon as the GPIF state machine is paused prior to getting disabled.

This is happening because the PIB/GPIF error interrupts are also enabled in the application due to the BACKFLOW_DETECT being enabled.

CyU3PVicDisableAllInterrupts() API disables all Interrupts at the Vectored Interrupt Controller (VIC) level.

Would you like to keep UART interrupt enabling?

Best regards,

Hirotaka Takayama

0 Likes
SuSh_1535366
Level 5
Level 5
Distributor - Macnica (Japan)
10 solutions authored 10 likes given 10 likes received

Hello Takayama-san,

Thank you for your reply.

Is the interrupt that occurs when CyU3PGpifDisable() is executed CYU3P_PIB_INTR_ERROR?

In our execution environment, It seems that the application does not always freeze when CyU3PGpifDisable() is executed.

Is there any other cause for the continuous occurrence of interrupts?

(ex. CyU3PGpifDisable () execution timing, another interrupt occurs at the same time, etc...)

##

Yes, we need a UART interrupt.

If we mask all interrupts with CyU3PVicDisableAllInterrupts(), the application will freeze as well. (Receiving data from UART)

Instead of the workaround presented in the FAQ, we did the following:


PIB->intr_mask &= ~(CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR | CY_U3P_PIB_INTR_MMC_ERR );

CyU3PGpifDisable( CyTrue );

PIB->intr_mask |= (CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR | CY_U3P_PIB_INTR_MMC_ERR );


This process ensures that the application works correctly.
Is this valid as a workaround?

Sorry to trouble you, please give me an answer.

Regards,

Shimamura

0 Likes

Hi Shimamura-san,

>>Is the interrupt that occurs when CyU3PGpifDisable() is executed CYU3P_PIB_INTR_ERROR?

Yes, we think so.

>>In our execution environment, It seems that the application does not always freeze when CyU3PGpifDisable() is executed.

The execution for GpifDisable() is a very short time (about 20 us). Thus, we think the issue occasionally happens.

If the customer does not want to disable all interrupts, they can selectively disable PIB interrupt alone ( do not affect UART interrupt) by using:

CyU3PVicDisableInt (CY_U3P_VIC_PIB_CORE_VECTOR);

CyU3PGpifDisable(CyFalse);

CyU3PVicEnableInt (CY_U3P_VIC_PIB_CORE_VECTOR);

Above is our recommended workaround.

CyU3PVicDisableInt() is used for disabling the interrupt for the specified vector number.

Regarding the detail information of CYU3P_PIB_INTR_ERROR, kindly ask the customer to read PIB Error Indicator Register (PIB_ERROR、address 0xE0010020) on FX3 TRM.

Best regards,

Hirotaka Takayama

0 Likes
SuSh_1535366
Level 5
Level 5
Distributor - Macnica (Japan)
10 solutions authored 10 likes given 10 likes received

Hello Takayama-san,

Thank you for your support.

Unfortunately, the proposed workaround did not solve the problem.

We will continue to investigate the cause of the problem.

Is there any difference between disabling interrupt vectors and masking interrupt sources?

Let me know if you have any concerns.

Regards,

Shimamura

残念ながら、提案いただいたワークアラウンドでは問題が解決しませんでした。

0 Likes

Hello Shimamura-san,

Sorry for the delay.

I understood disabling only CY_U3P_VIC_PIB_CORE_VECTOR does not help to resolve its issue.

You can mask PIB_ERR and GPIF_ERR to resolve its issue, not need to mask MMC_ERR.

PIB->intr_mask &= ~(CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR );

Best regards,

Hirotaka Takayama

0 Likes