1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-28 22:49:47 +01:00
RIOT/sys/ztimer
bors[bot] bff745236c
Merge #19817 #19826 #19841 #19842
19817: compile_and_test_for_boards: Add no-compile flag r=benpicco a=MrKevinWeiss


### Contribution description

Since we have a no-test flag that prevents executing tests, I think a no-compile flag is a nice compliment. Why? Well if I want to use this script for running multiple boards at the same time, RIOT is not so great handling parallel compile steps with conflicts on lockfiles happening, mostly due to packages. With this I can compile a list of boards sequentially, then flash and run tests in parallel, skipping the compile step.


### Testing procedure

Run the following once to compile and clean:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --clean-after
```

Then try to run without the compile step and it should fail due to lack of the binary
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --no-compile
```

### Issues/PRs references


19826: ztimer/periodic: reinit remove from right clock and handle aquired ztimer r=benpicco a=kfessel

### Contribution description

#19806 added some retinit handling for ztimer periodic removing the timer from the new clock 

This tries to detect if this is a reinit and remove the timer from the old clock
this also removes the ztimer_acquire/_release handling by removing now calls in favour of set return value and now values  that are allready in ztimer,
that also has the potential to reduce the jitter of the periodic calls and bus-usage (for cpus that take their time to get "now") 

### Testing procedure

read

run tests/sys/ztimer_periodic

### Issues/PRs references

Fixes #19806 

19841: boards/adafruit-itsybitsy-nrf52: Add configuration for DotStar LED r=benpicco a=jimporter



19842: cpu/stm32: fix ld script for SRAM4 r=benpicco a=gschorcht

### Contribution description

This PR fixes the LD script for STM32.

Since the CCM and SRAM4 length are defined as symbols with perifx `_`, the LD script didn't use them correctly. Instead of using `ccmram_length` and `sram4_length`, `_ccmram_length` and `_sram4_length` have to be used. Furthermore, the location counter for the SRAM has to be set to the beginning of SRAM4 to work.

BTW, I don't understand why the `ccmram` region is defined. There is no section definition that would use it to place code or data with attribute `.ccmram.*` there.

Without the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board were:
```python
00000000 T _sheap2     <== wrong start position because of wrong location counter
28000000 T _eheap2     <== wrong end position because of `sram4_length` is 0.
```
Although the `tests/sys/malloc` crashes for `b-u585i-iot02a` at the end of the heap (known problem, see [here](https://github.com/RIOT-OS/RIOT/pull/17410#issuecomment-996556823)), it uses only the backup RAM before it crashes:
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
```

With the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board are:
```python
28000000 T _sheap2     <== correct start position
28004000 T _eheap2     <== correct end position
```
`tests/sys/malloc` also crashes for the `b-u585i-iot02a` at the end of the heap, but it uses also the SRAM4 before it crashes.
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
Allocated 512 Bytes at 0x28000008, total 759712
Allocated 512 Bytes at 0x28000210, total 760232
Allocated 512 Bytes at 0x28000418, total 760752
...
Allocated 512 Bytes at 0x280038e8, total 774272
Allocated 512 Bytes at 0x28003af0, total 774792
Allocated 512 Bytes at 0x28003cf8, total 775312
```

### Testing procedure

1. Flash `tests/sys/malloc` and use `MAX_MEM` limit to stop `malloc` before the crash:
   ```
   CFLAGS='-DMAX_MEM=774800 -DCHUNK_SIZE=512 -DDEBUG_ASSERT_VERBOSE' \
   BOARD=b-u585i-iot02a make -j8 -C tests/sys/malloc flash
   ```
   Without the PR it crashes at the end of the backup RAM. With the PR it works.

2. Check `_sheap2` and `_eheap2` with
   ```
   nm -s tests/sys/malloc/bin/b-u585i-iot02a/tests_malloc.elf | grep heap2 | sort
   ```
   Without the PR it will be:
   ```
   00000000 T _sheap2
   28000000 T _eheap2
   ```
   With the PR it should be:
   ```
   28000000 T _sheap2
   28004000 T _eheap2
   ```

### Issues/PRs references


Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Jim Porter <jporterbugs@gmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-24 10:50:36 +00:00
..
convert_frac.c ztimer/ztimer64: uncrustify code 2023-03-15 15:13:48 +01:00
convert_muldiv64.c ztimer/convert: pass-thru start/stop ops to lower timer 2022-11-22 00:25:34 +01:00
convert_shift.c ztimer/convert: pass-thru start/stop ops to lower timer 2022-11-22 00:25:34 +01:00
convert.c ztimer/ztimer64: uncrustify code 2023-03-15 15:13:48 +01:00
core.c sys/ztimer: work around bug in old LLVM 2023-07-18 12:24:08 +02:00
init.c ztimer: acquire and release clock for running timers 2022-11-22 00:25:34 +01:00
Kconfig ztimer: add on_demand_strict 2022-11-22 00:25:34 +01:00
Makefile makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS 2022-10-27 14:28:06 +02:00
Makefile.dep sys/evtimer: remove support for xtimer backend 2023-05-24 09:53:33 +02:00
Makefile.include sys/ztimer: add ztimer_periph_rtt module conflict warning 2021-12-02 07:54:38 +01:00
mock.c sys/ztimer: fix typo in debug output 2023-05-02 09:53:16 +02:00
overhead.c ztimer/overhead: acquire and release clocks 2022-11-22 00:25:34 +01:00
periodic.c ztimer/periodic: stop timer before reinit, remove aquire/release 2023-07-14 18:27:06 +02:00
periph_ptp.c sys/ztimer: add periph_ptp backend 2021-03-28 15:50:19 +02:00
periph_rtc.c ztimer/periph_rtc: add start() and stop() ops 2022-11-22 00:25:34 +01:00
periph_rtt.c ztimer/periph_rtt: add start() and stop() ops 2022-11-22 00:25:34 +01:00
periph_timer.c ztimer/periph_timer: add start() and stop() ops 2022-11-22 00:25:34 +01:00
util.c ztimer: introduce ztimer_mutex_unlock_after() 2023-01-13 00:08:55 +01:00
xtimer2ztimer.cocci sys/ztimer/xtimer2ztimer.cocci: extend and fix api replacements 2021-11-18 18:27:23 +01:00