PSOC Randomly Resets it self

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

cross mob
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi, 

I am using PSoC 4200 BLE device. It will randomly reset.
How can I debug the cause of this Reset?

Following are the prints when PSoc resets

BT LDR
[I] Reset SW
[I] FW VER: 0.1.10 2021-06-09T17:54:58
[I] BLE stack on
[I] MAC: 00:A0:50:38:48:9C
S->A
[I] BLE Adv start
[I] CMD_GET_PSOC_DETAILS
[I] ALS Init Done
[I] AV Flash Boot
[I] CMD_GET_PSOC_DETAILS
[I] CMD SET BLE
[I] Beacon Set:
02 01 06 1A FF 4C 00 02 .....L..
15 A6 41 84 A9 72 E1 2E ..A..r..
79 FA 61 B3 EF 24 2D F1 y.a..$-.
51 00 00 00 00 C5 Q.....

0 Likes
12 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Can you please attach the PSoC Creator project that is getting reset? We will try to reproduce the issue on our side and will give you our comments. 

Thanks and regards

Ganesh

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ganesh,

It's not possible to give the Product code. Is there any way to debug at my side? 

Also, If you want any information I will provide you.

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Please check if the issue lies on the Hardware side of the firmware side.  For that, please download a code example from Cypress on your board and see if still the device is getting reset. If it resets then the issue lies on the hardware side. In this case, please check the schematic, power supply stability, etc. We will help you with that once you confirm.

In case if issue turned out to be on the firmware side, please check the cause for the reset using the API Getresetreason(). You can find this API in the PSoC 4 system reference guide (see help section). This will give you the hint regarding the type of reset (software/hardware/watchdog). 

Please do these two steps and let us know the results so that we can guide you further.

Thanks and regards

Ganesh

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ganesh,

I am already using this api below is the snippet for the code, I use this API at the beginning of the main()

let me know if this is the correct way to use it or not

rahulpatel_0-1623304445677.png

with this I am always getting "Reset SW"

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

I understood that your project configuration is Bootloader and Application. From your description, I guess that the code snippet you have written is in the Bootloader project. Am I correct? If yes, something is causing your application to software reset. Please check if you are calling CySoftwareReset() API anywhere in your application.

Can you please update what do you mean by ALS init Done and AV flash boot?

Thanks and regards

Ganesh

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ganesh,

The code snippet is from my application project. 
But I add those CySysGetResetReason() API in the bootloader project to find the cause.

Check below code snippet which I add to my bootloader project

rahulpatel_0-1623316706223.png

But If I execute this code there is no reason to show when I power on the device or PSOC, what Cause is expect while power on the device?

I manually test the WDT RESET condition and able to see while the Device reset because of Watchdog.

One more thing after adding the above code snippet in Bootloader it will take 2-3second to start the application, is it expected?


Update[11th July]:
I add those print in Bootloader code and it shows "CY_SYS_RESET_WDT" cause for the reboot and during that device is in idle state there are no operations below is the snippet

rahulpatel_0-1623409473299.png

here A->S means psoc goes active to sleep and S->A means sleep to active
CMD WD CLR means it stores the last timestamp of the CC32xx when it clear the Watchdog timer.

Can you help me ASAP what the cause or how I can debug this?

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ganesh,

There is one more situation I have observed.  PSoC is configured as an I2C slave and wakes from a deep sleep state.

While testing i am sending 256 bytes of I2C Write and 7 bytes of I2C read repeatedly.  98% of the time it works as expected. But sometimes PSoC gives a NAK after 4-5 Bytes of write operation. Please check the trace. I have used a PGIO toggling in I2C ISR for testing. I can verify that PSoC wakes and deep sleep but still results in NAK. I increased the priority of I2C slave to 0. Still the issue arises.

rahulpatel_1-1623646559694.pngrahulpatel_2-1623646576084.png

 

rahulpatel_0-1623646435735.png

 

 

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

But If I execute this code there is no reason to show when I power on the device or PSOC, what Cause is expect while power on the device?

In case the device resets due to power-on/XRES/Brown-out, none of those 'if' cases will be satisfied. So you can put an if-else ladder and put "Reset due to XRES/power-on/brownout" in the final else statement. As per your initial problem, if you are not seeing any of those reasons then the device is getting reset due to some power-related issues. Please refer to your board schematic with one of our development kit's schematic.

One more thing after adding the above code snippet in Bootloader it will take 2-3second to start the application, is it expected?

No, this is not expected. The lines of code you added are just to check the reset reason which will be executed very fast like other lines of code. This is also maybe because of hardware.

1. In case if you see "Reset due to XRES/power-on/brownout" then I would say that there is more likely a power issue. That is also one of the reasons why the initial start-up is taking 2-3 seconds. Please check if there are any glitches on the power supply, I2C lines, ensure that the 4.7-kilo ohm pull-up resistances on the I2C lines and 330-ohm series resistances on SCL, and SDA lines.

2. Compare the I2C specific code in your application with the I2C code example available in PSoC Creator. You can also run and check the I2C code example in PSoC Creator by modifying the read and write operations accordingly. This test will confirm if there are any issues with hardware. 

Please try these tests and update us on the results.

Thanks and regards

Ganesh

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Can you suggest a code example which has I2C slave wake from LPDS?

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

In My code, I am not doing much. Usually, PSoC is in Deep sleep state with watchdog wakeup every 100ms and servicing BLE events. When there is I2CS interrupt I move to active state and start polling I2C every 5 millisecond and go to Sleep state. If there is a busy state on I2CS I repeatedly poll for Write complete.

The ACK to data write should be interrupt-driven, right? 

 

0 Likes
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Please find the I2C_SCB_Slave_Using_Callback project. 

The ACK to data write should be interrupt-driven, right? 

The Fixed Function I2C slave works as follows:

The system wakes up from Sleep or Deep-Sleep system power modes when an I2C address match occurs. The fixed-function I2C block performs either of two actions after address match: Address ACK or Address NACK.
Address ACK - The I2C slave executes clock stretching and waits until the device wakes up and ACKs the address.
Address NACK - The I2C slave NACKs the address immediately. The master must poll the slave again after the device
wake-up time is passed. This option is only valid in the slave or multi-master-slave modes.
Note The interrupt bit WAKE_UP (bit 0) of the SCB_INTR_I2C_EC register must be enabled for the I2C to wake up the
device on slave address match while switching to the Sleep mode. You can also check the box "Enable the wake-up from Deep-sleep mode" in the I2C component.

Since you are using BLE in your application, we recommend you to through the following code example:

https://www.cypress.com/documentation/application-notes/an92584-designing-low-power-and-estimating-b...

Can you please go through the above two code examples and implement the same techniques in your project?

Thanks and regards

Ganesh

0 Likes
rahulpatel
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ganesh,

I am able to reproduce this DATA_NACK error.

Please share private link so I can share my code with you.

0 Likes