1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/periph_rtt_min
Francisco Molina 050fc872b3
tests/periph_rtt_min: adapt test to slow rtt
pyterm only echoes after a \n is received, so use socat instead
so '.' are printed as they are generated. This will make the test
timeout for slow rtts like kinetis.

For these slow paltforms also reduce the sample size.
2020-09-02 15:29:35 +02:00
..
tests tests/periph_rtt_min: add test to figure out RTT_MIN_OFFSET 2020-08-19 09:28:24 +02:00
main.c tests/periph_rtt_min: add test to figure out RTT_MIN_OFFSET 2020-08-19 09:28:24 +02:00
Makefile tests/periph_rtt_min: adapt test to slow rtt 2020-09-02 15:29:35 +02:00
README.md tests/periph_rtt_min: add test to figure out RTT_MIN_OFFSET 2020-08-19 09:28:24 +02:00

About

This applications is meant to determine RTT_MIN_OFFSET for a specific BOARD.

The application will iteratively set an alarm starting from 0 ticks offset until the alarm actually triggers. Every time the alarm underflows the alarm will not be triggered within the expected time, so the application will set another one with a larger offset until the alarm successfully triggers.

The rtt might advance between the call to rtt_get_counter() and rtt_set_alarm(). If that happens with val=1 then the alarm would be set to the current time and underflow. The test is ran over multiple samples to make this more likely to happen. Nonetheless its always possible that now sample will underflow so a conservatory value would be to set RTT_MIN_OFFSET to the value found out with this test + 1tick.

Usage

Run BOARD=<board> make -C tests/periph_rtt_min/ flash test the value will be printed as:

Evaluate RTT_MIN_OFFSET over 1024 samples
........................................................................
........................................................................
........................................................................
........................................................................
........................................................................
RTT_MIN_OFFSET for <board>: 2