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

AIROC™ Bluetooth

kmantem
Level 1
10 sign-ins 5 questions asked 5 sign-ins
Level 1

Hi,

We are trying to figure out a reboot/timing issue that we are seeing with the CYW20719 MCU.

What we are noticing is that if we have debug enabled and are outputting debug statements to the PUART via WICED_BT_TRACE, the program runs fine.

If we disable/remove the WICED_BT_TRACE statement the program crashes, and the board goes into a constant reboot cycle and continues to crash at the point where we removed the WICED_BT_TRACE statement.

This is occurring with exchanging data over SPI2 with a memory chip that we have.    The operation that is being performed are multiple consecutive reads over the SPI2 Bus.

We are wondering if the WICED_BT_TRACE is creating enough of a time delay to allow the bus to recover and possible we need to add a delay somewhere?

If we do need to add a delay, what is the best way to do so? 

 

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator 750 replies posted 500 likes received 500 replies posted
Moderator

Hi,

I think, the watchdog reset is happening in the function where you perform the read operation. The default watchdog timeout is set to 2 seconds and watchdog petting is done in the idle thread periodically. You should ensure that the idle thread gets enough time to pet the watchdog. So you should provide some delay. WICED_BT_TRACE might be giving the required delay so that it avoids the watchdog reset.

FYI.

Check wiced_hal_wdog.h

https://community.cypress.com/t5/Resource-Library/CYW20719-and-CYW20735-Clocks-RTC-WatchDog-Timer-Ap...

Thanks,

-Dheeraj

View solution in original post

0 Likes
3 Replies
DheerajPK_41
Moderator
Moderator 750 replies posted 500 likes received 500 replies posted
Moderator

Hi,

I think, the watchdog reset is happening in the function where you perform the read operation. The default watchdog timeout is set to 2 seconds and watchdog petting is done in the idle thread periodically. You should ensure that the idle thread gets enough time to pet the watchdog. So you should provide some delay. WICED_BT_TRACE might be giving the required delay so that it avoids the watchdog reset.

FYI.

Check wiced_hal_wdog.h

https://community.cypress.com/t5/Resource-Library/CYW20719-and-CYW20735-Clocks-RTC-WatchDog-Timer-Ap...

Thanks,

-Dheeraj

0 Likes
kmantem
Level 1
10 sign-ins 5 questions asked 5 sign-ins
Level 1

Dhreeraj,

Thank you!  It is definitely related to the Watchdog thread, I was able to confirm this by temporarily disabling the watchdog, and the long running reads and writes or long for loops were able to complete, some take longer than 2 seconds.

What would be the correct method to reset/delay to prevent the wdog from rebooting?

0 Likes
DheerajPK_41
Moderator
Moderator 750 replies posted 500 likes received 500 replies posted
Moderator

Hi,

You can give a rtos delay in the loop which causes the wdog to triggers. Check wiced_rtos.h. Use ALLOW_THREAD_TO_SLEEP as delay_type where ever possible.

Production applications need not pet the watchdog.

Thanks,

-Dheeraj.P.K

0 Likes