-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
19618: cpu/stm32: fix riotboot settings for L4 and WB r=benpicco a=gschorcht ### Contribution description This PR fixes the `riotboot` configuration for L4 and WB. The family is not called `stm32l4` or `stm32wb` but `l4` and `wb`. That is, the `riotboot` configuration didn't work at all. Furthermore, a minimum `RIOTBOOT_LEN` of `0x2000` is required for L4. Found when investigating the compilation errors for `bootloaders/riotboot_serial` in PR #19576. ### Testing procedure 1. Green CI. 2. Use the following commands: ``` BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN ``` In master these commands give ``` 0x400 ``` With this PR these commands give ``` 0x200 ``` as expected. 3. Use the following commands: ``` BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN ``` In master these commands give ``` 0x1000 ``` With this PR these commands give ``` 0x2000 ``` as expected. ### Issues/PRs references 19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie 19644: gnrc_ipv6_nib: include RIO with all subnets in downstream RA r=benpicco a=benpicco 19649: gnrc_sixlowpan_iphc: prefix bits outside context must be zero r=benpicco a=benpicco 19656: gnrc/ipv6_auto_subnets: allow to configure minimal prefix length r=benpicco a=benpicco Co-authored-by: Gunar Schorcht <[email protected]> Co-authored-by: Alexandre Abadie <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
- Loading branch information
Showing
7 changed files
with
206 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* | ||
* Copyright (C) 2021 ML!PA Consulting GmbH | ||
* | ||
|
@@ -90,6 +89,7 @@ | |
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
|
||
#include "compiler_hints.h" | ||
#include "net/gnrc/ipv6.h" | ||
#include "net/gnrc/netif.h" | ||
#include "net/gnrc/netif/hdr.h" | ||
|
@@ -142,6 +142,14 @@ | |
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN (0) | ||
#endif | ||
|
||
/** | ||
* @brief Minimal length of a new prefix. | ||
* e.g. Linux will only accept /64 prefixes for SLAAC | ||
*/ | ||
#ifndef CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN | ||
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN (0) | ||
#endif | ||
|
||
/** | ||
* @brief Number of subnets that can be configured. | ||
* | ||
|
@@ -370,6 +378,10 @@ static void _configure_subnets(uint8_t subnets, uint8_t start_idx, gnrc_netif_t | |
return; | ||
} | ||
|
||
if (new_prefix_len < may_be_zero(CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN)) { | ||
new_prefix_len = CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN; | ||
} | ||
|
||
while ((downstream = gnrc_netif_iter(downstream))) { | ||
gnrc_pktsnip_t *tmp; | ||
ipv6_addr_t new_prefix; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2023 Inria | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
import sys | ||
from testrunner import run | ||
|
||
|
||
ERROR_MS = 50 # This is large enough to pass the test on IoT-LAB nrf52dk | ||
|
||
|
||
def testfunc(child): | ||
child.expect(r"Testing gnrc_mac timeout module \(start time = (\d+) ms\)") | ||
start = int(child.match.group(1)) | ||
child.expect(r"Set timeout_1, should be expired at (\d+) ms\)") | ||
timeout_1 = int(child.match.group(1)) | ||
child.expect(r"Set timeout_2, should be expired at (\d+) ms\)") | ||
timeout_2 = int(child.match.group(1)) | ||
child.expect(r"Set timeout_3, should be expired at (\d+) ms\)") | ||
timeout_3 = int(child.match.group(1)) | ||
child.expect_exact("Are the reception times of all 3 msgs close to the supposed values?") | ||
|
||
child.expect_exact("If yes, the tests were successful") | ||
child.expect( | ||
r"At (\d+) ms received msg 1: " | ||
r"timeout_1 \(set at {start} ms\) expired, supposed to be {timeout_1} ms\!" | ||
.format(start=start, timeout_1=timeout_1) | ||
) | ||
timeout_1_measured = int(child.match.group(1)) | ||
assert timeout_1_measured - timeout_1 < ERROR_MS | ||
child.expect_exact(f"At {timeout_1_measured} ms: timeout_1 is not running.") | ||
child.expect_exact(f"At {timeout_1_measured} ms: timeout_2 is running.") | ||
child.expect_exact(f"At {timeout_1_measured} ms: timeout_3 is running.") | ||
child.expect( | ||
r"At (\d+) ms received msg 2: " | ||
r"timeout_2 \(set at {start} ms\) expired, supposed to be {timeout_2} ms\!" | ||
.format(start=start, timeout_2=timeout_2) | ||
) | ||
timeout_2_measured = int(child.match.group(1)) | ||
assert timeout_2_measured - timeout_2 < ERROR_MS | ||
child.expect_exact(f"At {timeout_2_measured} ms: timeout_1 is not running.") | ||
child.expect_exact(f"At {timeout_2_measured} ms: timeout_2 is not running.") | ||
child.expect_exact(f"At {timeout_2_measured} ms: timeout_3 is running.") | ||
child.expect( | ||
r"At (\d+) ms received msg 3: " | ||
r"timeout_3 \(set at {start} ms\) expired, supposed to be {timeout_3} ms\!" | ||
.format(start=start, timeout_3=timeout_3) | ||
) | ||
timeout_3_measured = int(child.match.group(1)) | ||
assert timeout_3_measured - timeout_3 < ERROR_MS | ||
child.expect_exact(f"At {timeout_3_measured} ms: timeout_1 is not running.") | ||
child.expect_exact(f"At {timeout_3_measured} ms: timeout_2 is not running.") | ||
child.expect_exact(f"At {timeout_3_measured} ms: timeout_3 is not running.") | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(run(testfunc)) |