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/msp430: improve periph_timer #20160

Merged
merged 4 commits into from
Dec 10, 2023
Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Dec 6, 2023

Contribution description

  • add support for multiple timers
  • add support for selecting clock source in the board's periph_conf.h
  • add support for the prescaler
  • implement periph_timer_query_freqs
  • add a second timer to all MSP430 boards
    • the first timer is fast ticking, high-power
    • the second is slow ticking, low-power

Testing procedure

make BOARD=olimex-msp430-h1611 flash test -C tests/periph/timer
make: Entering directory '/home/maribu/Repos/software/RIOT/msp430/tests/periph/timer'
Building application "tests_timer" for "olimex-msp430-h1611" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/msp430/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/msp430/boards/olimex-msp430-h1611
"make" -C /home/maribu/Repos/software/RIOT/msp430/core
"make" -C /home/maribu/Repos/software/RIOT/msp430/core/lib
"make" -C /home/maribu/Repos/software/RIOT/msp430/cpu/msp430
"make" -C /home/maribu/Repos/software/RIOT/msp430/cpu/msp430/periph
"make" -C /home/maribu/Repos/software/RIOT/msp430/drivers
"make" -C /home/maribu/Repos/software/RIOT/msp430/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/div
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/malloc_thread_safe
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/newlib_syscalls_default
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/preprocessor
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/stdio_uart
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/test_utils/interactive_sync
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/test_utils/print_stack_usage
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/tsrb
/usr/lib/gcc/msp430-elf/13.1.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/msp430/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.elf has a LOAD segment with RWX permissions
   text	  data	   bss	   dec	   hex	filename
  11425	   180	  1186	 12791	  31f7	/home/maribu/Repos/software/RIOT/msp430/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.elf
mspdebug -j olimex "prog /home/maribu/Repos/software/RIOT/msp430/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf16c
  Code start address: 0x4000
  Code size         : 49152 byte = 48 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F1611
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data:
  ver_id:         6cf1
  ver_sub_id:     0000
  revision:       20
  fab:            40
  self:           0000
  config:         00
  fuses:          00
Device: MSP430F1611
Erasing...
Programming...
Writing 1345 bytes at 4000...
Writing 4096 bytes at 4542...
Writing 4096 bytes at 5542...
Writing 2056 bytes at 6542...
Writing    2 bytes at ffe6...
Writing    4 bytes at ffea...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 11605 bytes total
r
/home/maribu/Repos/software/RIOT/msp430/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: 2023.10-devel-683-g151c9-cpu/msp430/timer)

Test for peripheral TIMERs

Available timers: 2

TIMER 0
=======

  - supported frequencies:
    0: 5025792
    1: 2512896
    2: 1256448
    ....
    3: 628224
  - Calling timer_init(0, 5025792)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      114      - init:      114
    - channel 1 fired at SW count      224      - diff:      110
    - channel 2 fired at SW count      332      - diff:      108
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 2512896)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      228      - init:      228
    - channel 1 fired at SW count      451      - diff:      223
    - channel 2 fired at SW count      673      - diff:      222
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 1256448)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      455      - init:      455
    - channel 1 fired at SW count      906      - diff:      451
    - channel 2 fired at SW count     1355      - diff:      449
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    3: 4096
  - Calling timer_init(1, 32768)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    17428      - init:    17428
    - channel 1 fired at SW count    34852      - diff:    17424
    - channel 2 fired at SW count    52275      - diff:    17423
    - channel 3 fired at SW count     4161      - diff:    17422
    - channel 4 fired at SW count    21583      - diff:    17422
    - channel 5 fired at SW count    39005      - diff:    17422
    - channel 6 fired at SW count    56427      - diff:    17422
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 16384)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    34849      - init:    34849
    - channel 1 fired at SW count     4164      - diff:    34851
    - channel 2 fired at SW count    39014      - diff:    34850
    - channel 3 fired at SW count     8327      - diff:    34849
    - channel 4 fired at SW count    43176      - diff:    34849
    - channel 5 fired at SW count    12491      - diff:    34851
    - channel 6 fired at SW count    47340      - diff:    34849
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 8192)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count     4170      - init:    69706
    - channel 1 fired at SW count     8347      - diff:    69713
    - channel 2 fired at SW count    12522      - diff:    69711
    - channel 3 fired at SW count    16697      - diff:    69711
    - channel 4 fired at SW count    20871      - diff:    69710
    - channel 5 fired at SW count    25044      - diff:    69709
    - channel 6 fired at SW count    29218      - diff:    69710
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED

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

Issues/PRs references

Implements: #16349
Depends on and includes:

@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: MSP Platform: This PR/issue effects MSP-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 6, 2023
@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Dec 6, 2023
@OlegHahm
Copy link
Member

OlegHahm commented Dec 6, 2023

Could this be tested on a different MSP430 board as well?

@riot-ci
Copy link

riot-ci commented Dec 6, 2023

Murdock results

✔️ PASSED

eca0bdd examples,tests: Update Makefile.cis

Success Failures Total Runtime
8082 0 8082 10m:51s

Artifacts

@maribu
Copy link
Member Author

maribu commented Dec 7, 2023

Could this be tested on a different MSP430 board as well?

Yes, any MSP430 board supported by RIOT has the same two timer peripherals. Only the frequencies the first timer can generate will differ when the CPU clock is different.

Note that the tests for the 32.678 kHz timer is taking a couple of seconds due to the slow speed of the timer and the test iterating over three different frequencies the timer claims to support.

@github-actions github-actions bot added the Area: doc Area: Documentation label Dec 7, 2023
@maribu
Copy link
Member Author

maribu commented Dec 7, 2023

Looks like there is still an issue with spurious IRQs on MSP430 F2xx/G2xx:

make BOARD=olimex-msp430-h2618 flash test -j -C tests/periph/timer
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
Building application "tests_timer" for "olimex-msp430-h2618" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/olimex-msp430-h2618
"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/msp430
"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/drivers/periph_common
"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/cpu/msp430/periph
"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/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
/usr/lib/gcc/msp430-elf/13.1.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.elf has a LOAD segment with RWX permissions
   text	  data	   bss	   dec	   hex	filename
  11115	   168	  1186	 12469	  30b5	/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.elf
mspdebug -j olimex "prog /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf26f
  Code start address: 0x3100
  Code size         : 118528 byte = 115 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F2618
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data:
  ver_id:         6ff2
  ver_sub_id:     0000
  revision:       07
  fab:            60
  self:           0000
  config:         00
  fuses:          00
Device: MSP430F2619
Erasing...
Programming...
Writing 1345 bytes at 3100...
Writing 4096 bytes at 3642...
Writing 4096 bytes at 4642...
Writing 1734 bytes at 5642...
Writing    6 bytes at ffee...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 11283 bytes total
Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-685-g81acb-cpu/msp430/timer)

Test for peripheral TIMERs

Available timers: 2

TIMER 0
=======

  - supported frequencies:
    0: 16027648
    1: 8013824
    2: 4006912
    ....
    3: 2003456
  - Calling timer_init(0, 16027648)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      125      - init:      125
    - channel 1 fired at SW count      246      - diff:      121
    - channel 2 fired at SW count      366      - diff:      120
  - Validating no spurious IRQs are triggered:
    ERROR: Spurious timer fired (2/2)
  - Calling timer_init(0, 8013824)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      250      - init:      250
    - channel 1 fired at SW count      496      - diff:      246
    - channel 2 fired at SW count      741      - diff:      245
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 4006912)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(0, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(0, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      500      - init:      500
    - channel 1 fired at SW count      996      - diff:      496
    - channel 2 fired at SW count     1491      - diff:      495
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    3: 4096
  - Calling timer_init(1, 32768)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    61112      - init:    61112
    - channel 1 fired at SW count    56691      - diff:    61115
    - channel 2 fired at SW count    52268      - diff:    61113
    - channel 3 fired at SW count    47849      - diff:    61117
    - channel 4 fired at SW count    43420      - diff:    61107
    - channel 5 fired at SW count    38987      - diff:    61103
    - channel 6 fired at SW count    34561      - diff:    61110
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 16384)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    56665      - init:   122201
    - channel 1 fired at SW count    47807      - diff:   122214
    - channel 2 fired at SW count    38944      - diff:   122209
    - channel 3 fired at SW count    30083      - diff:   122211
    - channel 4 fired at SW count    21228      - diff:   122217
    - channel 5 fired at SW count    12364      - diff:   122208
    - channel 6 fired at SW count     3529      - diff:   122237
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 8192)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 5000)
    Successfully set timeout 5000 for channel 0
  - timer_set(1, 1, 10000)
    Successfully set timeout 10000 for channel 1
  - timer_set(1, 2, 15000)
    Successfully set timeout 15000 for channel 2
  - timer_set(1, 3, 20000)
    Successfully set timeout 20000 for channel 3
  - timer_set(1, 4, 25000)
    Successfully set timeout 25000 for channel 4
  - timer_set(1, 5, 30000)
    Successfully set timeout 30000 for channel 5
  - timer_set(1, 6, 35000)
    Successfully set timeout 35000 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count    47818      - init:   244426
    - channel 1 fired at SW count    30107      - diff:   244433
    - channel 2 fired at SW count    12376      - diff:   244413
    - channel 3 fired at SW count    60213      - diff:   244445
    - channel 4 fired at SW count    42503      - diff:   244434
    - channel 5 fired at SW count    24805      - diff:   244446
    - channel 6 fired at SW count     7100      - diff:   244439
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST FAILED

@maribu
Copy link
Member Author

maribu commented Dec 7, 2023

Looks like there is still an issue with spurious IRQs on MSP430 F2xx/G2xx:

No, the test was just buggy 😅

#20161 fixes the issue.

@maribu maribu added the State: waiting for other PR State: The PR requires another PR to be merged first label Dec 7, 2023
@maribu maribu removed the State: waiting for other PR State: The PR requires another PR to be merged first label Dec 7, 2023
@github-actions github-actions bot removed the Area: tests Area: tests and testing framework label Dec 7, 2023
@maribu
Copy link
Member Author

maribu commented Dec 7, 2023

Now it works:

make BOARD=olimex-msp430-h2618 flash test -j -C tests/periph/timer
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
Building application "tests_timer" for "olimex-msp430-h2618" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/olimex-msp430-h2618
"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/msp430
"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/drivers/periph_common
"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/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/msp430/periph
"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/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
/usr/lib/gcc/msp430-elf/13.1.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.elf has a LOAD segment with RWX permissions
   text	  data	   bss	   dec	   hex	filename
  13001	   266	  1186	 14453	  3875	/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.elf
mspdebug -j olimex "prog /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h2618/tests_timer.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf26f
  Code start address: 0x3100
  Code size         : 118528 byte = 115 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F2618
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data:
  ver_id:         6ff2
  ver_sub_id:     0000
  revision:       07
  fab:            60
  self:           0000
  config:         00
  fuses:          00
Device: MSP430F2619
Erasing...
Programming...
Writing 1601 bytes at 3100...
Writing 4096 bytes at 3742...
Writing 4096 bytes at 4742...
Writing 3462 bytes at 5742...
Writing    6 bytes at ffee...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 13267 bytes total
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.
Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-692-g1c944-cpu/msp430/timer)

Test for peripheral TIMERs

Available timers: 2

TIMER 0
=======

  - supported frequencies:
    0: 16027648
    1: 8013824
    2: 4006912
    ....
    3: 2003456
  - Calling timer_init(0, 16027648)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 14602)
    Successfully set timeout 14602 for channel 0
  - timer_set(0, 1, 29204)
    Successfully set timeout 29204 for channel 1
  - timer_set(0, 2, 43806)
    Successfully set timeout 43806 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      365      - init:      365
    - channel 1 fired at SW count      727      - diff:      362
    - channel 2 fired at SW count     1086      - diff:      359
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 8013824)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 40069)
    Successfully set timeout 40069 for channel 0
  - timer_set(0, 1, 14602)
    Successfully set timeout 14602 for channel 1
  - timer_set(0, 2, 54671)
    Successfully set timeout 54671 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count     1998      - init:     1998
    - channel 1 fired at SW count      730      - diff: 4294966028
    - channel 2 fired at SW count     2725      - diff:     1995
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 4006912)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 20034)
    Successfully set timeout 20034 for channel 0
  - timer_set(0, 1, 40068)
    Successfully set timeout 40068 for channel 1
  - timer_set(0, 2, 60102)
    Successfully set timeout 60102 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count     2004      - init:     2004
    - channel 1 fired at SW count     4003      - diff:     1999
    - channel 2 fired at SW count     6001      - diff:     1998
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    3: 4096
  - Calling timer_init(1, 32768)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 163)
    Successfully set timeout 163 for channel 0
  - timer_set(1, 1, 326)
    Successfully set timeout 326 for channel 1
  - timer_set(1, 2, 489)
    Successfully set timeout 489 for channel 2
  - timer_set(1, 3, 652)
    Successfully set timeout 652 for channel 3
  - timer_set(1, 4, 815)
    Successfully set timeout 815 for channel 4
  - timer_set(1, 5, 978)
    Successfully set timeout 978 for channel 5
  - timer_set(1, 6, 1141)
    Successfully set timeout 1141 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count     1984      - init:     1984
    - channel 1 fired at SW count     3973      - diff:     1989
    - channel 2 fired at SW count     5961      - diff:     1988
    - channel 3 fired at SW count     7949      - diff:     1988
    - channel 4 fired at SW count     9937      - diff:     1988
    - channel 5 fired at SW count    11925      - diff:     1988
    - channel 6 fired at SW count    13913      - diff:     1988
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 16384)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 81)
    Successfully set timeout 81 for channel 0
  - timer_set(1, 1, 162)
    Successfully set timeout 162 for channel 1
  - timer_set(1, 2, 243)
    Successfully set timeout 243 for channel 2
  - timer_set(1, 3, 324)
    Successfully set timeout 324 for channel 3
  - timer_set(1, 4, 405)
    Successfully set timeout 405 for channel 4
  - timer_set(1, 5, 486)
    Successfully set timeout 486 for channel 5
  - timer_set(1, 6, 567)
    Successfully set timeout 567 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count     1971      - init:     1971
    - channel 1 fired at SW count     3947      - diff:     1976
    - channel 2 fired at SW count     5923      - diff:     1976
    - channel 3 fired at SW count     7898      - diff:     1975
    - channel 4 fired at SW count     9874      - diff:     1976
    - channel 5 fired at SW count    11849      - diff:     1975
    - channel 6 fired at SW count    13824      - diff:     1975
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 8192)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 40)
    Successfully set timeout 40 for channel 0
  - timer_set(1, 1, 80)
    Successfully set timeout 80 for channel 1
  - timer_set(1, 2, 120)
    Successfully set timeout 120 for channel 2
  - timer_set(1, 3, 160)
    Successfully set timeout 160 for channel 3
  - timer_set(1, 4, 200)
    Successfully set timeout 200 for channel 4
  - timer_set(1, 5, 240)
    Successfully set timeout 240 for channel 5
  - timer_set(1, 6, 280)
    Successfully set timeout 280 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count     1950      - init:     1950
    - channel 1 fired at SW count     3903      - diff:     1953
    - channel 2 fired at SW count     5854      - diff:     1951
    - channel 3 fired at SW count     7805      - diff:     1951
    - channel 4 fired at SW count     9756      - diff:     1951
    - channel 5 fired at SW count    11707      - diff:     1951
    - channel 6 fired at SW count    13658      - diff:     1951
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED
make BOARD=olimex-msp430-h1611 flash test -j -C tests/periph/timer
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
Building application "tests_timer" for "olimex-msp430-h1611" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/olimex-msp430-h1611
"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/msp430
"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/drivers/periph_common
"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/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/msp430/periph
"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/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
/usr/lib/gcc/msp430-elf/13.1.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.elf has a LOAD segment with RWX permissions
   text	  data	   bss	   dec	   hex	filename
  13353	   290	  1186	 14829	  39ed	/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.elf
mspdebug -j olimex "prog /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/olimex-msp430-h1611/tests_timer.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf16c
  Code start address: 0x4000
  Code size         : 49152 byte = 48 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F1611
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data:
  ver_id:         6cf1
  ver_sub_id:     0000
  revision:       20
  fab:            40
  self:           0000
  config:         00
  fuses:          00
Device: MSP430F1611
Erasing...
Programming...
Writing 1601 bytes at 4000...
Writing 4096 bytes at 4642...
Writing 4096 bytes at 5642...
Writing 3838 bytes at 6642...
Writing    2 bytes at ffe6...
Writing    4 bytes at ffea...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 13643 bytes total
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.
Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-692-g1c944-cpu/msp430/timer)

Test for peripheral TIMERs

Available timers: 2

TIMER 0
=======

  - supported frequencies:
    0: 5017600
    1: 2508800
    2: 1254400
    ....
    3: 627200
  - Calling timer_init(0, 5017600)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 25088)
    Successfully set timeout 25088 for channel 0
  - timer_set(0, 1, 50176)
    Successfully set timeout 50176 for channel 1
  - timer_set(0, 2, 9728)
    Successfully set timeout 9728 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      565      - init:      565
    - channel 1 fired at SW count     1132      - diff:      567
    - channel 2 fired at SW count      221      - diff: 4294966385
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 2508800)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 12544)
    Successfully set timeout 12544 for channel 0
  - timer_set(0, 1, 25088)
    Successfully set timeout 25088 for channel 1
  - timer_set(0, 2, 37632)
    Successfully set timeout 37632 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      571      - init:      571
    - channel 1 fired at SW count     1137      - diff:      566
    - channel 2 fired at SW count     1702      - diff:      565
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 1254400)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 6272)
    Successfully set timeout 6272 for channel 0
  - timer_set(0, 1, 12544)
    Successfully set timeout 12544 for channel 1
  - timer_set(0, 2, 18816)
    Successfully set timeout 18816 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      571      - init:      571
    - channel 1 fired at SW count     1137      - diff:      566
    - channel 2 fired at SW count     1702      - diff:      565
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    3: 4096
  - Calling timer_init(1, 32768)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 163)
    Successfully set timeout 163 for channel 0
  - timer_set(1, 1, 326)
    Successfully set timeout 326 for channel 1
  - timer_set(1, 2, 489)
    Successfully set timeout 489 for channel 2
  - timer_set(1, 3, 652)
    Successfully set timeout 652 for channel 3
  - timer_set(1, 4, 815)
    Successfully set timeout 815 for channel 4
  - timer_set(1, 5, 978)
    Successfully set timeout 978 for channel 5
  - timer_set(1, 6, 1141)
    Successfully set timeout 1141 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      565      - init:      565
    - channel 1 fired at SW count     1129      - diff:      564
    - channel 2 fired at SW count     1691      - diff:      562
    - channel 3 fired at SW count     2253      - diff:      562
    - channel 4 fired at SW count     2815      - diff:      562
    - channel 5 fired at SW count     3377      - diff:      562
    - channel 6 fired at SW count     3939      - diff:      562
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 16384)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 81)
    Successfully set timeout 81 for channel 0
  - timer_set(1, 1, 162)
    Successfully set timeout 162 for channel 1
  - timer_set(1, 2, 243)
    Successfully set timeout 243 for channel 2
  - timer_set(1, 3, 324)
    Successfully set timeout 324 for channel 3
  - timer_set(1, 4, 405)
    Successfully set timeout 405 for channel 4
  - timer_set(1, 5, 486)
    Successfully set timeout 486 for channel 5
  - timer_set(1, 6, 567)
    Successfully set timeout 567 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      562      - init:      562
    - channel 1 fired at SW count     1122      - diff:      560
    - channel 2 fired at SW count     1680      - diff:      558
    - channel 3 fired at SW count     2239      - diff:      559
    - channel 4 fired at SW count     2797      - diff:      558
    - channel 5 fired at SW count     3356      - diff:      559
    - channel 6 fired at SW count     3914      - diff:      558
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 8192)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 40)
    Successfully set timeout 40 for channel 0
  - timer_set(1, 1, 80)
    Successfully set timeout 80 for channel 1
  - timer_set(1, 2, 120)
    Successfully set timeout 120 for channel 2
  - timer_set(1, 3, 160)
    Successfully set timeout 160 for channel 3
  - timer_set(1, 4, 200)
    Successfully set timeout 200 for channel 4
  - timer_set(1, 5, 240)
    Successfully set timeout 240 for channel 5
  - timer_set(1, 6, 280)
    Successfully set timeout 280 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      548      - init:      548
    - channel 1 fired at SW count     1101      - diff:      553
    - channel 2 fired at SW count     1652      - diff:      551
    - channel 3 fired at SW count     2204      - diff:      552
    - channel 4 fired at SW count     2755      - diff:      551
    - channel 5 fired at SW count     3307      - diff:      552
    - channel 6 fired at SW count     3858      - diff:      551
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED
make BOARD=msb-430 flash test -j -C tests/periph/timer
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/periph/timer'
Building application "tests_timer" for "msb-430" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/msb-430
"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/msp430
"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/boards/common/msb-430
"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/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/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
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/msp430/periph
/usr/lib/gcc/msp430-elf/13.1.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/msb-430/tests_timer.elf has a LOAD segment with RWX permissions
   text	  data	   bss	   dec	   hex	filename
  13535	   290	  1186	 15011	  3aa3	/home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/msb-430/tests_timer.elf
mspdebug -j olimex "prog /home/maribu/Repos/software/RIOT/master/tests/periph/timer/bin/msb-430/tests_timer.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf16c
  Code start address: 0x2500
  Code size         : 56064 byte = 54 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F1612
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data:
  ver_id:         6cf1
  ver_sub_id:     0000
  revision:       20
  fab:            40
  self:           0000
  config:         00
  fuses:          00
Device: MSP430F1611
Erasing...
Programming...
Writing 1613 bytes at 2500...
Writing 4096 bytes at 2b4e...
Writing 4096 bytes at 3b4e...
Writing 4008 bytes at 4b4e...
Writing    2 bytes at ffe6...
Writing    4 bytes at ffea...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 13825 bytes total
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: 2023.10-devel-692-g1c944-cpu/msp430/timer)

Test for peripheral TIMERs

Available timers: 2

TIMER 0
=======

  - supported frequencies:
    0: 7397376
    1: 3698688
    2: 1849344
    ....
    3: 924672
  - Calling timer_init(0, 7397376)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 36986)
    Successfully set timeout 36986 for channel 0
  - timer_set(0, 1, 8436)
    Successfully set timeout 8436 for channel 1
  - timer_set(0, 2, 45422)
    Successfully set timeout 45422 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      836      - init:      836
    - channel 1 fired at SW count      192      - diff: 4294966652
    - channel 2 fired at SW count     1024      - diff:      832
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 3698688)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 18493)
    Successfully set timeout 18493 for channel 0
  - timer_set(0, 1, 36986)
    Successfully set timeout 36986 for channel 1
  - timer_set(0, 2, 55479)
    Successfully set timeout 55479 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      841      - init:      841
    - channel 1 fired at SW count     1678      - diff:      837
    - channel 2 fired at SW count     2513      - diff:      835
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(0, 1849344)
    initialization successful
  - timer_stop(0): stopped
  - timer_set(0, 0, 9246)
    Successfully set timeout 9246 for channel 0
  - timer_set(0, 1, 18492)
    Successfully set timeout 18492 for channel 1
  - timer_set(0, 2, 27738)
    Successfully set timeout 27738 for channel 2
  - timer_start(0)
  - Results:
    - channel 0 fired at SW count      841      - init:      841
    - channel 1 fired at SW count     1678      - diff:      837
    - channel 2 fired at SW count     2513      - diff:      835
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TIMER 1
=======

  - supported frequencies:
    0: 32768
    1: 16384
    2: 8192
    ....
    3: 4096
  - Calling timer_init(1, 32768)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 163)
    Successfully set timeout 163 for channel 0
  - timer_set(1, 1, 326)
    Successfully set timeout 326 for channel 1
  - timer_set(1, 2, 489)
    Successfully set timeout 489 for channel 2
  - timer_set(1, 3, 652)
    Successfully set timeout 652 for channel 3
  - timer_set(1, 4, 815)
    Successfully set timeout 815 for channel 4
  - timer_set(1, 5, 978)
    Successfully set timeout 978 for channel 5
  - timer_set(1, 6, 1141)
    Successfully set timeout 1141 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      832      - init:      832
    - channel 1 fired at SW count     1662      - diff:      830
    - channel 2 fired at SW count     2490      - diff:      828
    - channel 3 fired at SW count     3318      - diff:      828
    - channel 4 fired at SW count     4146      - diff:      828
    - channel 5 fired at SW count     4974      - diff:      828
    - channel 6 fired at SW count     5803      - diff:      829
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 16384)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 81)
    Successfully set timeout 81 for channel 0
  - timer_set(1, 1, 162)
    Successfully set timeout 162 for channel 1
  - timer_set(1, 2, 243)
    Successfully set timeout 243 for channel 2
  - timer_set(1, 3, 324)
    Successfully set timeout 324 for channel 3
  - timer_set(1, 4, 405)
    Successfully set timeout 405 for channel 4
  - timer_set(1, 5, 486)
    Successfully set timeout 486 for channel 5
  - timer_set(1, 6, 567)
    Successfully set timeout 567 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      820      - init:      820
    - channel 1 fired at SW count     1645      - diff:      825
    - channel 2 fired at SW count     2468      - diff:      823
    - channel 3 fired at SW count     3291      - diff:      823
    - channel 4 fired at SW count     4114      - diff:      823
    - channel 5 fired at SW count     4936      - diff:      822
    - channel 6 fired at SW count     5759      - diff:      823
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)
  - Calling timer_init(1, 8192)
    initialization successful
  - timer_stop(1): stopped
  - timer_set(1, 0, 40)
    Successfully set timeout 40 for channel 0
  - timer_set(1, 1, 80)
    Successfully set timeout 80 for channel 1
  - timer_set(1, 2, 120)
    Successfully set timeout 120 for channel 2
  - timer_set(1, 3, 160)
    Successfully set timeout 160 for channel 3
  - timer_set(1, 4, 200)
    Successfully set timeout 200 for channel 4
  - timer_set(1, 5, 240)
    Successfully set timeout 240 for channel 5
  - timer_set(1, 6, 280)
    Successfully set timeout 280 for channel 6
  - timer_start(1)
  - Results:
    - channel 0 fired at SW count      805      - init:      805
    - channel 1 fired at SW count     1619      - diff:      814
    - channel 2 fired at SW count     2432      - diff:      813
    - channel 3 fired at SW count     3245      - diff:      813
    - channel 4 fired at SW count     4057      - diff:      812
    - channel 5 fired at SW count     4870      - diff:      813
    - channel 6 fired at SW count     5683      - diff:      813
  - Validating no spurious IRQs are triggered:
    OK (no spurious IRQs)

TEST SUCCEEDED

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

I don't have the hardware, but I trust your testing.
Code wise this looks good and is certainly an improvement over the status quo.

boards/common/msp430/include/cfg_timer_a_smclk_b_aclk.h Outdated Show resolved Hide resolved
- add support for multiple timers
- add support for selecting clock source in the board's `periph_conf.h`
- add support for the prescaler
- implement `periph_timer_query_freqs`
- add a second timer to all MSP430 boards
    - the first timer is fast ticking, high-power
    - the second is slow ticking, low-power
Declare functions retrieving the clock domains frequency as pure so
that common subexpressions can be eliminated more easily.
Move common configuration for MSP430 based boards to
`boards/common/msp430` and make use of that.
@maribu maribu enabled auto-merge December 10, 2023 08:11
@maribu maribu added this pull request to the merge queue Dec 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2023
@maribu
Copy link
Member Author

maribu commented Dec 10, 2023

examples/gnrc_networking_minimal still builds with my local toolchain and is a whopping 4 B larger in terms of RAM. (.text grew a few 100 B, but that is expected with an actual timer implementation now present.) Anyway, with the CI toolchain I need to touch the Makefile.cis.

@maribu maribu requested a review from miri64 as a code owner December 10, 2023 12:51
@maribu maribu enabled auto-merge December 10, 2023 12:51
@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: examples Area: Example Applications labels Dec 10, 2023
@maribu maribu added this pull request to the merge queue Dec 10, 2023
Merged via the queue into RIOT-OS:master with commit bb07bb6 Dec 10, 2023
25 checks passed
@maribu
Copy link
Member Author

maribu commented Dec 10, 2023

🎉 Thanks a lot! :-)

@maribu maribu deleted the cpu/msp430/timer branch December 10, 2023 15:45
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.01 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MSP Platform: This PR/issue effects MSP-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation 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.

5 participants