Skip to content

Nuvoton: Fix NUC472 hard fault in SMCC tests #9171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void CLK_PowerDown(void)
SCB->SCR = SCB_SCR_SLEEPDEEP_Msk;
CLK->PWRCTL |= (CLK_PWRCTL_PDEN_Msk | CLK_PWRCTL_PDWKDLY_Msk );
__WFI();
__DSB();
__ISB();
Copy link
Contributor

@0xc0170 0xc0170 Dec 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these barriers after and not before WFI - why it was hardfaulting previously?

I am missing what has caused the hardfault (how these 2 barriers are adressing it), adding them after _WFI is executed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 , according to the hard fault prompt & tracking, it's failed in branch instruction after wake-up. So add these barriers to ensure data & instruction ready before branch. Cross checking of my test proved it could work as our expectation.

}

/**
Expand All @@ -92,6 +94,8 @@ void CLK_Idle(void)

/* Chip enter idle mode after CPU run WFI instruction */
__WFI();
__DSB();
__ISB();
}


Expand Down