Skip to content

Commit c382e96

Browse files
committed
[M2351] Upgrade chip version to B from A
There is a reset halt issue with PLL in A version. To switch back to A version for some reason, define NU_CHIP_MAJOR to 1.
1 parent c725f18 commit c382e96

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/TARGET_NUMAKER_PFM_M2351/mbed_overrides.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,11 @@ void mbed_sdk_init(void)
5555
/* Wait for HIRC48 clock ready */
5656
CLK_WaitClockReady(CLK_STATUS_HIRC48STB_Msk);
5757

58+
59+
#if defined(NU_CHIP_MAJOR) && (NU_CHIP_MAJOR == 1UL)
5860
/* NOTE: There is a reset halt issue with PLL in A version. Work around it
5961
* by using HIRC48 instead of PLL as HCLK clock source. */
60-
#if 0
61-
/* Select HCLK clock source as HIRC and HCLK clock divider as 1 */
62-
CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC, CLK_CLKDIV0_HCLK(1));
63-
64-
/* Set core clock as 48M from PLL */
65-
CLK_SetCoreClock(FREQ_48MHZ);
66-
#else
62+
6763
/* Trim HIRC48 to 48M against LXT */
6864

6965
/* Reset TISTS48M status flags */
@@ -90,6 +86,9 @@ void mbed_sdk_init(void)
9086
}
9187

9288
CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC48, CLK_CLKDIV0_HCLK(1UL));
89+
#else
90+
/* Set core clock as 64M from PLL */
91+
CLK_SetCoreClock(FREQ_64MHZ);
9392
#endif
9493

9594
/* Update System Core Clock */

0 commit comments

Comments
 (0)