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

28126 Commits

Author SHA1 Message Date
Vinicius G. Guimaraes
f8776a989f boards/blxxxpill: add support for stm32duino bootloader and for generic St-Link V2. 2020-05-04 19:36:15 -07:00
benpicco
b87be4bd6e
Merge pull request #13786 from benpicco/cpu/saml21/buck_converter
cpu/saml21: enable buck voltage regulator when possible
2020-04-03 18:12:05 +02:00
benpicco
c3f05e4fc1
Merge pull request #13799 from koos96/fatfs-get_fattime
pkg/fatfs: fix day_of_month value of get_fattime()
2020-04-03 17:51:03 +02:00
benpicco
750db2a910
Merge pull request #13788 from benpicco/drivers/at86rf215_shutdown_fix
drivers/at86rf215: return error when switching state while busy
2020-04-03 17:50:48 +02:00
Pekka Nikander
4534e9b773
cpu/cortexm_common: add irq sub-priorities
This commit enables Cortex-M CPU interrupt sub-priorities
and allows the PendSV interrupt to have a priority different
from the default one.  Together these two preprocessor
defines can be used to have PendSV always run as the last interrupt
before returning from the interrupt stack back to the user space.

Running PendSV as the last interrupt before returning to the
user space is recommended by ARM, as it increases efficiency.
Furthermore, that change enhances stability a lot with the
new nRF52 SoftDevice support, currently being worked in
PR #9473.

This commit merely enables sub-priorities and a separate
PendSV priority to be used without changing the default
RIOT behaviour.
2020-04-03 17:49:31 +02:00
Dylan Laduranty
3b34768eaf
Merge pull request #13796 from benpicco/cpu/samd5x/dfll_no_ondemand
cpu/samd5x: don't run DFLL on-demand
2020-04-03 17:18:47 +02:00
Martine Lenders
942c63eb39
Merge pull request #13665 from leandrolanzieri/pr/dist/testrunner_check_unittests_fix_regex
dist/testrunner: Capture number of unittests that passed
2020-04-03 16:53:55 +02:00
Cenk Gündoğan
f1bf9693a6
Merge pull request #13803 from chrysn-pull-requests/uri-terminology-strictness
uri_parser: terminology strictness
2020-04-03 15:21:42 +02:00
Cenk Gündoğan
fca7548762
Merge pull request #13374 from leandrolanzieri/pr/kconfig_migrate/sys/usbus
sys/usbus: Expose configurations to Kconfig
2020-04-03 15:19:22 +02:00
Leandro Lanzieri
8ce1bcd4d0
tests: Use returned value of 'check_unittests' 2020-04-03 14:52:48 +02:00
Leandro Lanzieri
98fd746656
dist/testrunner: Capture number of unittests that passed 2020-04-03 14:52:48 +02:00
Leandro Lanzieri
06920a1f7a
sys/usbus: Expose configurations to Kconfig 2020-04-03 14:45:27 +02:00
Leandro Lanzieri
4d47921947
sys/usbus: Move USBUS_EP0_SIZE to 'CONFIG_' namespace 2020-04-03 14:45:26 +02:00
Leandro Lanzieri
7bd5f86bdd
sys/usbus: Move USBUS_AUTO_ATTACH to 'CONFIG_' namespace
In code now 'IS_ACTIVE' is used to check for this configuration.
2020-04-03 14:45:25 +02:00
chrysn
7f67077338 uri_parser: Document that fragment identifiers are not handled 2020-04-03 14:32:55 +02:00
chrysn
6991f62338 uri_parser: Differentiate between URI and URI reference in documentation 2020-04-03 14:30:38 +02:00
Martine Lenders
d00bde7750
Merge pull request #13789 from cgundogan/pr/uri_parser/remove_check_for_zero
sys/uri_parser: check for uri_end instead of 0
2020-04-03 13:13:18 +02:00
Benjamin Valentin
46544c5d7a drivers/at86rf215: add comment to _tx_ongoing() 2020-04-03 12:48:52 +02:00
Koos
b34b11a0c6 pkg/fatfs: fix day_of_month value of get_fattime() 2020-04-03 11:27:10 +02:00
5e0d5d3302
Merge pull request #13774 from fjmolinas/pr_dependencie_debug_cpu_arch
makefiles/dependencies_debug.inc.mk: add CPU_ARCH
2020-04-03 09:40:59 +02:00
benpicco
0c7612673b
Merge pull request #13793 from ML-PA-Consulting-GmbH/make_riotboot_external_boards
riotboot: forward BOARDSDIR
2020-04-03 09:35:50 +02:00
Francisco Molina
abff884165
makefiles/info-global.inc.mk: undefine CPU_ARCH and CPU_FAM
Undefine variables that shouldnt be set at the start of resolution
and that might be used in dependency resolution.
2020-04-03 09:17:23 +02:00
Francisco Molina
b290b0d0c5
makefiles/dependencies_debug.inc.mk: add CPU_ARCH 2020-04-03 09:17:23 +02:00
Francisco
d4580b4c36
Merge pull request #13750 from benpicco/drivers/at86rf215_fix_wakeup
drivers/at86rf215: fix reset after deep sleep
2020-04-03 09:04:51 +02:00
benpicco
fdaf1ac6fe
Merge pull request #13795 from francois-berder/pic32-saul
boards: pic32*: Add GPIO SAUL configuration
2020-04-02 21:28:38 +02:00
Benjamin Valentin
49fda3e900 cpu/samd5x: don't run DFLL on-demand
The DFLL on samd5x has a hardware bug that requires a special
re-enabling sequence when it is disabled and then re-enabled again.

When running the clock on-demand, the hardware handles the disabling
and re-enabling so that sequence does not get executed.

To reproduce, run `tests/periph_uart` on `same54-xpro`.

Without this patch the test will get seemingly stuck on `sleep_test()`.
(In fact it keeps running, but the DFLL has the wrong frequency so the
UART baudrate is wrong).

In this test, on `same54-xpro` only UART0 is sourced from DFLL.
So if the UART is disabled the DFLL will be turned off as well.
2020-04-02 20:11:41 +02:00
Benjamin Valentin
09ef2f6908 boards/samr34-xpro: enable buck converter 2020-04-02 17:25:16 +02:00
Benjamin Valentin
a102ad3d3d boards/saml21-xpro: enable buck converter 2020-04-02 17:25:16 +02:00
Benjamin Valentin
f037e06b13 cpu/saml21: enable buck voltage regulator when possible
Switch from the on-chip LDO to the on-chip buck voltage regulator
when not fast internal oscillators are used.

On `saml21-xpro` with `examples/default` this gives

**before:** 750 µA
** after:** 385 µA
2020-04-02 17:25:16 +02:00
Benjamin Valentin
3f95d3d2e3 cpu/saml21: pm: set deep flag
Set the deep flag for consistency with other family members.
2020-04-02 17:25:13 +02:00
Dylan Laduranty
4eb9b9b9df
Merge pull request #13751 from benpicco/sam0-pm
cpu/sam0_common: fix handling of PM_NUM_MODES
2020-04-02 17:14:39 +02:00
192c8515b1
Merge pull request #13791 from fjmolinas/pr_remove_stdio_default_module
*/Makefile.dep: remove usage of DEFAULT_MODULE += stdio%
2020-04-02 16:23:15 +02:00
Sven Herrmann
9a58aaa354 riotboot: forward BOARDSDIR 2020-04-02 14:21:42 +00:00
Cenk Gündoğan
1bfc1fbcb3 uri_parser: unittests: add validity check for unterminated string 2020-04-02 15:11:34 +02:00
Francisco Molina
72a2220d21
boards/common/nrf52: include Makefile.board.dep in hack
nrf52 includes include $(RIOTBOARD)/$(BOARD)/Makefile.dep to know
if `nordic_softdevice_ble` is used, this changes dependency
resolution sinnce -include $(APPDIR)/Makefile.board.dep should
be resolved before.

This can be removed once #9913 is if `nordic_softdevice` is
deprecated.
2020-04-02 14:51:22 +02:00
Francisco Molina
0e5205c4a5
*/Makefile.dep: remove usage of DEFAULT_MODULE += stdio% 2020-04-02 14:50:18 +02:00
Francois Berder
0454253519 boards: pic32-clicker: Add GPIO SAUL configuration
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2020-04-02 10:07:56 +01:00
Francois Berder
e52441cf35 boards: pic32-wifire: Add GPIO SAUL configuration
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2020-04-02 10:07:56 +01:00
Leandro Lanzieri
c74544c9ec
Merge pull request #13349 from maribu/dependency-or
build system: Restructure dependency resolution
2020-04-02 10:40:44 +02:00
Cenk Gündoğan
e3d9097974 sys/uri_parser: check for uri_end instead of 0 2020-04-02 10:04:12 +02:00
Marian Buschsieweke
af21f15b02
makefiles: Minor clean ups
- Add FEATURES_REQUIRED_ANY to dependency-debug:
  Now `make dependency-debug` by default also stores the contents of
  `FEATURES_REQUIRED_ANY`.
- makefiles/features_check.inc.mk: Break long lines
- {tests/minimal,tests/unittests,bootloaders/riotboot}:
  Disable auto_init_% in addition to auto_init.

This works around weird behavior due to the USEMODULE being recursively expended
in the first iteration of dependency resolution: Modules added to DEFAULT_MODULE
get automatically added to USEMODULE during the first run, but not for
subsequent. This should be iron out later on.
2020-04-02 09:56:39 +02:00
Marian Buschsieweke
7bc15acee2
build system: Restructure dependency resolution
Goals:
- Untangle dependency resolution and feature checking for better maintainability
- Improve performance of "make info-boards-supported"

Changes:
- Makefile.dep
    - Dropped handling of default modules and recursion
    - Now only dependencies of the current set of used modules and pkgs are
      added
  ==> External recursion is needed to catch transient dependencies
- Changed Makefile.features:
    - Dropped checking of provided features
    - Dropped populating FEATURES_USED with provided features that are required
      or optional
    - Dropped populating FEATURES_MISSING with required but not provided
      features
    - Dropped adding modules implementing used features to USE_MODULE
  ==> This now only populates FEATURES_PROVIDED, nothing more
- Added makefiles/features_check.inc.mk:
    - This performs the population of FEATURES_USED and FEATURES_MISSING now
- Added makefiles/features_modules.inc.mk:
    - This performs now the addition of modules implementing used features
- Added makefiles/dependency_resolution.inc.mk:
    - This now performs the recursion required to catch transient dependencies
    - Also the feature check is performed recursively to handle also required
      and optional features of the transient dependencies
    - DEFAULT_MODULES are added repeatedly to allow it to be extended based on
      used features and modules
      ==> This allows modules to have optional dependencies, as these
          dependencies can be blacklisted
- Use simply expanded variables instead of recursively expended variables
  (`foo := $(bar)` instead `foo = $(bar)`) for internal variables during feature
  resolution. This improves performance significantly for
  `make info-boards-supported`.
- Reduce dependency resolution steps in `make info-boards-supported`
    - Globally resolve dependencies without any features (including arch)
      provided
      ==> This results in the common subset of feature requirements and modules
          used
        - But for individual boards additional modules might be used on top due
          to architecture specific dependencies or optional features
    - Boards not supporting this subset of commonly required features are not
      supported, so no additional dependency resolution is needed for them
    - For each board supporting the common set of requirements a complete
      dependency resolution is still needed to also catch architecture specific
      hacks
         - But this resolution is seeded with the common set of dependencies to
           speed this up
2020-04-02 09:55:07 +02:00
Benjamin Valentin
5ed88ecb0a drivers/at86rf215: unexport at86rf215_block_while_busy()
It's a private function that should not be used lightly.
2020-04-01 23:14:46 +02:00
Benjamin Valentin
8c6791b136 drivers/at86rf215: return error when switching state while busy
Previously the function attempted to block here and manually service
the ISR.
This lead to unexpected results, in particular messages queuing up in
the threads message queue.

The result was that the radio would not end up in the correct state.
E.g. sending SLEEP to both interfaces while a transmission was ongoing
would lead to the interfaces waking up again.

With this patch the operation will just return -ERRNO so the caller can
try again.

To reproduce, try the attached patch for the `gnrc_networking` example:

On master you will find that the radio still consumes ~2.4mA after 'shutdown'.
(It is in fact in the state TRXOFF as it woke up again)
With this change the radio should consume less than 1µA (DEEP SLEEP).

diff --git a/examples/gnrc_networking/main.c b/examples/gnrc_networking/main.c
index 6301f4291d..93b96eb939 100644
--- a/examples/gnrc_networking/main.c
+++ b/examples/gnrc_networking/main.c
@@ -23,12 +23,47 @@
 #include "shell.h"
 #include "msg.h"

+#include "periph/pm.h"
+
+#include "net/netopt.h"
+#include "net/gnrc/netif.h"
+
 #define MAIN_QUEUE_SIZE     (8)
 static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];

 extern int udp_cmd(int argc, char **argv);

+extern void send(char *addr_str, char *port_str, char *data, unsigned int num,
+                 unsigned int delay);
+
+static int send_and_shutdown(int argc, char **argv)
+{
+    (void) argc;
+    (void) argv;
+
+    /* the address must not exist */
+    char addr[] = "fe80::2068:3123:59f5:d238%7";
+    char port[] = "1234";
+    char data[] = "Hello World!";
+
+    send(addr, port, data, 1, 0);
+
+    /* disable radio */
+    gnrc_netif_t* netif = NULL;
+    netopt_state_t state = NETOPT_STATE_SLEEP;
+    while ((netif = gnrc_netif_iter(netif))) {
+        /* retry while busy */
+        while (gnrc_netapi_set(netif->pid, NETOPT_STATE, 0, &state,
+               sizeof(netopt_state_t)) == -EBUSY);
+    }
+
+    pm_set(0);
+
+    return 0;
+}
+
 static const shell_command_t shell_commands[] = {
+    { "shutdown", "turn off the radio & shut down", send_and_shutdown },
     { "udp", "send data over UDP and listen on UDP ports", udp_cmd },
     { NULL, NULL, NULL }
 };
diff --git a/examples/gnrc_networking/udp.c b/examples/gnrc_networking/udp.c
index e8a559846e..cb80855b76 100644
--- a/examples/gnrc_networking/udp.c
+++ b/examples/gnrc_networking/udp.c
@@ -36,7 +36,7 @@ static gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX
                                                                KERNEL_PID_UNDEF);

-static void send(char *addr_str, char *port_str, char *data, unsigned int num,
+void send(char *addr_str, char *port_str, char *data, unsigned int num,
                  unsigned int delay)
 {
     gnrc_netif_t *netif = NULL;
2020-04-01 23:08:44 +02:00
cd0b765346
Merge pull request #13664 from fjmolinas/pr_samd21_bootloader_default_module
boards: set samd21-arduino-bootloader as DEFAULT_MODULE
2020-04-01 21:42:42 +02:00
Benjamin Valentin
7e156dd2e5 cpu/saml1x, saml2x: PM_NUM_MODES is a valid mode
The mode PM_NUM_MODES is the IDLE mode, so do not skip it.
2020-04-01 18:10:23 +02:00
Benjamin Valentin
5d123cbb22 cpu/sam0_common: distribute PM_NUM_MODES among siblings
Also adapt the defines to the documentation

 - CPUs define up to 4 power modes (from zero, the lowest power mode,
   to PM_NUM_MODES-1, the highest)
 - >> there is an implicit extra idle mode (which has the number PM_NUM_MODES) <<

Previously on saml21 this would always generate pm_set(3) which is an illegal state.
Now pm_layered will correctly generate pm_set(2) for IDLE modes.

Idle power consumption dropped from 750µA to 368µA and wake-up from standby is also
possible. (Before it would just enter STANDBY again as the mode register was never
written with the illegal value.)
2020-04-01 18:10:23 +02:00
Dylan Laduranty
744896b062
Merge pull request #13783 from benpicco/cpu/samd5x/reinit-dfll
cpu/samd5x: work around errata when (re-)initializing DFLL
2020-04-01 18:07:53 +02:00
Martine Lenders
76acde0984
Merge pull request #13779 from miri64/sock/enh/sock_buf_recv-iterate-chunks
sock: amend API to iterate over stack-internal buffer chunks
2020-04-01 16:59:03 +02:00
Martine Lenders
b26566cdfc
Merge pull request #13782 from leandrolanzieri/pr/gnrc/ipv6_group_kconfig
gnrc/ipv6: Group IPv6 related Kconfig files
2020-04-01 16:57:44 +02:00