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

pkg/lwip: add support for slipdev #20022

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Conversation

benpicco
Copy link
Contributor

Contribution description

This hooks up support for slipdev in LWIP.

Testing procedure

I tested with examples/gcoap with LWIP_IPV6=1 and USEMODULE += slipdev_l2addr on one side and tests/net/nanocoap_cli on the other side with two saml21-xpro boards where the pins of UART1 are connected.

Issuing a CoAP request via the SLIP interface returns the expected respnose:

2023-10-26 15:54:43,302 - INFO # > ncget coap://[fe80::e858:4ed2:564e:215a]/.well-known/core -
2023-10-26 15:54:43,302 - INFO # 
2023-10-26 15:54:43,327 - INFO # </cli/stats>;ct=0;rt="count";obs,</riot/board>

Issues/PRs references

@benpicco benpicco requested a review from miri64 as a code owner October 26, 2023 13:58
@benpicco benpicco requested review from maribu and removed request for miri64 October 26, 2023 13:58
@github-actions github-actions bot added Area: network Area: Networking Area: pkg Area: External package ports Area: drivers Area: Device drivers labels Oct 26, 2023
@benpicco benpicco requested a review from miri64 October 26, 2023 13:59
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Oct 26, 2023
@riot-ci
Copy link

riot-ci commented Oct 26, 2023

Murdock results

✔️ PASSED

32d17f5 pkg/lwip: add support for slipdev

Success Failures Total Runtime
7953 0 7953 17m:51s

Artifacts

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

lgtm, one comment inline

Comment on lines +37 to +41
# ifdef MODULE_USBUS_CDC_ACM
# define SLIPDEV_PARAM_UART UART_DEV(0)
# else
# define SLIPDEV_PARAM_UART UART_DEV(1)
# endif
Copy link
Member

Choose a reason for hiding this comment

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

The reasoning here is non-obvious to me here. If there is a reason this is a sane default, please add a comment.

Is it about avoiding STDIO_UART_DEV for when MODULE_SLIPDEV_STDIO is not in use? Some boards do use UART_DEV(1) for stdio, others use UART_DEV(0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it about avoiding STDIO_UART_DEV for when MODULE_SLIPDEV_STDIO is not in use?

Yes, I copied that logic from ethos

Some boards do use UART_DEV(1) for stdio, others use UART_DEV(0)

True, but 99% use UART_DEV(0), so the current default is broken in 99% of all cases whereas the new default might only be broken in 1% of all cases 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's controversial I'm fine with dropping it from the PR, just thought it would be a nice convenience improvement.

Copy link
Member

Choose a reason for hiding this comment

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

No, let's have it consistent with ethos. I think I have an idea to also be a good default for the 1% of the cases, but that should be done for both as follow up.

@benpicco
Copy link
Contributor Author

bors merge

bors bot added a commit that referenced this pull request Oct 27, 2023
19932: tests/periph: Add test using the Peripheral Selftest Shield r=benpicco a=maribu

### Contribution description

This adds a test that makes use of the peripheral selftesting shield.

#### ToDo

- [x] Add doc

### Testing procedure

- grab an Arduino UNO compatible board that has the Arduino pin map feature
- connect it to the testing shield
- configure the testing shield
    - make sure the VCC selector matches the logic level of the board (3.3V and 5V are the only options)
    - enabled all the "loops" needed for testing on SW1
    - it could be that the UART on D0, D1 is used for stdio. In that case, do *NOT* close the loop
- flash and run the test application

### Issues/PRs references

none

20018: tests/pkg/minmea: fixing RMC timestamp r=benpicco a=jan-mo

The RMC timestamp calculation was creating issues. The timestamp will be related to the EPOCH and time zone. Test on native will fail if the time zone is not set correctly. (see #20005)

# how to test

```
TZ=GMT-1 make test
```
 and 
```
TZ=GMT make test
```
and 
```
TZ=<any> make test
```

`timedatectl  list-timezones` provides you with a List of timzones 

do not fail 

20022: pkg/lwip: add support for slipdev r=benpicco a=benpicco



20025: tests/drivers/at: fix device table overflow r=benpicco a=krzysztof-cabaj

### Contribution description

This PR fix device table overflow in `tests/driver/at`, which could lead to device crash.

### Testing procedure

PR was tested on two nucleo boards with 2 and 3 UARTs (nucleo-l476rg and nucleo-l496zg).
Flash `tests/driver/at` with and without this PR.

Output with this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8-tests-drivers-at)
AT command test app
> init 5 9600

Wrong UART device number - should by in range 0-2.
>
```

Output without this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8)
AT command test app
> init 5 9600

8001afd
*** RIOT kernel panic:
FAILED ASSERTION.

*** halted.


Context before hardfault:
   r0: 0x0000000a
   r1: 0x00000000
   . . . 
```

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <[email protected]>
Co-authored-by: Jan Mohr <[email protected]>
Co-authored-by: Benjamin Valentin <[email protected]>
Co-authored-by: krzysztof-cabaj <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Oct 27, 2023
20022: pkg/lwip: add support for slipdev r=benpicco a=benpicco



20025: tests/drivers/at: fix device table overflow r=benpicco a=krzysztof-cabaj

### Contribution description

This PR fix device table overflow in `tests/driver/at`, which could lead to device crash.

### Testing procedure

PR was tested on two nucleo boards with 2 and 3 UARTs (nucleo-l476rg and nucleo-l496zg).
Flash `tests/driver/at` with and without this PR.

Output with this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8-tests-drivers-at)
AT command test app
> init 5 9600

Wrong UART device number - should by in range 0-2.
>
```

Output without this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8)
AT command test app
> init 5 9600

8001afd
*** RIOT kernel panic:
FAILED ASSERTION.

*** halted.


Context before hardfault:
   r0: 0x0000000a
   r1: 0x00000000
   . . . 
```

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <[email protected]>
Co-authored-by: krzysztof-cabaj <[email protected]>
@benpicco
Copy link
Contributor Author

bors cancel
bors merge

@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

This PR was included in a batch that was canceled, it will be automatically retried

@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

Canceled.

@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

Already running a review

bors bot added a commit that referenced this pull request Oct 27, 2023
19546: Enable compile_and_test_for_board to skip if nothing changed r=benpicco a=MrKevinWeiss

### Contribution description

The overall goal of this PR is to be able to keep running the `compile_and_test_for_board.py` script without destroying ones boards.  Useful if you are a board owner that wants to keep testing on master (say with nightlies, say in a CI).

For example, I could now just run and rerun the following:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . <MY_BOARD> -c
```
and monitor the results, even after updating a branch.

This is because the hashes now get stored with the results (thanks to the `RIOT_TEST_HASH_DIR` var) which means cleaning will not wipe them out.  Specifically in (`<results_base>/<board>/hashes/<app_dir>/test-input-hash.sha1`)

I tried to do as much as I could with make and only alter the python script when needed.

### Testing procedure

Clear results folder and run:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/shell -c
```
<details>

```
INFO:native:Saving toolchain
INFO:native.tests/shell:Board supported: True
INFO:native.tests/shell:Board has enough memory: True
INFO:native.tests/shell:Application has test: True
INFO:native.tests/shell:Run compilation
**INFO:native.tests/shell:Hashes match: False**
INFO:native.tests/shell:Run test
INFO:native.tests/shell:Run test.flash
INFO:native.tests/shell:Success
INFO:native:Tests successful
```
</details>

it should execute the test...

Then the same command again should skip it.
<details>

```
INFO:native:Saving toolchain
INFO:native.tests/shell:Board supported: True
INFO:native.tests/shell:Board has enough memory: True
INFO:native.tests/shell:Application has test: True
INFO:native.tests/shell:Run compilation
**INFO:native.tests/shell:Hashes match: True**
INFO:native.tests/shell:Success
INFO:native:Tests successful
```
</details>

Try changing something (say the `tests/shell/01-run.py`) and rerun, it should trigger the test again.
<details>

```
INFO:native:Saving toolchain
INFO:native.tests/shell:Board supported: True
INFO:native.tests/shell:Board has enough memory: True
INFO:native.tests/shell:Application has test: True
INFO:native.tests/shell:Run compilation
**INFO:native.tests/shell:Hashes match: False**
INFO:native.tests/shell:Run test
INFO:native.tests/shell:Run test.flash
INFO:native.tests/shell:Success
INFO:native:Tests successful
```
</details>

...finally, running without the changes check should run the test as usual, even if nothing changes:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/shell
```
<details>

```
INFO:native:Saving toolchain
INFO:native.tests/shell:Board supported: True
INFO:native.tests/shell:Board has enough memory: True
INFO:native.tests/shell:Application has test: True
INFO:native.tests/shell:Run compilation
INFO:native.tests/shell:Run test
INFO:native.tests/shell:Run test.flash
INFO:native.tests/shell:Success
INFO:native:Tests successful
```
</details>

### Issues/PRs references

Might help the surprises we got with #19469


20022: pkg/lwip: add support for slipdev r=benpicco a=benpicco



20025: tests/drivers/at: fix device table overflow r=benpicco a=krzysztof-cabaj

### Contribution description

This PR fix device table overflow in `tests/driver/at`, which could lead to device crash.

### Testing procedure

PR was tested on two nucleo boards with 2 and 3 UARTs (nucleo-l476rg and nucleo-l496zg).
Flash `tests/driver/at` with and without this PR.

Output with this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8-tests-drivers-at)
AT command test app
> init 5 9600

Wrong UART device number - should by in range 0-2.
>
```

Output without this PR:

```
> main(): This is RIOT! (Version: 2022.07-devel-5083-g2b9e8)
AT command test app
> init 5 9600

8001afd
*** RIOT kernel panic:
FAILED ASSERTION.

*** halted.


Context before hardfault:
   r0: 0x0000000a
   r1: 0x00000000
   . . . 
```

### Issues/PRs references

None

Co-authored-by: MrKevinWeiss <[email protected]>
Co-authored-by: Benjamin Valentin <[email protected]>
Co-authored-by: krzysztof-cabaj <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented Oct 27, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 60d6dec into RIOT-OS:master Oct 27, 2023
30 checks passed
@benpicco benpicco deleted the pkg/lwip-slipdev branch October 27, 2023 20:06
@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: drivers Area: Device drivers Area: network Area: Networking Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

4 participants