How can we determine whether the lpc55s28 is powered on or reset by software when it starts.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can we determine whether the lpc55s28 is powered on or reset by software when it starts.

Jump to solution
533 Views
JJ3
Contributor I

How can we determine whether the lpc55s28 is powered on or reset by software when it starts.

0 Kudos
Reply
1 Solution
453 Views
Pablo_Ramos
NXP Employee
NXP Employee

Hi @JJ3,

I tested your code, and it should work fine. If what you need is a visual way to you know if the reset happen you can use a LED to know this, other way could be send a message via UART to be able to see it in Terminal.
If what you want is to change the code if is not a power one reset, you can use an if else with different whiles.

Hope it helps you!

View solution in original post

0 Kudos
Reply
3 Replies
508 Views
Pablo_Ramos
NXP Employee
NXP Employee

Hi @JJ3,

Can you provide me with more details about your application in order to give you better feedback?

Why do you think the software is restarting?

Is this software reset expected or is it due to a hard fault?

0 Kudos
Reply
500 Views
JJ3
Contributor I
Dear pablo,
I am very glad to receive your reply. At present, the wireless IC of my project needs to restart the device after being connected, so I need to judge the startup mode of lpc55s28. The following is the code I use to judge the restart.
power_device_reset_cause_t p_reset_cause;
power_device_boot_mode_t p_boot_mode;
uint32_t p_wakeupio_cause;
POWER_GetWakeUpCause(&p_reset_cause, &p_boot_mode, &p_wakeupio_cause);
if (p_reset_cause == kRESET_CAUSE_POR) {
power_on_flag = true;
}
Best wishes!
0 Kudos
Reply
454 Views
Pablo_Ramos
NXP Employee
NXP Employee

Hi @JJ3,

I tested your code, and it should work fine. If what you need is a visual way to you know if the reset happen you can use a LED to know this, other way could be send a message via UART to be able to see it in Terminal.
If what you want is to change the code if is not a power one reset, you can use an if else with different whiles.

Hope it helps you!

0 Kudos
Reply