1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

1897 Commits

Author SHA1 Message Date
Marian Buschsieweke
3718f48bc2
dist/tools/insufficient_memory: add RISC-V failure mode
On RISC-V a RAM overlow is reported as:

    /opt/xpack-riscv-none-elf-gcc-13.2.0-2/bin/../lib/gcc/riscv-none-elf/13.2.0/../../../../riscv-none-elf/bin/ld: section .stack VMA [80003f00,80003fff] overlaps section .bss VMA [800000a8,80003fb7]

This extends the list of patters detecting RAM overflow.

Co-authored-by: benpicco <benpicco@googlemail.com>
2024-02-12 16:13:41 +01:00
Marian Buschsieweke
80cdde4bee
Merge pull request #20345 from maribu/dist/tools/mspdebug
dist/tools/mspdebug: build from source
2024-02-06 15:47:47 +00:00
Marian Buschsieweke
aafc099a1c
dist/tools/mspdebug: build from source
This adds mspdebug as package, similar to EDBG, so that the
programmer/debugger is build from source.

This has the advantage that we can indeed provide patches of our own.
The first patch fixes a bug with the CPU detection of `mspdebug` in
combination with the Olimex MSP430-JTAG-TINY-V2. The second adds the
`--expect-id <CPU_NAME>` argument.

The RIOT integration is updated to directly make use of the
`--expect-id` parameter. No more spending time debugging why firmware
the firmware for the `olimex-msp430-h2618` doesn't run when flashed on
the `olimex-msp430h1611` hardware :D
2024-02-06 15:23:02 +01:00
Frederik Haxel
0d89040ae3 CI: Add native64 to CI
- Test native64 like native in murdock
- Add native64 to "Platform: native" in github labeler
- Add "BUILDTEST_MCU_GROUP == x86_64" to `dist/tools/ci/build_and_test.sh`
2024-02-05 22:02:21 +01:00
MrKevinWeiss
ceec795ae5
compile_and_test_for_board: Add only-if-changed feature
This will use the make test-input-hash-changed feature to save
the test hashes with the results and optionally skip running
the test if nothing has changed.

Murdock already has this feature but it is not easily accessible.

This should prevent unneeded flash cycles as well as speeding up
constant rerunning of tests for boards.
2024-02-01 13:50:00 +01:00
benpicco
4ea27d4c13
Merge pull request #20300 from jparker324/stm32c0_and_nucleo_c031c6
cpu/stm32: add support for STM32C0 and NUCLEO-C031C6
2024-01-31 15:09:25 +00:00
Martine Lenders
34fcffe37b
Merge pull request #20170 from miquel-b/lsm6dsxx
drivers/lsm6dsxx: refactoring Lsm6dsl into common driver Lsm6dsxx
2024-01-30 19:07:04 +00:00
Jason Parker
b5d72d8242 cpu/stm32: add CPU_FAM_STM32C0 support 2024-01-29 14:44:10 -05:00
Benjamin Valentin
61546d55e0 dist/tools/pyterm: accept absolute log dir name 2024-01-29 11:08:54 +01:00
MrKevinWeiss
2f7e1e3b53
docs: exclude lsm6dsxx macros 2024-01-24 13:44:50 +01:00
Miquel-HAW
6fc6132359 dist/tools: exclude_simple added warnings 2024-01-24 09:57:04 +01:00
Benjamin Valentin
d0093cf9cc Revert "riotctrl_ctrl: one more indirection to get native"
This reverts commit 5e0c9b4bff.
2024-01-19 12:59:14 +01:00
Marian Buschsieweke
c823412f31
dist/tools/zsh-completion: fix typo
This fixes a typo in a description.
2024-01-16 08:01:11 +01:00
benpicco
8ba210e6f6
Merge pull request #20250 from maribu/dist/tools/zsh-completion
dist/tools/zsh-completion: add completion for flash
2024-01-15 12:10:29 +00:00
Marian Buschsieweke
8008bb435d
dist/tools/zsh-completion: add completion for flash
Also complete and explain `PROGRAMMER=`, `OPENOCD_DEBUG_ADAPTER=`, and
`OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=` when using zsh.

Co-authored-by: benpicco <benpicco@googlemail.com>
2024-01-14 17:49:33 +01:00
Marian Buschsieweke
4fc7700a0f
tools/openocd-rtt: also open GDB port
When using OpenOCD RTT (real-time transfer) for stdio with
`USEMODULE=stdio_rtt make ...`, it is no longer possible to debug
while being connected to stdio. By also opening gdb at RIOT's default
GDB port, `make debug-client` can be used to connect from GDB to the
OpenOCD instance providing stdio via RTT.
2024-01-13 12:47:37 +01:00
Benjamin Valentin
9d350f08c0 dist/tools/riotboot_gen_hdr/genhdr: add update command
Sometimes we want to roll-back to a previous firmware version.
To do so we need a higher riotbot version numbers still.

Add an update command to the riotboot_gen_hdr tool so that an existing
firmware image can be re-rolled out with a new version number.
2024-01-09 16:15:27 +01:00
Marian Buschsieweke
82b7e10988
dist/tools/zsh-completion: provide completion for zsh
This adds command completion that, when manually installed, provides
RIOT-aware command completion for `make` in zsh. The completion
supports:

- most commonly used `make` goals including a help text
- most commonly used `make` variables (such as `BOARD=`, `LTO=`,
  `BUILD_IN_DOCKER=`, `TOOLCHAIN=`)
    - possible values for these variables, including a list of boards
      detected at runtime to complete `BOARD=`

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
2024-01-08 13:48:17 +01:00
benpicco
5dae1eb0b4
Merge pull request #20130 from maribu/dist/tools/insufficient_memory/update_insufficient_memory_board.sh
dist/tools/insufficient_memory: always update Makefile.ci
2024-01-04 17:38:33 +00:00
benpicco
b47771cd5e
Merge pull request #19996 from benpicco/topogen_enhance
tools/zep_dispatch: enhancements and fixes
2024-01-03 14:15:09 +00:00
Benjamin Valentin
ba8130e69f tools/zep_dispatch: topogen: add help text 2023-12-21 23:17:53 +01:00
Benjamin Valentin
f7e6a4ada2 tools/zep_dispatch: topogen: print list of nodes 2023-12-21 23:17:53 +01:00
Benjamin Valentin
2e19c2d712 tools/zep_dispatch: topogen: place first node at origin 2023-12-21 23:17:53 +01:00
Benjamin Valentin
b85b7937c3 tools/zep_dispatch: topogen: use numeric names 2023-12-21 23:17:53 +01:00
Benjamin Valentin
61992fe1a7 tools/zep_dispatch: add support for PIDFILE 2023-12-21 23:17:53 +01:00
Benjamin Valentin
875bf98280 tools/zep_dispatch: topogen: fix distance calculation 2023-12-21 23:17:53 +01:00
Benjamin Valentin
1c15624384 tools/zep_dispatch: allow list of nodes in topo file 2023-12-21 23:17:53 +01:00
Benjamin Valentin
b4efc378a0 tools/zep_dispatch: topogen: add support for generating grid topology 2023-12-21 23:17:53 +01:00
Oleg Hahm
dd184614d8 pyterm: native: remove superfluous tap argument 2023-12-18 20:00:44 +01:00
Oleg Hahm
075f2ffd6a pyterm: label pyterm arg for native generically 2023-12-18 20:00:44 +01:00
Oleg Hahm
b9c8b659ed tools: pyterm: allow for multiple native tap interfaces 2023-12-18 13:44:20 +01:00
Oleg Hahm
2cfcc93933 tools: pyterm: add native_args and tap interface
Adding arguments for optional arguments to be passed to RIOT native and
for passing the tap interface.
2023-12-18 13:44:20 +01:00
Oleg Hahm
5e0c9b4bff riotctrl_ctrl: one more indirection to get native
Since the native process is a child process of pyterm when called via
make we need to dig deeper for riotctrl. This also means that we require
pyserial to execute it.
2023-12-18 13:44:20 +01:00
Oleg Hahm
a2a1715986 riotctrl_ctrl: fix typo in docs 2023-12-18 13:44:20 +01:00
Oleg Hahm
66343e3bc7 pyterm: add native support
Start RIOT native as a subprocess and communicate to it via a pipe.
2023-12-18 13:44:20 +01:00
Marian Buschsieweke
485a98bd6e
tools/edbg: fix make reset
Likely a change in the command line interface of EDBG broke the
`make reset` integration. This adds the missing flag.

Note: Since the binary is build on demand with our build system, we
      can in fact rely on every using the same version of EDBG. Hence,
      we don't need to be backwards compatible with the flag.
2023-12-14 09:17:19 +01:00
Marian Buschsieweke
922d8c8b9f
dist/tools/insufficient_memory: always update Makefile.ci
Previously the `add_insufficient_memory_board.sh` script would only
add the tested board to `Makefile.ci` when resource requirements grew,
but never remove it when resource requirements got lower.

This updates the script to also remove boards from `Makefile.ci` if
it is no longer needed. It is also rename (`add` --> `update`) to
match the change in behavior.
2023-12-01 16:08:29 +01:00
Mikolai Gütschow
6935ea21e7
sys/hashes: add SHA-512 support 2023-11-29 19:18:51 +01:00
benpicco
c93a5b84a3
Merge pull request #20020 from gompper/periph/freqm
drivers/include/periph: add FREQM peripheral driver
2023-11-27 16:06:52 +00:00
Urs Gompper
bfb3b5fe72 dist/tools/doccheck: add FREQM config to generic_exclude_pattern 2023-11-23 21:00:16 +01:00
MrKevinWeiss
85cebf332d
dist/tools/uf2: Ignore the .json file 2023-11-09 20:22:52 +01:00
bors[bot]
4250c1509e
Merge #20009 #20042
20009: cpu/native: fix bug in periph_timer r=MrKevinWeiss a=maribu

### Contribution description

While debugging https://github.com/RIOT-OS/RIOT/pull/18977#issuecomment-1764258356 it became obvious that the `periph_timer` in `native` is broken and issues early IRQs. This replaces the use of `setitimer` that cannot use a monotonic clock source with `timer_settime()`.

### Testing procedure

I have some non-publishable code that tests if the time an ISR fires in terms of `timer_read()` is no earlier than the time expected. This occasionally triggered with `master`, but I didn't see any of these issues anymore with this PR. I guess I should revive my PR to spice up the periph timer tests and add a polished version of this and let this run for an hour or two.

The tests ins `tests/periph/timer*` should still succeed on `native`. (They do for me in a container running `riot/riotbuild`).

### Issues/PRs references

Found while debugging https://github.com/RIOT-OS/RIOT/pull/18977#issuecomment-1764258356

20042: dist/tools/uf2: add target to also copy families.json file r=MrKevinWeiss a=MichelRottleuthner

### Contribution description

The updated UF2 pkg (#20035) stores the family ID in an external .json file. I overlooked that and flashing fails if this file is not present. This PR fixes it by also copying the json into the tool folder.

### Testing procedure
Check if the `feather-nrf52840-sense` can be flashed when the new UF2 pkg is cloned freshly.


### Issues/PRs references
 Fixes a regression introduced with #20035 


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
2023-11-03 14:52:20 +00:00
Michel Rottleuthner
1e6ac1f093 dist/tools/uf2: add target to also copy families.json file 2023-11-02 11:49:59 +01:00
bors[bot]
32795ca399
Merge #20035
20035: Bump version of UF2 package r=MrKevinWeiss a=MichelRottleuthner

### Contribution description

Bump UF2 package version. The new version, besides many other things, also includes an improvement to search more potential mount paths, which gives better compatibility for different distros.


### Testing procedure

Test if flashing still works for boards that use UF2 (e.g., `feather-nrf52840`, `feather-nrf52840-sense`, `nrf52840-mdk-dongle`):
`BUILD_IN_DOCKER=1 BOARD=feather-nrf52840-sense make -C examples/hello-world all flash term`

With master you should get this error, during flashing: `No drive to deploy.` if you run it on a distro that mounts your device under something like `/run/media/<username>/FTHRSNSBOOT`, or other paths not supported by the old version. To me this happened on Arch.
**Note: you will still get this error if your system doesn't auto mount the device.** But now it will be found when mounted ;)

With this PR try again with the UF2 util:
`rm -rf build/pkg/UF2`
`BUILD_IN_DOCKER=1 BOARD=feather-nrf52840-sense make -C examples/hello-world all flash term`
It should use the new pkg version and flash successfully:
```
...
[INFO] uf2conv.py not found - fetching it from GitHub now
CC= CFLAGS= make -C /home/michel/devel/riot/dist/tools/uf2
[INFO] uf2conv.py successfully fetched!
...
Flashing /run/media/michel/FTHRSNSBOOT (nRF52840-Feather-Sense)
Wrote 63488 bytes to /run/media/michel/FTHRSNSBOOT/NEW.UF2
...
```


### Issues/PRs references

Fixes the mount path problem described in #20027.


Co-authored-by: Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
2023-11-02 07:54:14 +00:00
Michel Rottleuthner
cbea7397de dist/tools/uf2: bump version 2023-11-01 11:07:02 +01:00
Benjamin Valentin
2f2dcb7e34 examples/gnrc_border_router: enable setting ZEP topology 2023-10-20 17:51:05 +02:00
Benjamin Valentin
c9f7090240 tools/zep_dispatch: count rx/tx frames 2023-10-19 15:02:56 +02:00
Benjamin Valentin
eec1d85cf3 tools/zep_dispatch: fix packet transmission to multiple nodes 2023-10-19 15:02:52 +02:00
Benjamin Valentin
f68781deb4 tools/zep_dispatch: topogen: add binary mode 2023-10-19 15:02:48 +02:00
Benjamin Valentin
9e6e6c89f6 tools/zep_dispatch: topogen: fix node naming 2023-10-19 15:02:44 +02:00
Martine Lenders
25917c4b36
backport_pr.py: increase entries per page for branches GET 2023-10-18 14:12:45 +02:00
MrKevinWeiss
3a0ada484b
dist/testbed-support: Add openmote board 2023-10-17 13:28:05 +02:00
Marian Buschsieweke
50490ed71b
dist/tools/lpc2k_pgm: fix typo in GUI / readme 2023-10-16 12:18:23 +02:00
Marian Buschsieweke
50d5c69e3e
dist/tools/codespell: add more false positives 2023-10-16 12:18:08 +02:00
LP-HAW
25013f8ca9 dist/tools/jlink: fix DBG_PID assignment 2023-09-29 13:23:38 +02:00
bors[bot]
e15304788b
Merge #19921
19921: dist/tools/pyterm: set exclusive access on port r=benpicco a=benpicco




Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-09-13 11:22:52 +00:00
Benjamin Valentin
dad593a5f5 dist/tools/pyterm: set exclusive access on port
A common source of error is that a user connects to a serial port that
has already been opened in another terminal.
This may lead to garbled output or no output at all.

To avoid this, claim exclusive access on the serial port so we get a
proper error instead of corrupted output.
2023-09-13 12:04:52 +02:00
bors[bot]
9be022afd8
Merge #18547
18547: sys: PSA Crypto API implementation r=MrKevinWeiss a=Einhornhool

### Contribution description
This adds an implementation of the ARM [PSA Crypto API](https://armmbed.github.io/mbed-crypto/html/index.html) specification to RIOT. 

It is a cryptographic API that supports software and hardware backends as well as the use of multiple secure elements, which can be configured with Kconfig.
It integrates indirect, identifier based key management to support persistent storage of key material in local memory and devices with protected key storage.

A description of the implementation design and an evaluation of the processing time and memory overhead in RIOT has been published here: [Usable Security for an IoT OS: Integrating the Zoo of Embedded Crypto Components Below a Common API](https://arxiv.org/abs/2208.09281)

#### Implementation status
So far this implementation supports the following operations:
- Volatile key storage
- AES in CBC mode
- Hashes (MD5, SHA1, SHA224, SHA256)
- HMAC SHA256
- ECDSA with NIST P192 and P256 curves

The following backends are supported so far:
- RIOT Cipher Module
- RIOT Hash Module
- Micro ECC library package
- Cryptocell 310 hardware accelerator on the Nordic NRF52840dk
- Microchip ATECC608A secure element

Other operations and backends as well as persistent key storage can and will be implemented by me and anyone who wants to contribute in the future.

### Testing procedure
So far there is a show case application in `examples/psa_crypto` to demonstrate the usage and configuration of different backends of the API (refer to the application README for more information). 


Co-authored-by: Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
2023-09-04 08:15:08 +00:00
Lena Boeckmann
a0ccbce5a8 dist/tools/codespell: Add ignored words 2023-09-04 09:58:49 +02:00
Gunar Schorcht
ebe51e7f51 drivers/stmpe811: introduce coordinate conversion
To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates from the touch display by swapping and mirroring. For the sake of simplicity, possible rotations are additionally defined.
2023-09-02 17:01:46 +02:00
Gunar Schorcht
ca6760047c drivers/ft5x06: introduce coordinate conversions
To obtain coordinates from the touch panel that correspond to the display coordinates, it is often necessary to convert the coordinates from the touch display by swapping and mirroring. For the sake of simplicity, possible rotations are additionally defined.
2023-08-26 17:49:29 +02:00
bors[bot]
576731ca97
Merge #19452
19452: dist/tools/esptools: upgrade ESP32x toolchains to GCC version 12.2 r=MrKevinWeiss a=gschorcht

### Contribution description

This PR upgrades ESP32x toolchains to GCC version 12.2 which is a prerequisite for upgrading the ESP-IDF to version 5.1.

This PR depends on PR #19450 

### Testing procedure

`dist/tools/install.sh all` should install all ESP32x toolchains.
`. dist/tools/export.sh all` should make them visible.

### Issues/PRs references

Depends on PR #19450 

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-08-01 12:19:48 +00:00
Gunar Schorcht
3472e27ba0 dist/tools/codespell: ignore NOE and NWE signal names 2023-07-26 09:02:10 +02:00
Gunar Schorcht
a83d5ba9b1 dist/tools/esptool: set --retry for curl in install.sh for stability 2023-07-25 23:42:11 +02:00
Gunar Schorcht
1438d41347 dist/tools/esptools: upgrade to gcc 12.2 2023-07-25 23:42:11 +02:00
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
MrKevinWeiss
d12d5925de
compile_and_test_for_boards: Add no-compile flag
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.
2023-07-18 12:22:36 +02:00
Dylan Laduranty
1007f020ea dist/tools/usb-serial/find-tty.sh: call ttys.py with its path
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-07-13 16:43:57 +02:00
Dylan Laduranty
3b85c56646 dist/tools/usb-serial/list-ttys.sh: call ttys.py with its path
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-07-13 16:36:12 +02:00
bors[bot]
ddf1fe252d
Merge #19733 #19747 #19769 #19782
19733: cpu/msp430: reorganize code r=maribu a=maribu

### Contribution description

RIOT supports two distinct families of the MSP430: The [MSP430 x1xx] MCU family and the [MSP430 F2xx/G2xx] MCU family. For both incompatible MCU families the code was located in the msp430fxyz folder, resulting in case of the UART driver in particularly bizarre code looking roughly like this:

```C
#ifndef UART_USE_USCI
/* implementation of x1xx peripheral ... */
#else
/* implementation of F2xx/G2xx peripheral ... */
#endif
/* zero shared code between both variants */
```

This moves peripheral drivers shared between the two families to msp430_common and splits the SPI and UART driver into two MCU families.

In addition, it cleans up the `msp430_regs.h` by dropping most of it and using the macros and symbols provided by the vendor header files. There is little reason for us to maintain constants when TI is already doing that.

[MSP430 x1xx]: https://www.ti.com/lit/ug/slau049f/slau049f.pdf
[MSP430 F2xx/G2xx]: https://www.ti.com/lit/ug/slau144k/slau144k.pdf


19747: gnrc/ipv6/nib: reset rs_sent counter also for not-6LN interfaces r=maribu a=fabian18



19769: cpu/nrf53: add initial support with nRF5340DK-APP board r=maribu a=dylad

### Contribution description

This PR adds support for nRF5340 MCU and its associated Nordic development board, nRF5340DK.
This MCU provides a dual Cortex-M33, one application core running at up to 128MHz, and one network core running at up to 64MHz.
Peripherals are inherited from others Nordic MCUs families so it shouldn't be hard to add more of them in followup PRs.

For now, only the minimal set of peripherals is supported:
- GPIO / GPIO_IRQ
- UART
- TIMER

### Testing procedure
Build the usual test application for the supported peripherals and flash the board.
nRF5340DK provides two serial ports on its embedded debugger. RIOT's shell should be available on the first one (/dev/ttyACM0)


### Issues/PRs references
#18576
#19267 


19782: cpu/msp430: fix for ti's msp430-gcc-opensource package ld version r=maribu a=hugueslarrive

### Contribution description
My msp430 toolchain (https://www.ti.com/tool/MSP430-GCC-OPENSOURCE) was broken by #19484:
```
hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world
make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
Building application "hello-world" for "msb-430" with MCU "msp430fxyz".

"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph
/opt/ti/msp430-gcc/bin/../lib/gcc/msp430-elf/9.3.1/../../../../msp430-elf/bin/ld: .rodata not found for insert
collect2: error: ld returned 1 exit status
make: *** [/home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/../../Makefile.include:761 : /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf] Erreur 1
make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version
GNU ld (Mitto Systems Limited - msp430-gcc 9.3.1.11) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+'
9.3
1.11
2.34
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+$'
2.34
```


### Testing procedure
```
hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world
make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
Building application "hello-world" for "msb-430" with MCU "msp430fxyz".

"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph
   text	   data	    bss	    dec	    hex	filename
   8612	    722	    866	  10200	   27d8	/home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf
make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
```


### Issues/PRs references
Introduced by #19484, highlighted in #16727.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Hugues Larrive <hlarrive@pm.me>
2023-07-04 18:43:26 +00:00
Marian Buschsieweke
45b353c6ef
cpu/msp430: make use of vendor header files
The MSP430 vendor files already provide macros containing register
constants and symbols (provided via linker scripts) containing addresses
of peripheral registers. So lets make use of that rather than
maintaining a long list of constants.
2023-07-04 20:21:05 +02:00
Marian Buschsieweke
efb3a32a8d
dist/tools/doccheck: update exclude patterns 2023-06-26 17:24:07 +02:00
bors[bot]
970734efd8
Merge #19750
19750: dist/tools/usb-serial: Fix handling of None while quoting r=aabadie a=maribu

### Contribution description

This fixes:

    Traceback (most recent call last):
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 259, in <module>
        print_ttys(sys.argv)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 255, in print_ttys
        print_results(args, ttys)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 189, in print_results
        if item.rfind(args.format_sep) >= 0:
           ^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'rfind'

Which occurs while testing whether a string requires special quoting if an attribute is None.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-06-22 05:40:27 +00:00
Marian Buschsieweke
6192c620c8
dist/tools/usb-serial: Fix handling of None while quoting
This fixes:

    Traceback (most recent call last):
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 259, in <module>
        print_ttys(sys.argv)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 255, in print_ttys
        print_results(args, ttys)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 189, in print_results
        if item.rfind(args.format_sep) >= 0:
           ^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'rfind'

Which occurs while testing whether a string requires special quoting
if an attribute is None.
2023-06-21 22:13:21 +02:00
Fabian Hüßler
1b93025ab1 dist/tools/openocd: start debug-server in background and wait 2023-06-15 19:27:15 +02:00
bors[bot]
829af7c105
Merge #19703 #19724 #19735
19703: cpu/sam0_eth: interrupt based link detection/auto-negotiation r=benpicco a=benpicco



19724: dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable r=benpicco a=fabian18



19735: nrf5x_common: Clear I2C periph shorts r=benpicco a=bergzand

### Contribution description

The I2C peripheral's shortcuts are used with the read and write register to automatically stop the I2C transaction or to continue with the next stage.

With simple I2C read and write bytes these shorts are not used, but are also not cleared by the function in all cases, causing it to use the shortcut configuration set by a previous function call. This patch ensures that the shorts are always set by the read and write functions

### Testing procedure

Should be possible to spot with a logic analyzer and the I2C periph test. Maybe the HIL test can also detect it :)

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-06-14 12:34:33 +00:00
bors[bot]
5e7c6c2ff7
Merge #19697 #19725
19697: drivers/sx127x: reduce use of floats r=benpicco a=maribu

### Contribution description

Convert the floating point arithmetic to integer arithmetic.


19725: buildsystem: add target debug-client r=benpicco a=fabian18



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
2023-06-13 19:08:40 +00:00
Fabian Hüßler
17d0e586c5 dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable 2023-06-13 21:04:27 +02:00
bors[bot]
0fdea67238
Merge #19723
19723: dist/tools/openocd: add RTT port variable r=maribu a=fabian18



Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
2023-06-12 10:23:49 +00:00
Fabian Hüßler
c76a192eb8 openocd: support target debug-client 2023-06-10 01:03:30 +02:00
Fabian Hüßler
4e1ac37400 buildsystem: add target debug-client 2023-06-10 00:04:56 +02:00
Fabian Hüßler
dbfb0ea76a dist/tools/openocd: add RTT port variable 2023-06-09 23:49:35 +02:00
Oleg Hahm
30e1d3ef8a tools/jlink.sh: start gdb server with setsid
Adopted from openocd script in order to prevent killing the gdb server
upon SIGINT.
2023-06-09 15:33:14 +02:00
MrKevinWeiss
bfd9153391
tools/kconfiglib: Update to RIOT-OS package 2023-05-31 12:55:47 +02:00
7bac10f13d
dist/tools/buildsystem_sanity_check: add check for tests subdirs 2023-05-28 09:42:40 +02:00
bors[bot]
993c10a2a2
Merge #19556 #19662
19556: tools/mspdebug: fix `make debug` and `make debugserver` r=aabadie a=maribu

### Contribution description

The semantics of `make debug` and `make debugserver` have changed in the years since the MSP430 integration. This brings the implementation back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added


19662: driver/lc709203f: remove unnecessary use of float r=aabadie a=kfessel

### Contribution description

removes a unnecessary use of float

### Testing procedure

read and test if you got that hardware (I don't)

### Issues/PRs references

#19614 

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-05-24 15:54:23 +00:00
Marian Buschsieweke
ca15b1e1f8
tools/mspdebug: fix make debug and make debugserver
The semantics of `make debug` and `make debugserver` have changed in
the years since the MSP430 integration. This brings the implementation
back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to
  run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase
  cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added
2023-05-24 17:00:38 +02:00
bors[bot]
7e75fdf2c5
Merge #19620
19620: dist/tools/openocd: fix parsing of flash bank base r=aabadie a=maribu

### Contribution description

Since [80fc9fabc66a0bc767467fa14c703e5a9f340cd3] the format of the `flash list` command changed to a more human readable multi-line variant. Technically, the change is white-space only. Still, the current approach of parsing them with awk, sed and cut doesn't like the new multi-line format. The parsing is now delegated into a python script that is compatible across OpenOCD versions.

[80fc9fabc66a0bc767467fa14c703e5a9f340cd3]: 80fc9fabc6


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-23 23:08:27 +00:00
bors[bot]
8408d69ea8
Merge #19602
19602: dist/tools/compile_commands: add another workaround r=chrysn a=maribu

### Contribution description

Filter out GCC only `--param=min-pagesize=0` in `clangd` mode. This fixes compilation of rust applications, that now fails with:

    thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("error: argument unused during compilation: '--param=min-pagesize=0' [-Wunused-command-line-argument]\n")', /home/maribu/.cargo/git/checkouts/rust-riot-sys-d12733b89271907c/b4bd4bd/build.rs:224:10


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-23 10:44:46 +00:00
bors[bot]
f3150120f7
Merge #17425
17425: cpu/rpx0xx: initial PIO support r=maribu a=fabian18



Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
2023-05-23 07:02:45 +00:00
Fabian Hüßler
13522d4ee5 dist/tools: fix compilation of elf2uf2 2023-05-23 08:49:37 +02:00
Marian Buschsieweke
dd19110e8a
dist/tools/compile_commands: add another workaround
Filter out GCC only `--param=min-pagesize=0` in `clangd` mode. This
fixes compilation of rust applications, that now fails with:

    thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("error: argument unused during compilation: '--param=min-pagesize=0' [-Wunused-command-line-argument]\n")', /home/maribu/.cargo/git/checkouts/rust-riot-sys-d12733b89271907c/b4bd4bd/build.rs:224:10
2023-05-22 13:26:03 +02:00
Marian Buschsieweke
47ec58dc9b
dist/tools/openocd: fix parsing of flash bank base
Since 80fc9fabc66a0bc767467fa14c703e5a9f340cd3 the format of the
`flash list` command changed to a more human readable multi-line
variant. Technically, the change is white-space only. Still, the
current approach of parsing them with awk, sed and cut doesn't like
the new multi-line format. The parsing is now delegated into a
python script that is compatible across OpenOCD versions.
2023-05-19 13:12:12 +02:00
Marian Buschsieweke
5457014c4a
build-system: Allow out of tree BUILD_DIR
- Replace all users of `$(RIOTBASE)/build` with the already present
  `$(BUILD_DIR)` variable
- Replace all users of `$(BUILD_DIR)/pkg` with the already present
  `$(PKGDIRBASE)` variable
- Create a `CACHEDIR.TAG` file in the `$(BUILD_DIR)`
2023-05-16 22:23:03 +02:00
bors[bot]
070025f119
Merge #19558 #19598
19558: boards: support for Olimex MSP430-H1611 board r=maribu a=maribu

### Contribution description

- implement a clock driver so that boards declare their clock configuration, rather than initializing the CPU clock in `board_init()` by hand
    - Note: A board can still overwrite the weak symbol `clock_init()` in case some really crazy things should happen
- add support for the Olimex-H1611 board


19598: dist/tools/insufficient_memory: fix collection of app folders r=maribu a=maribu

### Contribution description

There is actually a make target to list the applications in the repo. Let's just use that.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-16 13:20:47 +00:00
Marian Buschsieweke
4f4616bb35
dist/tools/insufficient_memory: fix collection of app folders
There is actually a make target to list the applications in the repo.
Let's just use that.
2023-05-16 14:59:53 +02:00
Marian Buschsieweke
df5c319978
cpu/msp430fxyz: clean up clock initialization
Provide a common clock initialization driver rather than leaving
clock initialization to the boards code. A declarative description of
the board's clock configuration using a struct does still allow to
fine-tune settings. In addition, a board is still allowed to just
provide a custom `void clock_init(void)` if there really is the need
to do crazy things.
2023-05-16 10:05:09 +02:00
Marian Buschsieweke
022dde89b7
dist/tools/insufficient_memory: handle address space wraps
When a region wraps around the address space, the application typically
is way too large to fit into the 16 bit address space of 16 bit or
8 bit platforms. Hence, classify this as "too big" in the tools.
2023-05-15 21:56:46 +02:00
023e676a1a
compile_like_murdock.py: fix path to test applications 2023-05-13 19:08:37 +02:00
3989cd79ff
treewide: fix path to shell related tests in doc 2023-05-13 18:27:58 +02:00