Skip to content

Commit e5adb83

Browse files
authored
[microTVM][Zephyr] Fix PLL freq. in overlay for nucleo_l4r5zi board (#12756)
* [microTVM][Zephyr] Fix PLL freq. in overlay for nucleo_l4r5zi board Commit 1d32c40 ("Add project overlay to overwrite device tree configs") added overlay for setting 'clock-frequency' property of node 'rcc' to 120 MHz, however to effectively change the PLL frequency that drivers the core it's necessary also to overlay the attributes for the 'pll' node. This commit does that. Signed-off-by: Gustavo Romero <[email protected]> * Remove div-p and div-q properties from overlay Remove div-p and div-q properties from the overlay file since values for these properties will be inherited from the 'pll' that is overlaid. Since currently microTVM does not use any subsystem which relies on clocks associated to either P or Q params, these params can be left unchanged for now. Signed-off-by: Gustavo Romero <[email protected]>
1 parent 296565a commit e5adb83

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

apps/microtvm/zephyr/template_project/app-overlay/nucleo_l4r5zi.overlay

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,25 @@
2121
&rcc {
2222
clock-frequency = <DT_FREQ_M(120)>;
2323
};
24+
25+
/*
26+
Set PLL accordingly to freq. reported by 'clock-frequency' property, where:
27+
28+
VCO freq = PLL clock input freq (HSI: 16 MHz) * N / M and
29+
Core freq = VCO freq / R.
30+
31+
Hence:
32+
33+
VCO freq = 16 * 30 / 2 = 240 MHz and
34+
Core freq = 240 MHz / 2 = 120 MHz
35+
36+
Prop. 'div-p' and 'div-q' will be inherited from the overlaid 'pll' node.
37+
*/
38+
39+
&pll {
40+
div-m = <2>;
41+
mul-n = <30>;
42+
div-r = <2>;
43+
clocks = <&clk_hsi>;
44+
status = "okay";
45+
};

0 commit comments

Comments
 (0)