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/efm32: implement periph_timer_periodic for series 0/1 #20262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 16, 2024

Contribution description

This implements the features periph_timer_periodic for EFM32 MCUs of Series 0 and Series 1.

Testing procedure

git:(cpu/efm32/series_0_1/periph_timer_periodic) ~/Repos/software/RIOT/master ➜ make BOARD=e180-zg120b-tb flash test -C tests/periph/timer_periodic   
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer_periodic'
Building application "tests_timer_periodic" for "e180-zg120b-tb" with MCU "efm32".

"make" -C /home/maribu/Repos/software/RIOT/master/pkg/cmsis/ 
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/gecko_sdk/ 
"make" -C /home/maribu/.cache/RIOT/pkg/gecko_sdk/dist
"make" -C /home/maribu/.cache/RIOT/pkg/gecko_sdk/dist/emlib-extra/src
"make" -C /home/maribu/.cache/RIOT/pkg/gecko_sdk/dist/emlib/src
"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/e180-zg120b-tb
"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/efm32
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common/periph
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/efm32/families/efr32mg1b
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/efm32/periph
"make" -C /home/maribu/Repos/software/RIOT/master/drivers
"make" -C /home/maribu/Repos/software/RIOT/master/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/master/sys
"make" -C /home/maribu/Repos/software/RIOT/master/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/master/sys/div
"make" -C /home/maribu/Repos/software/RIOT/master/sys/fmt
"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
  16900	   144	  2748	 19792	  4d50	/home/maribu/Repos/software/RIOT/master/tests/periph/timer_periodic/bin/e180-zg120b-tb/tests_timer_periodic.elf
/home/maribu/Repos/software/RIOT/master/dist/tools/openocd/openocd.sh flash /home/maribu/Repos/software/RIOT/master/tests/periph/timer_periodic/bin/e180-zg120b-tb/tests_timer_periodic.elf
### Flashing Target ###
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
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.229435
Info : [efm32.cpu] Cortex-M4 r0p1 processor detected
Info : [efm32.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for efm32.cpu on 0
Info : Listening on port 41269 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* efm32.cpu          hla_target little efm32.cpu          unknown
[efm32.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0fe10000 msp: 0x20000400
Info : detected part: EFR32MG1B Mighty Gecko, rev 165
Info : flash size = 256 KiB
Info : flash page size = 2048 B
auto erase enabled
wrote 18432 bytes from file /home/maribu/Repos/software/RIOT/master/tests/periph/timer_periodic/bin/e180-zg120b-tb/tests_timer_periodic.elf in 0.669535s (26.884 KiB/s)
verified 17044 bytes in 0.138398s (120.266 KiB/s)
shutdown command invoked
Done flashing
r
/home/maribu/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
READY
s
START
main(): This is RIOT! (Version: 2024.01-devel-600-gb5cdd-cpu/efm32/series_0_1/periph_timer_periodic)

Running Timer 0 at 250000 Hz.
One counter cycle is 6250 ticks or 25 ms
Will print 'tick' every cycle.

TEST START
Running iteration 1 of 3
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick

Cycles:
channel 0 = 12	[OK]
Running iteration 2 of 3
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick

Cycles:
channel 0 = 12	[OK]
Running iteration 3 of 3
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick
[0] tick

Cycles:
channel 0 = 12	[OK]
TEST SUCCEEDED

make: Leaving directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer_periodic'
git:(cpu/efm32/series_0_1/periph_timer_periodic) ~/Repos/software/RIOT/master ➜ echo $?         
0

Issues/PRs references

None

@maribu maribu added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: cpu Area: CPU/MCU ports labels Jan 16, 2024
@maribu maribu requested a review from basilfx as a code owner January 16, 2024 10:04
@github-actions github-actions bot added the Platform: ARM Platform: This PR/issue effects ARM-based platforms label Jan 16, 2024
@riot-ci
Copy link

riot-ci commented Jan 16, 2024

Murdock results

FAILED

1114048 cpu/efm32: implement periph_timer_periodic for series 0/1

Success Failures Total Runtime
8072 0 9836 07m:39s

Artifacts

Copy link
Contributor

@Teufelchen1 Teufelchen1 left a comment

Choose a reason for hiding this comment

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

Nice function names and comments! 🚀

cpu/efm32/periph/timer_series01.c Outdated Show resolved Hide resolved
cpu/efm32/periph/timer_series01.c Show resolved Hide resolved
cpu/efm32/periph/timer_series01.c Outdated Show resolved Hide resolved
@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 Jan 16, 2024
@benpicco
Copy link
Contributor

This looks fine, is there anything left to do?

@maribu
Copy link
Member Author

maribu commented Feb 13, 2024

I seem to have forgotten to push the latest fixup. And now that I'm looking at it chan_num is much better than chan_no (number of).

@maribu
Copy link
Member Author

maribu commented Feb 13, 2024

So: Should be good now. May I squash?

@Teufelchen1
Copy link
Contributor

Yes! I am happy with it!

This implements the features `periph_timer_periodic` for EFM32
MCUs of Series 0 and Series 1.

Co-authored-by: Teufelchen <9516484+Teufelchen1@users.noreply.github.com>
@maribu maribu force-pushed the cpu/efm32/series_0_1/periph_timer_periodic branch from a47945e to 1114048 Compare February 13, 2024 09:54
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 15, 2024
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 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