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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,215件の閲覧回数
JJ3
Contributor I

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

0 件の賞賛
返信
1 解決策
1,135件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,190件の閲覧回数
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 件の賞賛
返信
1,182件の閲覧回数
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 件の賞賛
返信
1,136件の閲覧回数
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 件の賞賛
返信