Skip to content
New issue

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

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

Already on GitHub? # to your account

cpu/kinetis: implement periph_timer_query_freqs #20144

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

maribu
Copy link
Member

@maribu maribu commented Dec 5, 2023

Contribution description

As the title says.

Testing procedure

Run the test provided by #16349.

Issues/PRs references

Depends on #16349 and includes the first commit of it.

@maribu maribu added Type: new feature The issue requests / The PR implemements a new feature for RIOT State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 5, 2023
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: build system Area: Build system Area: drivers Area: Device drivers Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Dec 5, 2023
@maribu maribu removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 5, 2023
@maribu maribu force-pushed the periph_timer_query_freq-kinetis branch from be8a7d8 to 4c72966 Compare December 5, 2023 20:49
@maribu maribu 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 5, 2023
@github-actions github-actions bot added State: waiting for other PR State: The PR requires another PR to be merged first and removed Area: build system Area: Build system Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 5, 2023
@maribu maribu 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 5, 2023
@riot-ci
Copy link

riot-ci commented Dec 5, 2023

Murdock results

✔️ PASSED

f52e20c cpu/kinetis: implement periph_timer_query_freqs

Success Failures Total Runtime
8082 0 8082 09m:38s

Artifacts

@maribu maribu changed the title cpu/kinetis: implement periph_timer_query_freq cpu/kinetis: implement periph_timer_query_freqs Dec 5, 2023
@maribu maribu force-pushed the periph_timer_query_freq-kinetis branch from 4c72966 to f52e20c Compare December 7, 2023 15:17
@maribu
Copy link
Member Author

maribu commented Dec 7, 2023

Update: From tab, now the test output of the correct board:

make BOARD=frdm-k22f -C tests/periph/timer flash test -j
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/cmsis/ 
Building application "tests_timer" for "frdm-k22f" with MCU "kinetis".

"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/frdm-k22f
"make" -C /home/maribu/Repos/software/RIOT/master/core
"make" -C /home/maribu/Repos/software/RIOT/master/core/lib
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/kinetis
"make" -C /home/maribu/Repos/software/RIOT/master/drivers
"make" -C /home/maribu/Repos/software/RIOT/master/sys
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/kinetis/periph
"make" -C /home/maribu/Repos/software/RIOT/master/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/master/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common/periph
"make" -C /home/maribu/Repos/software/RIOT/master/sys/div
"make" -C /home/maribu/Repos/software/RIOT/master/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/master/sys/malloc_thread_safe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/newlib_syscalls_default
"make" -C /home/maribu/Repos/software/RIOT/master/sys/pm_layered
"make" -C /home/maribu/Repos/software/RIOT/master/sys/preprocessor
"make" -C /home/maribu/Repos/software/RIOT/master/sys/stdio_uart
"make" -C /home/maribu/Repos/software/RIOT/master/sys/test_utils/interactive_sync
"make" -C /home/maribu/Repos/software/RIOT/master/sys/test_utils/print_stack_usage
"make" -C /home/maribu/Repos/software/RIOT/master/sys/tsrb
   text	  data	   bss	   dec	   hex	filename
  14932	   124	  2756	 17812	  4594	/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/frdm-k22f/tests_timer.elf
/home/maribu/Repos/software/RIOT/master/dist/tools/openocd/openocd.sh flash /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/frdm-k22f/tests_timer.elf
### Flashing Target ###
sh: invalid number ''
sh: invalid number ''
/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/frdm-k22f/tests_timer.elf is not locked.
Open On-Chip Debugger 0.12.0+dev-snapshot (2023-06-12-09:31)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
swd
Info : add flash_bank kinetis kx.pflash
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: FW Version = 1.10
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : Connecting under reset
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [kx.cpu] Cortex-M4 r0p1 processor detected
Info : [kx.cpu] target has 6 breakpoints, 4 watchpoints
Info : MDM: Chip is unsecured. Continuing.
Info : starting gdb server for kx.cpu on 0
Info : Listening on port 40163 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* kx.cpu             cortex_m   little kx.cpu             unknown
Info : MDM: Chip is unsecured. Continuing.
[kx.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00000d1c msp: 0x1fff0200
Info : Kinetis MK22FN512xxx12 detected: 2 flash blocks
Info : 2 PFlash banks: 512 KiB total
Info : This device supports Program Longword execution only.
Info : Disabling Kinetis watchdog (initial WDOG_STCTRLH = 0x01d3)
Info : WDOG_STCTRLH = 0x01d2
Info : This device supports Program Longword execution only.
auto erase enabled
wrote 16384 bytes from file /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/frdm-k22f/tests_timer.elf in 1.043470s (15.333 KiB/s)
verified 15056 bytes in 0.411288s (35.749 KiB/s)
Info : MDM: Chip is unsecured. Continuing.
shutdown command invoked
Done flashing
r
/home/maribu/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
�to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-690-gf52e2-periph_timer_query_freq-kinetis)

Test for peripheral TIMERs

Available timers: 3

TIMER 0
=======

  - supported frequencies:
    0: 30000000
    1: 15000000
    2: 10000000
    ....
    4294967294: 0
  - Calling timer_init(0, 30000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 150000)
    Successfully set timeout 150000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 15000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 75000)
    Successfully set timeout 75000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 10000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 50000)
    Successfully set timeout 50000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17648      - init:    17648
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 30000000
    1: 15000000
    2: 10000000
    ....
    4294967294: 0
  - Calling timer_init(1, 30000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 150000)
    Successfully set timeout 150000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 15000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 75000)
    Successfully set timeout 75000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 10000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 50000)
    Successfully set timeout 50000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17648      - init:    17648
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 2
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    15: 1
  - Calling timer_init(2, 32768)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 163)
    Successfully set timeout 163 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17573      - init:    17573
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(2, 16384)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 81)
    Successfully set timeout 81 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17478      - init:    17478
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(2, 8192)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 40)
    Successfully set timeout 40 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17256      - init:    17256
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED

And for the frdm-k64f (for which reset via OpenOCD seems to be buggy; maybe updating the integrated programmer/debugger's firmware is needed?)

make BOARD=frdm-k64f -C tests/periph/timer PORT=/dev/ttyACM1 -j test      
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
r
/home/maribu/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
r
Help: Press s to start test, r to print it is ready
r
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-690-gf52e2-periph_timer_query_freq-kinetis)

Test for peripheral TIMERs

Available timers: 3

TIMER 0
=======

  - supported frequencies:
    0: 60000000
    1: 30000000
    2: 20000000
    ....
    4294967294: 0
  - Calling timer_init(0, 60000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 300000)
    Successfully set timeout 300000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 30000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 150000)
    Successfully set timeout 150000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 20000000)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 100000)
    Successfully set timeout 100000 for channel 0
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 60000000
    1: 30000000
    2: 20000000
    ....
    4294967294: 0
  - Calling timer_init(1, 60000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 300000)
    Successfully set timeout 300000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 30000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 150000)
    Successfully set timeout 150000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 20000000)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 100000)
    Successfully set timeout 100000 for channel 0
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17647      - init:    17647
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 2
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    15: 1
  - Calling timer_init(2, 32768)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 163)
    Successfully set timeout 163 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17610      - init:    17610
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(2, 16384)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 81)
    Successfully set timeout 81 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17472      - init:    17472
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(2, 8192)
    initialization successful
  - timer_stop(2): stopped
  - timer_set(2, 0, 40)
    Successfully set timeout 40 for channel 0
  - timer_start(2)
  - Results:
    - channel 0 fired at SW count    17239      - init:    17239
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED

make: Leaving directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'

@benpicco benpicco requested a review from benemorius December 8, 2023 14:20
@maribu maribu added this pull request to the merge queue Dec 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 8, 2023
@maribu maribu added this pull request to the merge queue Dec 8, 2023
@maribu maribu removed this pull request from the merge queue due to a manual request Dec 9, 2023
@maribu maribu added this pull request to the merge queue Dec 9, 2023
@maribu maribu removed this pull request from the merge queue due to a manual request Dec 9, 2023
@maribu maribu added this pull request to the merge queue Dec 9, 2023
Merged via the queue into RIOT-OS:master with commit 46571b6 Dec 9, 2023
@maribu
Copy link
Member Author

maribu commented Dec 9, 2023

Thx :-)

@maribu maribu deleted the periph_timer_query_freq-kinetis branch December 9, 2023 15:44
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.01 milestone Feb 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants