Skip to content
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

cpu/stm32: merge clock source selection headers #15657

Merged
merged 4 commits into from
Jan 25, 2021

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Dec 17, 2020

Contribution description

The clock source selection in STM32 is divided in 2 families: the Lx/WB and the other families. In master, all this clock source selection is duplicated in each family groups (f0f1f3, f2f4f7, g0, g4, l0l1, l4l5wb and mp1).
This PR is moving all this clock selection configuration in 2 separate header files that are included for the corresponding families. This removes a lot of duplicated code.

There's also a commit that use clk_conf.h in all F7 boards, this was a leftover from previous refactoring and another one that is merging the g0 and g4 clock configuration header (because they are very similar).

Testing procedure

  • A green CI
  • Use the following diff and check that examples/hello-world reports the expected clock values:
diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index f51bf8c0a0..670c2e411f 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -20,6 +20,9 @@
  */
 
 #include <stdio.h>
+#include <inttypes.h>
+
+#include "board.h"
 
 int main(void)
 {
@@ -28,5 +31,19 @@ int main(void)
     printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
     printf("This board features a(n) %s MCU.\n", RIOT_MCU);
 
+    printf("Clock coreclock: %" PRIu32 "\n", (uint32_t)CLOCK_CORECLOCK);
+#ifdef CLOCK_AHB
+    printf("AHB clock: %" PRIu32 "\n", (uint32_t)CLOCK_AHB);
+#endif
+#ifdef CLOCK_APB1
+    printf("APB1 clock: %" PRIu32 "\n", (uint32_t)CLOCK_APB1);
+#endif
+#ifdef CLOCK_APB2
+    printf("APB2 clock: %" PRIu32 "\n", (uint32_t)CLOCK_APB2);
+#endif
+#ifdef CLOCK_PLLQ
+    printf("PLLQ clock: %" PRIu32 "\n", (uint32_t)CLOCK_PLLQ);
+#endif
+
     return 0;
 }
nucleo-l552ze-q
$ BUILD_IN_DOCKER=1 make BOARD=nucleo-l552ze-q -C examples/hello-world flash term --no-print-directory 
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-l552ze-q'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-l552ze-q'    
Building application "hello-world" for "nucleo-l552ze-q" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-l552ze-q
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   9904	    112	   2312	  12328	   3028	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-l552ze-q/hello-world.elf
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/nucleo-l552ze-q/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-01406-gca211373d-dirty (2020-10-26-22:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 500 kHz
Info : STLINK V2J34M25 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.245293
Info : stm32l5x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32l5x.cpu on 0
Info : Listening on port 37579 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32l5x.cpu       hla_target little stm32l5x.cpu       reset

target halted due to debug-request, current mode: Thread 
xPSR: 0xf9000000 pc: 0x08000bd8 msp: 0x20000200
Info : device idcode = 0x20006472 (STM32L55/L56xx - Rev: B)
Info : flash size = 512kbytes
Info : flash mode : dual-bank
Warn : Adding extra erase range, 0x08002720 .. 0x080027ff
auto erase enabled
wrote 10016 bytes from file /work/riot/RIOT/examples/hello-world/bin/nucleo-l552ze-q/hello-world.elf in 0.655749s (14.916 KiB/s)

verified 10016 bytes in 0.353681s (27.656 KiB/s)

shutdown command invoked
Done flashing
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:25:13,737 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:25:45,533 # �%���#^!���=��!`yK^7�3f'!"P/%)q�main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:25:45,534 # Hello World!
2020-12-17 09:25:45,539 # You are running RIOT on a(n) nucleo-l552ze-q board.
2020-12-17 09:25:45,542 # This board features a(n) stm32 MCU.
2020-12-17 09:25:45,544 # Clock coreclock: 108000000
2020-12-17 09:25:45,546 # AHB clock: 108000000
2020-12-17 09:25:45,549 # APB1 clock: 27000000
2020-12-17 09:25:45,549 # APB2 clock: 54000000
2020-12-17 09:25:46,901 # Exiting Pyterm
nucleo-g431rb
$ BUILD_IN_DOCKER=1 make BOARD=nucleo-g431rb -C examples/hello-world flash term --no-print-directory 
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-g431rb'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-g431rb'    
Building application "hello-world" for "nucleo-g431rb" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-g431rb
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   9908	    112	   2312	  12332	   302c	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-g431rb/hello-world.elf
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/nucleo-g431rb/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-01406-gca211373d-dirty (2020-10-26-22:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 2000 kHz
Info : STLINK V3J2M1 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.323695
Info : stm32g4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32g4x.cpu on 0
Info : Listening on port 35349 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32g4x.cpu       hla_target little stm32g4x.cpu       reset

Info : Unable to match requested speed 2000 kHz, using 1000 kHz
Info : Unable to match requested speed 2000 kHz, using 1000 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800077c msp: 0x20000200
Info : device idcode = 0x20016468 (STM32G43/G44xx - Rev: Z)
Info : flash size = 128kbytes
Info : flash mode : single-bank
Info : Padding image section 1 at 0x08002724 with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x08002728 .. 0x080027ff
auto erase enabled
wrote 10024 bytes from file /work/riot/RIOT/examples/hello-world/bin/nucleo-g431rb/hello-world.elf in 0.393251s (24.893 KiB/s)

verified 10020 bytes in 0.152373s (64.218 KiB/s)

Info : Unable to match requested speed 2000 kHz, using 1000 kHz
Info : Unable to match requested speed 2000 kHz, using 1000 kHz
shutdown command invoked
Done flashing
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:28:24,246 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:28:31,711 # main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:28:31,712 # Hello World!
2020-12-17 09:28:31,717 # You are running RIOT on a(n) nucleo-g431rb board.
2020-12-17 09:28:31,720 # This board features a(n) stm32 MCU.
2020-12-17 09:28:31,722 # Clock coreclock: 170000000
2020-12-17 09:28:31,724 # AHB clock: 170000000
2020-12-17 09:28:31,726 # APB1 clock: 170000000
2020-12-17 09:28:31,728 # APB2 clock: 170000000
2020-12-17 09:28:32,965 # Exiting Pyterm
nucleo-g071rb
$ BUILD_IN_DOCKER=1 make BOARD=nucleo-g071rb -C examples/hello-world flash term --no-print-directory 
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-g071rb'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-g071rb'    
Building application "hello-world" for "nucleo-g071rb" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-g071rb
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8656	    112	   2312	  11080	   2b48	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-g071rb/hello-world.elf
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/nucleo-g071rb/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-01406-gca211373d-dirty (2020-10-26-22:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 2000 kHz
Info : STLINK V2J31M21 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.222410
Info : stm32g0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32g0x.cpu on 0
Info : Listening on port 35561 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32g0x.cpu       hla_target little stm32g0x.cpu       reset

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x0800067c msp: 0x20000200
Info : device idcode = 0x20006460 (STM32G07/G08xx - Rev: B)
Info : flash size = 128kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08002240 .. 0x080027ff
auto erase enabled
wrote 8768 bytes from file /work/riot/RIOT/examples/hello-world/bin/nucleo-g071rb/hello-world.elf in 0.277157s (30.894 KiB/s)

verified 8768 bytes in 0.070426s (121.582 KiB/s)

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
Done flashing
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:29:24,104 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:29:45,849 # main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:29:45,850 # Hello World!
2020-12-17 09:29:45,854 # You are running RIOT on a(n) nucleo-g071rb board.
2020-12-17 09:29:45,857 # This board features a(n) stm32 MCU.
2020-12-17 09:29:45,860 # Clock coreclock: 64000000
2020-12-17 09:29:45,861 # AHB clock: 64000000
2020-12-17 09:29:45,864 # APB1 clock: 64000000
2020-12-17 09:29:47,813 # Exiting Pyterm
nucleo-f103rb
$ BUILD_IN_DOCKER=1 RYOT_CI=1 make BOARD=nucleo-f103rb -C examples/hello-world flash term --no-print-directory
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-f103rb'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-f103rb'    
Building application "hello-world" for "nucleo-f103rb" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-f103rb
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8576	    112	   2324	  11012	   2b04	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-f103rb/hello-world.elf
rsync --chmod=ugo=rwX /work/riot/RIOT/examples/hello-world/bin/nucleo-f103rb/hello-world.elf ci@ci-riot-tribe.saclay.inria.fr:/builds/boards/bin/nucleo-f103rb_flashfile.elf
ssh ci@ci-riot-tribe.saclay.inria.fr 'IMAGE_OFFSET= BOARD=nucleo-f103rb QUIET=1 make --no-print-directory -C /builds/boards flash-only FLASHFILE=/builds/boards/bin/nucleo-f103rb_flashfile.elf'
/builds/boards/RIOT/dist/tools/openocd/openocd.sh flash /builds/boards/bin/nucleo-f103rb_flashfile.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-g68611ef-dirty (2020-07-20-09:42)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 1000 kHz
Info : STLINK V2J29M18 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.259513
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 0
Info : Listening on port 35609 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f1x.cpu       hla_target little stm32f1x.cpu       reset

target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800060c msp: 0x20000200
Info : device id = 0x20036410
Info : flash size = 128kbytes
auto erase enabled
wrote 9216 bytes from file /builds/boards/bin/nucleo-f103rb_flashfile.elf in 0.559203s (16.094 KiB/s)

verified 8688 bytes in 0.177257s (47.865 KiB/s)

shutdown command invoked
Done flashing
ssh -t ci@ci-riot-tribe.saclay.inria.fr 'BOARD=nucleo-f103rb QUIET=1 make --no-print-directory -C /builds/boards term' 
/builds/boards/RIOT/dist/tools/pyterm/pyterm -p "/dev/riot/tty-nucleo-f103rb" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:30:39,315 # Connect to serial port /dev/riot/tty-nucleo-f103rb
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:30:42,184 # main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:30:42,185 # Hello World!
2020-12-17 09:30:42,190 # You are running RIOT on a(n) nucleo-f103rb board.
2020-12-17 09:30:42,193 # This board features a(n) stm32 MCU.
2020-12-17 09:30:42,195 # Clock coreclock: 72000000
2020-12-17 09:30:42,197 # AHB clock: 72000000
2020-12-17 09:30:42,200 # APB1 clock: 36000000
2020-12-17 09:30:42,201 # APB2 clock: 72000000
2020-12-17 09:30:44,030 # Exiting Pyterm
Connection to ci-riot-tribe.saclay.inria.fr closed.
nucleo-f410rb
$ BUILD_IN_DOCKER=1 make BOARD=nucleo-f410rb -C examples/hello-world flash term --no-print-directory 
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-f410rb'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-f410rb'    
Building application "hello-world" for "nucleo-f410rb" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-f410rb
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   9172	    112	   2324	  11608	   2d58	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-f410rb/hello-world.elf
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/nucleo-f410rb/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-01406-gca211373d-dirty (2020-10-26-22:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 2000 kHz
Info : STLINK V2J24M11 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.255010
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on 0
Info : Listening on port 34701 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f4x.cpu       hla_target little stm32f4x.cpu       reset

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800079c msp: 0x20000200
Info : device id = 0x10006458
Info : flash size = 128 kbytes
auto erase enabled
wrote 16384 bytes from file /work/riot/RIOT/examples/hello-world/bin/nucleo-f410rb/hello-world.elf in 0.666671s (24.000 KiB/s)

verified 9284 bytes in 0.132157s (68.603 KiB/s)

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
Done flashing
/work/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:31:36,885 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:34:49,736 # main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:34:49,737 # Hello World!
2020-12-17 09:34:49,741 # You are running RIOT on a(n) nucleo-f410rb board.
2020-12-17 09:34:49,743 # This board features a(n) stm32 MCU.
2020-12-17 09:34:49,747 # Clock coreclock: 100000000
2020-12-17 09:34:49,749 # AHB clock: 100000000
2020-12-17 09:34:49,753 # APB1 clock: 50000000
2020-12-17 09:34:49,754 # APB2 clock: 100000000
2020-12-17 09:34:49,755 # PLLQ clock: 50000000
2020-12-17 09:34:51,224 # Exiting Pyterm
nucleo-l073rz
$ BUILD_IN_DOCKER=1 RYOT_CI=1 make BOARD=nucleo-l073rz -C examples/hello-world flash term --no-print-directory
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=nucleo-l073rz'  -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make 'BOARD=nucleo-l073rz'    
Building application "hello-world" for "nucleo-l073rz" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/nucleo-l073rz
"make" -C /data/riotbuild/riotbase/boards/common/nucleo
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8760	    112	   2312	  11184	   2bb0	/data/riotbuild/riotbase/examples/hello-world/bin/nucleo-l073rz/hello-world.elf
rsync --chmod=ugo=rwX /work/riot/RIOT/examples/hello-world/bin/nucleo-l073rz/hello-world.elf ci@ci-riot-tribe.saclay.inria.fr:/builds/boards/bin/nucleo-l073rz_flashfile.elf
ssh ci@ci-riot-tribe.saclay.inria.fr 'IMAGE_OFFSET= BOARD=nucleo-l073rz QUIET=1 make --no-print-directory -C /builds/boards flash-only FLASHFILE=/builds/boards/bin/nucleo-l073rz_flashfile.elf'
/builds/boards/RIOT/dist/tools/openocd/openocd.sh flash /builds/boards/bin/nucleo-l073rz_flashfile.elf
### Flashing Target ###
Open On-Chip Debugger 0.10.0+dev-g68611ef-dirty (2020-07-20-09:42)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 300 kHz
Info : STLINK V2J28M17 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.253649
Info : stm32l0.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32l0.cpu on 0
Info : Listening on port 34989 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32l0.cpu        hla_target little stm32l0.cpu        reset

Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x08000770 msp: 0x20000200
Info : Device: STM32L0xx (Cat.5)
Info : STM32L flash has dual banks. Bank (0) size is 96kb, base address is 0x8000000
auto erase enabled
wrote 12288 bytes from file /builds/boards/bin/nucleo-l073rz_flashfile.elf in 2.755956s (4.354 KiB/s)

verified 8872 bytes in 0.458274s (18.906 KiB/s)

Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
shutdown command invoked
Done flashing
ssh -t ci@ci-riot-tribe.saclay.inria.fr 'BOARD=nucleo-l073rz QUIET=1 make --no-print-directory -C /builds/boards term' 
/builds/boards/RIOT/dist/tools/pyterm/pyterm -p "/dev/riot/tty-nucleo-l073rz" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2020-12-17 09:35:34,277 # Connect to serial port /dev/riot/tty-nucleo-l073rz
Welcome to pyterm!
Type '/exit' to exit.
2020-12-17 09:35:36,953 # main(): This is RIOT! (Version: 2021.01-devel-1604-g0940b-pr/cpu/stm32_merge_clock_headers)
2020-12-17 09:35:36,954 # Hello World!
2020-12-17 09:35:36,959 # You are running RIOT on a(n) nucleo-l073rz board.
2020-12-17 09:35:36,962 # This board features a(n) stm32 MCU.
2020-12-17 09:35:36,964 # Clock coreclock: 32000000
2020-12-17 09:35:36,966 # AHB clock: 32000000
2020-12-17 09:35:36,969 # APB1 clock: 32000000
2020-12-17 09:35:36,970 # APB2 clock: 32000000
2020-12-17 09:35:40,152 # Exiting Pyterm
Connection to ci-riot-tribe.saclay.inria.fr closed.

Issues/PRs references

Ticks another item in #14975
Based on #15650

@aabadie aabadie added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation State: waiting for other PR State: The PR requires another PR to be merged first Area: cpu Area: CPU/MCU ports labels Dec 17, 2020
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Dec 20, 2020
@aabadie aabadie force-pushed the pr/cpu/stm32_merge_clock_headers branch from c90a51d to e8b63e8 Compare December 20, 2020 15:31
@aabadie aabadie force-pushed the pr/cpu/stm32_merge_clock_headers branch from e8b63e8 to 8d9309b Compare January 11, 2021 20:25
@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 11, 2021
@maribu maribu added the Process: blocked by feature freeze Integration Process: The impact of this PR is too high for merging it during soft feature freeze. label Jan 12, 2021
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

looks good to me. Some comments inline

cpu/stm32/include/clk/clk_conf.h Outdated Show resolved Hide resolved
cpu/stm32/include/clk/clk_conf.h Outdated Show resolved Hide resolved
cpu/stm32/include/clk/cfg_clock_common2.h Outdated Show resolved Hide resolved
cpu/stm32/include/clk/cfg_clock_common2.h Outdated Show resolved Hide resolved
cpu/stm32/include/clk/cfg_clock_common2.h Outdated Show resolved Hide resolved
@aabadie aabadie added Process: blocked by feature freeze Integration Process: The impact of this PR is too high for merging it during soft feature freeze. and removed Process: blocked by feature freeze Integration Process: The impact of this PR is too high for merging it during soft feature freeze. labels Jan 12, 2021
@miri64 miri64 removed the Process: blocked by feature freeze Integration Process: The impact of this PR is too high for merging it during soft feature freeze. label Jan 19, 2021
@fjmolinas
Copy link
Contributor

ping @aabadie

@aabadie aabadie force-pushed the pr/cpu/stm32_merge_clock_headers branch from 8d9309b to dd34fef Compare January 21, 2021 12:07
@aabadie
Copy link
Contributor Author

aabadie commented Jan 21, 2021

All comments are addressed!

@fjmolinas
Copy link
Contributor

I ran some clock related tests on nucleo BOARDs, seems good to me https://ci.inria.fr/ci-riot-tribe/job/build-pipeline.jk/215/artifact/.

@fjmolinas fjmolinas added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Jan 25, 2021
@fjmolinas
Copy link
Contributor

@aabadie there are some static checks comments

@aabadie aabadie force-pushed the pr/cpu/stm32_merge_clock_headers branch from b8395c2 to 5fef40a Compare January 25, 2021 10:46
@aabadie
Copy link
Contributor Author

aabadie commented Jan 25, 2021

there are some static checks comments

They are fixed now

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

ACK, As @maribu stated changes look good, I did some testing for regressions on most stm32, all looks good.

@aabadie aabadie merged commit 87cd41a into RIOT-OS:master Jan 25, 2021
@aabadie aabadie deleted the pr/cpu/stm32_merge_clock_headers branch January 25, 2021 12:57
@aabadie
Copy link
Contributor Author

aabadie commented Jan 25, 2021

Thanks for reviewing and testing !

@kaspar030 kaspar030 added this to the Release 2021.04 milestone Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 3-testing The PR was tested according to the maintainer guidelines Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants