1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys
bors[bot] 46af92d3a0
Merge #18620 #19296 #19504 #19506
18620: core: add core_mutex_debug to aid debugging deadlocks r=maribu a=maribu

### Contribution description

Adding `USEMODULE += core_mutex_debug` to your `Makefile` results in
on log messages such as

    [mutex] waiting for thread 1 (pc = 0x800024d)

being added whenever `mutex_lock()` blocks. This makes tracing down
deadlocks easier.

### Testing procedure

Run e.g.

```sh
USEMODULE=core_mutex_debug BOARD=nucleo-f767zi make -C tests/mutex_cancel flash test
```

which should provide output such as

```
Welcome to pyterm!
Type '/exit' to exit.
READY
s
[mutex] waiting for thread 1 (pc = 0x8000f35)
START
main(): This is RIOT! (Version: 2022.10-devel-841-g5cc02-core/mutex/debug)
Test Application for mutex_cancel / mutex_lock_cancelable
=========================================================

Test without cancellation: OK
Test early cancellation: OK
Verify no side effects on subsequent calls: [mutex] waiting for thread 1 (pc = 0x800024d)
OK
Test late cancellation: [mutex] waiting for thread 1 (pc = 0x0)
OK
TEST PASSED
```

```sh
$ arm-none-eabi-addr2line -a 0x800024d -e tests/mutex_cancel/bin/nucleo-f767zi/tests_mutex_cancel.elf 
0x0800024d
/home/maribu/Repos/software/RIOT/tests/mutex_cancel/main.c:51
```

### Issues/PRs references

Depends on and includes https://github.com/RIOT-OS/RIOT/pull/18619

19296: nanocoap: allow to define CoAP resources as XFA r=maribu a=benpicco



19504: cpu/cc26xx_cc13xx: Fix bogus array-bound warning r=maribu a=maribu

### Contribution description

GCC 12 create a bogus array out of bounds warning as it assumes that because there is special handling for `uart == 0` and `uart == 1`, `uart` can indeed be `1`. There is an `assert(uart < UART_NUMOF)` above that would blow up prior to any out of bounds access.

In any case, optimizing out the special handling of `uart == 1` for when `UART_NUMOF == 1` likely improves the generated code and fixes the warning.

    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:88:8: error: array subscript 1 is above array bounds of 'uart_isr_ctx_t[1]' [-Werror=array-bounds]
       88 |     ctx[uart].rx_cb = rx_cb;
          |     ~~~^~~~~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:52:23: note: while referencing 'ctx'
       52 | static uart_isr_ctx_t ctx[UART_NUMOF];
          |                       ^~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:89:8: error: array subscript 1 is above array bounds of 'uart_isr_ctx_t[1]' [-Werror=array-bounds]
       89 |     ctx[uart].arg = arg;
          |     ~~~^~~~~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:52:23: note: while referencing 'ctx'
       52 | static uart_isr_ctx_t ctx[UART_NUMOF];
          |                       ^~~

### Testing procedure

The actual change is a pretty obvious one-liner, so that code review and a green CI should be sufficient. If not, running any UART example app without regression should do.

### Issues/PRs references

None

19506: tools/openocd: Fix handling of OPENOCD_CMD_RESET_HALT r=maribu a=maribu

### Contribution description

The OPENOCD_CMD_RESET_HALT was not longer correctly passed to the script. This fixes the issue.

### Testing procedure

Flashing of e.g. the `cc2650-launchpad` with upstream OpenOCD should work again.

### Issues/PRs references

The change was added to https://github.com/RIOT-OS/RIOT/pull/19050 after testing the PR and before merging. I'm not sure if the fix never worked because of this, or if behavior of `target-export-variables` or GNU Make changed.

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-04-25 15:46:11 +00:00
..
analog_util sys/analog_util/dac_util: fix truncation bug 2022-12-09 13:58:12 -05:00
app_metadata
arduino codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
auto_init Merge #18620 #19296 #19504 #19506 2023-04-25 15:46:11 +00:00
base64
benchmark
bhp sys/bhp_msg: add IPC based Bottom Half Processor 2022-08-19 12:01:30 +02:00
bitfield sys/bitfield: don't set unrelated bits in bf_{set, clear}_all() 2023-03-17 00:08:10 +01:00
bloom
bus
can core/lib: Add macros/utils.h header 2023-01-07 09:47:44 +01:00
cb_mux
checksum sys/checksum: add CRC-16 implementation without lookup table 2022-10-06 17:43:20 +02:00
chunked_ringbuffer
clif sys/clif: Fixing out of bounds read under certain conditions 2023-02-23 15:45:03 +01:00
coding sys/coding: add XOR based coding module 2023-02-06 16:21:57 +01:00
color
congure congure_abe: initial import of TCP ABE congestion control 2022-10-17 16:44:39 +02:00
cpp11-compat cpp11-compat: thread::sleep_for in microseconds 2023-04-17 13:27:14 +02:00
cpp_new_delete
crypto sys/crypto: make AES_KEY struct private 2023-02-20 18:22:00 +01:00
cxx_ctor_guards
debug_irq_disable cpu/cortexm_common: measure time spent with IRQ disabled 2022-11-24 21:27:20 +01:00
div
ecc
eepreg
embunit
entropy_source
event sys/event: ensure that a queue has a waiter before waiting for flags 2022-04-14 17:10:24 +02:00
evtimer
fido2 fido2/ctap: uncrustify files 2022-09-23 16:42:52 +02:00
fmt Merge #19027 2023-02-17 20:09:53 +00:00
frac
fs vfs: drop unused abs_path parameter 2022-09-29 22:01:37 +02:00
fuzzing fuzzing: Add uri_parser fuzzer setup 2022-12-19 13:03:45 +01:00
hashes core/lib: Add macros/utils.h header 2023-01-07 09:47:44 +01:00
include Merge #18620 #19296 #19504 #19506 2023-04-25 15:46:11 +00:00
iolist sys/iolist: introduce iolist_to_buffer() 2022-05-02 23:23:52 +02:00
isrpipe
libc sys/string_utils: add strscpy() 2022-09-26 19:06:46 +02:00
log_color cpu/avr8_common: Wrap stdio.h 2023-02-27 12:31:03 +01:00
log_printfnoformat sys/log: modularize log into log_color and log_printfnoformat 2022-10-12 12:21:29 +02:00
luid
malloc_thread_safe sys/malloc_tracing: add module to trace dyn memory management 2022-11-15 12:59:46 +01:00
matstat
memarray
mineplex
net Merge #18620 #19296 #19504 #19506 2023-04-25 15:46:11 +00:00
newlib_syscalls_default cpu/mips: Remove all mips 2022-09-27 13:42:37 +02:00
od
oneway-malloc
phydat sys/phydat: use flash_utils 2023-02-27 12:31:03 +01:00
picolibc_syscalls_default sys/picolibc_syscalls_default: Fix read/write return for picolibc >= 1.8 2023-03-03 12:04:48 -08:00
pipe
pm_layered Revert "sys/pm_layered: pm_(un)block add attribute optimize(3) -shortens hotpath" 2023-01-16 11:28:30 +01:00
posix treewide: fix typos found by recent codespell 2022-11-24 14:53:48 +01:00
preprocessor sys/preprocessor: add Kconfig file 2022-10-17 10:38:14 +02:00
progress_bar
ps
puf_sram sys/puf_sram: cleanup header 2022-12-05 16:13:21 +01:00
random random: use void * in random_bytes() 2022-07-26 19:46:14 +02:00
riotboot sys/riotboot: uses SLOT1_OFFSET in hex format 2023-04-18 06:20:14 +02:00
rtc_utils
rust_riotmodules rust_riotmodules: pub use instead of extern crate 2022-07-10 21:27:13 +02:00
rust_riotmodules_standalone Rust: Update riot-wrappers 2023-04-25 09:20:58 +02:00
saul_reg drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sched_round_robin
schedstatistics
sema
sema_inv
senml sys/phydat: Fix unit confusion 2023-02-23 16:44:24 +01:00
seq
shell sys/shell: restructure deps 2023-04-21 09:45:45 +02:00
shell_lock sys/shell_lock: do not call strlen, less jumpy 2023-01-16 21:11:58 +01:00
ssp
stdio_nimble core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
stdio_null Merge #18459 #18724 #19081 #19082 #19136 2023-01-13 13:50:55 +00:00
stdio_rtt sys/stdio_rtt: move documentation in doc.txt 2023-02-05 15:49:20 +01:00
stdio_semihosting core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
stdio_uart core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
stdio_udp sys/stdio_udp: add stdio over UDP 2023-01-13 11:08:22 +01:00
suit sys/suit: drop superfluous ')' in output 2023-03-10 02:27:43 +01:00
test_utils sys/test_utils/print_stack_usage: reduce MIN_SIZE for fmt 2023-02-07 22:42:43 +01:00
timex
tiny_strerror sys/tiny_strerror: make use of flash_utils.h 2023-02-27 23:25:13 +01:00
trace
trickle sys/trickle: Model kconfig 2023-03-17 12:09:01 +01:00
tsrb
universal_address
uri_parser sys/uri_parser: fixing potential out of bounds read when consuming ports 2022-12-05 15:41:33 +01:00
usb usbus: remove deprecated USBUS_HANDLER_FLAG_TR_FAIL flag 2023-04-19 20:54:30 +02:00
usb_board_reset sys/usb_board_reset: allow to enable it also for stdio_usb_serial_jtag 2023-02-06 16:19:11 +01:00
ut_process
uuid
vfs sys/vfs: add force option to vfs_umount() 2023-02-28 17:24:03 +01:00
vfs_util sys/vfs_util: bugfix rec. delete, rel. components 2022-08-30 17:53:36 +02:00
xtimer
zptr
ztimer ztimer/ztimer64: uncrustify code 2023-03-15 15:13:48 +01:00
ztimer64
doc.txt sys/doc.txt: add sys_compression doxygen group 2023-02-27 15:09:08 +01:00
Kconfig sys/trickle: Model kconfig 2023-03-17 12:09:01 +01:00
Kconfig.newlib
Kconfig.picolibc
Kconfig.stdio cpu/esp32: add stdio_usb_serial_jtag 2023-01-09 00:51:27 +01:00
Makefile sys/preprocessor: add preprocessor module 2022-10-17 10:38:14 +02:00
Makefile.dep Merge #18620 #19296 #19504 #19506 2023-04-25 15:46:11 +00:00
Makefile.include sys: define CPU_RAM_SIZE as hex number 2023-04-18 06:20:14 +02:00