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

6242 Commits

Author SHA1 Message Date
8ac1909ea3
cpu: boards: stm32l0l1: use IS_ACTIVE where possible in stmclk 2020-09-22 22:30:19 +02:00
23117a844e
boards: cpu: stm32l0: rework clock configuration 2020-09-22 22:30:19 +02:00
MrKevinWeiss
d95452b979 cpu/native: Remove unused TIMER_0_EN 2020-09-22 16:26:01 +02:00
MrKevinWeiss
a65ce2a058 cpu/ezr32wg: fix comment 2020-09-22 16:26:01 +02:00
MrKevinWeiss
263aea60cb cpu/lpc1768: Cleanup timer to remove dev_enums 2020-09-22 16:26:01 +02:00
MrKevinWeiss
7c3082a7a3 cpu/lm4f120: Update timer macros to timer_config_t 2020-09-22 16:26:01 +02:00
Francisco
bcd2b3e369
Merge pull request #14030 from benpicco/cpu/sam0_common-rtc_tamper
cpu/sam0_common: GPIO: use tamper detection to wake from Deep Sleep
2020-09-22 11:41:48 +02:00
Francisco
64f6b7ffa4
Merge pull request #14702 from maribu/sched_active_thread
treewide: Fix direct access to scheduler internals
2020-09-21 09:09:59 +02:00
Benjamin Valentin
310eb4970c cpu/sam0_common: GPIO: use tamper detection to wake from Deep Sleep
On samd5x only the RTC can wake the CPU from Deep Sleep (pm modes 0 & 1).
The external interrupt controller is disabled, but we can use the tamper
detection of the RTC.

If an gpio interrupt is configured on one of the five tamper detect pins,
those can be used to wake the CPU from Deep Sleep / Hibernate.
2020-09-17 18:46:25 +02:00
Benjamin Valentin
0499d016ad cpu/sam0_common: implement RTC tamper detection 2020-09-17 18:45:50 +02:00
Francisco
6a826555cf
Merge pull request #14877 from maribu/stm32-eth-fix
cpu/stm32/periph/eth: Fix transmission bug
2020-09-16 14:30:44 +02:00
Benjamin Valentin
cff8e862b8 picolibc: model as a feature 2020-09-15 22:11:21 +02:00
chrysn
5b97b49b1d cpu/nrf52: Remove unused static inline USB poweroff
The function was never in used, and this is breaking builds using LLVM
that treats unused static inlines as an error.
2020-09-15 15:55:05 +02:00
Marian Buschsieweke
f5398cf57b
Merge pull request #14940 from benpicco/cpu/cortexm_common-puf_sram
cpu/cortexm_common: advertise puf_sram feature
2020-09-15 10:58:41 +02:00
18cda40fb5
Merge pull request #14710 from bergzand/pr/cortexm/thread_remove_nop_ctx_switch
cortexm_common: Skip context save/restore on scheduling the previous thread
2020-09-11 18:28:43 +02:00
Benjamin Valentin
d9116684e5 cpu/cortexm_common: advertise puf_sram feature
`puf_sram` is a feature of the linker script, it does not need vendor
specific hardware support.
2020-09-11 16:30:45 +02:00
benpicco
842933855f
Merge pull request #14995 from benpicco/cpu/cc2538-register
cc2538_rf: register with netdev
2020-09-11 16:03:08 +02:00
Benjamin Valentin
a1a67265cd cc2538_rf: use prefix for global function name 2020-09-11 13:33:37 +02:00
Benjamin Valentin
8ac3332cb6 cc2538_rf: add EUI provoder for primary EUI-64 2020-09-11 13:33:37 +02:00
Benjamin Valentin
1811686540 cc2538_rf: register with netdev 2020-09-11 13:33:37 +02:00
Benjamin Valentin
6675c5f5c0 cc2538_rf: pass address via pointer 2020-09-11 13:33:37 +02:00
Francisco
858533e68e
Merge pull request #14994 from benpicco/nrf802154-register
nrf802154: register with netdev
2020-09-11 12:48:40 +02:00
benpicco
5715f5776b
Merge pull request #14804 from bergzand/pr/sam0/gpio_iobus
sam0_common: Use Single-cycle I/O Port for GPIO when available
2020-09-10 23:45:43 +02:00
Dylan Laduranty
4db8a1f602
Merge pull request #14478 from benpicco/cpu/sam0/tc_pwm
cpu/sam0_common: add support to run PWM off TC timers
2020-09-10 23:04:58 +02:00
6007a31813
sam0: Add periph_gpio_fast_read feature where applicable 2020-09-10 22:13:25 +02:00
ddb22a3c56
sam0_common: Use Single-cycle I/O Port for GPIO when available
The Cortex-m0 based ATSAM devices can use the Single-cycle I/O Port for
GPIO. This commit modifies the gpio_t type to use this port when
available. It is mapped back to the peripheral memory space for
configuration access.  When it is not available, the _port_iobus() and
_port() functions behave identical, which is the case for the samd51.
2020-09-10 22:13:24 +02:00
Benjamin Valentin
0437461812 cpu/sam0_common: PWM: add support to run PWM off TC timers 2020-09-10 21:47:03 +02:00
5db55360cc
cortexm_common: Determine next thread before unscheduling 2020-09-10 20:42:55 +02:00
benpicco
f75ca11968
Merge pull request #14802 from jia200x/pr/nrf52840_radio_hal
nrf52840: implement Radio HAL
2020-09-10 18:07:51 +02:00
Jose Alamos
377560f5cc nrf52840: add radio hal implementation 2020-09-10 17:01:14 +02:00
Cenk Gündoğan
0d0bc91553
Merge pull request #14754 from leandrolanzieri/pr/no_archives
build system: link object files
2020-09-10 09:36:29 +02:00
Benjamin Valentin
58dc106309 nrf802154: register with netdev 2020-09-10 00:05:25 +02:00
benpicco
be3667bfdd
Merge pull request #14678 from dylad/cpu/saml1x/rtt-init-fix
cpu/saml1x: fix RTT issue in init process
2020-09-09 22:47:51 +02:00
Dylan Laduranty
35536233f9 cpu/saml1x: fix RTT issue in init process
RTT module may get stuck during the init process if the RTC was running from
a previous boot. Unsure we don't remove the peripheral clock during the CPU
init if RTC is active from a previous boot and add a workaround to disable
this module as it will be re-init at some point later by the auto_init module
or by the user's application.
2020-09-09 21:27:48 +02:00
benpicco
2ba037ad4a
Merge pull request #14977 from benpicco/CLOCK_CORECLOCK
always define CLOCK_CORECLOCK
2020-09-09 21:25:53 +02:00
5516b3d6c7
Merge pull request #14990 from MrKevinWeiss/pr/fix/lpcuart
cpu/lpc1768: Fix uart initialization
2020-09-09 18:09:33 +02:00
MrKevinWeiss
966527d168 cpu/lpc1768: Fix uart initialization
The pinsel_shift should be multiplied by 2 as each bitfield is 2 bits
2020-09-09 17:44:25 +02:00
benpicco
7bd933f1ce
Merge pull request #14991 from leandrolanzieri/pr/cpu/native/fix_rtc_dependency
cpu/native: pull xtimer when RTC is used
2020-09-09 17:43:49 +02:00
benpicco
84e36e6fcc
Merge pull request #14985 from jia200x/pr/hal/cc2538_rf/fix_style_issues
cc2538_rf_hal: fix style issues
2020-09-09 17:41:02 +02:00
Leandro Lanzieri
24d2578606
cpu/native: pull xtimer when RTC is used 2020-09-09 16:59:18 +02:00
Benjamin Valentin
7d29d85ddd cpu/efm32: define CLOCK_CORECLOCK 2020-09-09 16:44:12 +02:00
benpicco
21fbf62e4e
Merge pull request #14989 from aabadie/pr/cpu/stm32l4wb_apbx_div2_fix
cpu/stm32l4wb: fix APBx bitfields for divider factor 2
2020-09-09 16:42:57 +02:00
4e235b8e76
cpu/stm32l4wb: fix APBx bitfields for divider factor 2 2020-09-09 15:59:38 +02:00
cdbb3e025a
cpu/fe310: boards/hifive1*: use IS_ACTIVE where possible 2020-09-09 14:14:39 +02:00
ace160a2a3
boards/hifive1: use MHZ utility macro for clock frequency 2020-09-09 14:14:39 +02:00
49e11626d3
cpu/fe310: ensure all clock modes are built 2020-09-09 14:14:39 +02:00
Jose Alamos
9d770ec1bd cc2538_rf_hal: fix style issues 2020-09-09 13:07:58 +02:00
benpicco
239999fe73
Merge pull request #14984 from jia200x/pr/hal/missing_const
ieee802154_hal: add missing const qualifiers
2020-09-09 13:03:30 +02:00
Jose Alamos
d3630dcabe cc2538_rf: add missing const qualifiers 2020-09-09 11:18:01 +02:00
MrKevinWeiss
c2e81b3ca7 cpu/lpc1768: Generalize uart to remove dev_enums
Change uart dev 1 to use UART2 on p9 and p10 since p0 and p1 are not accessable
2020-09-09 10:25:37 +02:00
MrKevinWeiss
11465c941d cpu/lm4f120: Remove dev_enums dependency 2020-09-09 10:25:37 +02:00
Francisco
adb0bcab47
Merge pull request #14866 from aabadie/pr/boards/stm32l4wb_clock_kconfig
boards: cpu: stm32l4/wb: rework clock configuration and initialization
2020-09-09 09:35:29 +02:00
Francisco
757846ad7f
Merge pull request #14921 from aabadie/pr/boards/stm32f0_clock_kconfig
boards/stm32f0: rework clock initialization and configuration
2020-09-09 09:35:22 +02:00
Francisco
f08e65cd0c
Merge pull request #14981 from maribu/target-arch
build system: Overwrite TARGET_ARCH per arch
2020-09-09 09:10:52 +02:00
Marian Buschsieweke
7c1949341e
build system: Overwrite TARGET_ARCH per arch
Add `TARGET_ARCH_<ARCH>` for each architecture (e.g. `TARGET_ARCH_CORTEX` for
Cortex M) to allow users to overwrite the target triple for a specific arch
from ~/.profile or ~/.bashrc (or the like) without overwriting it for all others
as well.
2020-09-08 22:28:41 +02:00
9dd20c0ccb
cpu: boards: stm32l4/wb: use IS_USED for clock where possible 2020-09-08 18:42:42 +02:00
0745cc4a99
cpu: boards: smt32l4: rework clock configuration 2020-09-08 18:42:41 +02:00
7c923da0c8
cpu/stm32: split f0 clock initialization in separate file 2020-09-08 16:03:44 +02:00
9eef7a47cb
Merge pull request #14830 from benpicco/cpu/lpc23xx-picolibc
cpu/lpc23xx: enable support for picolibc
2020-09-08 10:35:45 +02:00
Marian Buschsieweke
c5c62e93d3
cpu/esp_common: Declare sched_active_{thread,pid}
Declare sched_active_thread and sched_active_pid locally in the ESP code for
now. Once the code is cleaned up to no longer tap into scheduler internals but
use the API instead, those can be dropped again.
2020-09-07 12:59:55 +02:00
63554b1a0c
cpu/cc2538/radio: only build required files 2020-09-04 15:25:36 +02:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00
benpicco
6fcf60c0b0
Merge pull request #14791 from jia200x/pr/cc2538_radio_hal
cc2538_rf: implement Radio HAL
2020-09-04 11:59:32 +02:00
Jose Alamos
1401635787 cc2538: implement radio hal 2020-09-04 11:09:17 +02:00
Benjamin Valentin
7bac063719 cpu/lpc23xx: mci: add xtimer dependency 2020-09-04 01:01:43 +02:00
22252337b6
cortexm_common: simplify FPU guards
The FPU is only enabled on platforms where it is available. The extra
checks for these platforms are redundant and removed here
2020-09-03 21:00:40 +02:00
Jose Alamos
18d188c5d9 cc2538: add IRQ bit definitions 2020-09-03 18:20:50 +02:00
Jose Alamos
2d7c316226 cc2538_netdev: disable netdev if radio hal is present 2020-09-03 18:20:50 +02:00
Jose Alamos
2917879407 cc2538: move chunks of init function to netdev 2020-09-03 18:20:49 +02:00
Jose Alamos
4cbd3a91b2 cc2538: move IRQ clear to netdev irq handler 2020-09-03 18:20:49 +02:00
Francisco
6ad0e70db2
Merge pull request #14595 from aabadie/pr/cpu/stm32_vectors_generator
cpu/stm32: generate vectors C files and IRQ defines from CMSIS headers
2020-09-02 21:25:44 +02:00
Leandro Lanzieri
401ed63b41
Merge pull request #14848 from fjmolinas/pr_periph_timer_config
drivers/Kconfig: add periph timer config menu
2020-09-02 17:33:46 +02:00
Francisco Molina
c4c2673aec
cpu/efm32/Kconfig: add EFM32_XTIMER_USE_LETIMER config 2020-09-02 15:31:28 +02:00
ec2e1a15f9
cpu/stm32: move cmsis package Makefile to stm32 cpu 2020-09-02 11:30:49 +02:00
91c9b8c1b0
cpu/stm32: remove hardcoded CPU_IRQ_NUMOF defines 2020-09-02 11:30:49 +02:00
0da196d98d
cpu/stm32: handle generated irqs.h in build system 2020-09-02 11:30:49 +02:00
39d95b1950
cpu/stm32: add tool to generate a header with IRQ numof defines 2020-09-02 11:30:49 +02:00
6cd6d5948f
cpu/stm32/vectors: remove hand crafted vectors_<fam>.c files 2020-09-02 11:30:49 +02:00
29b2a7aec1
cpu/stm32: integrate use of vectors generator in build system
The cmsis package is not added as a dependency but used directly before generating the vectors.c file
2020-09-02 11:30:49 +02:00
96ad6e9b84
cpu/stm32/vectors: ignore generated vectors C files 2020-09-02 11:30:48 +02:00
e6bb1a240e
cpu/stm32: add gen_vectors.py script
This script can be used to automatically generate the vectors.c file corresponding to an STM32 cpu line
2020-09-02 11:30:48 +02:00
benpicco
685efe83fb
Merge pull request #14890 from benpicco/cpu/cc2538-wdt
cpu/cc2538: add Watchdog implementation
2020-09-02 11:06:18 +02:00
36ecb40dd9
Merge pull request #14919 from bergzand/pr/fe310/unify_ld
fe310: Unify linker scripts
2020-09-01 18:03:46 +02:00
Cenk Gündoğan
538155c344
Merge pull request #14904 from leandrolanzieri/pr/kconfig/change_prefix_convention
treewide: modify Kconfig symbol prefixes
2020-09-01 15:57:06 +02:00
32399901f0
fe310: Unify linker scripts
Similar to the cortex-m common linker scripts, the RISC-V linker scripts
can be unified easily, requiring only the memory addresses and lengths.
This simplifies adding new RISC-V CPU's later
2020-09-01 14:39:55 +02:00
Peter Kietzmann
c5b63fc7ad
Merge pull request #14688 from JannesVolkens/stm32_link_up
drivers/stm32_eth: add 'NETDEV_EVENT_LINK_UP' event
2020-08-31 22:41:09 +02:00
53ac29aca4
Merge pull request #14887 from bergzand/pr/fe310/plic_periph
fe310: Add custom PLIC driver as peripheral
2020-08-31 21:25:03 +02:00
Jannes
f3e934988c drivers/stm32_eth: add 'NETDEV_EVENT_LINK_UP' event 2020-08-31 20:50:47 +02:00
498646aa17
fe310: Remove vendor plic driver 2020-08-31 16:26:43 +02:00
bef82edf43
fe310: Adapt peripherals to use the plic driver 2020-08-31 16:26:43 +02:00
1d999a1335
fe310: Make header guard unique for plic vendor header
Otherwise it conflicts with the other plic.h header
2020-08-31 16:26:43 +02:00
3180a11b51
fe310: Add PLIC peripheral driver 2020-08-31 16:26:42 +02:00
Leandro Lanzieri
5c3f7bde0c
Merge pull request #14780 from fjmolinas/pr_efm32_lpetimer_cleanup
cpu/efm32/timer: cleanups and improvements
2020-08-31 15:41:23 +02:00
Leandro Lanzieri
2e79e00ca7
treewide: change Kconfig prefix for module symbols
This changes the prefix used for the symbols that reprensent modules
(not the ones generated from USEMODULE).

MOD_ => MODULE_
2020-08-31 09:57:28 +02:00
Francisco Molina
cbf78fe3d4
cpu/efm32: allow running both LETIMER and regular timer 2020-08-31 09:38:31 +02:00
Francisco Molina
c77646ff79
cpu/efm32/timer: add enabling/disabling of prescaler timer 2020-08-31 09:38:31 +02:00
Francisco Molina
5c4db4a65b
cpu/efm32: use IS_ACTIVE for CONFIG_EFM32_USE_LETIMER 2020-08-31 09:38:30 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Marian Buschsieweke
8752e03d3e
cpu/stm32/periph/eth: Fix transmission bug
Using the TER bit in the TX descriptors when only using a single descriptor for
sending triggered a hardware bug. Thus, stop using the TER bit and store the
currently active TX descriptor in RAM instead.
2020-08-30 20:23:20 +02:00
Benjamin Valentin
18fe16298c cpu/cc2538: add Watchdog implementation
The Watchdog on the CC2538 only supports 4 intervals (2ms, 16ms, 250ms & 1s).
Since the watchdog timer API specifies a `max_time`, the interval equal or
below that time is selected.

E.g. for `max_time=125ms` the 16ms interval would be selected.
This is outside the tolerance of the `tests/periph_wdt` test.

Co-authored-by: Thomas Geithner <thomas.geithner@dai-labor.de>
2020-08-30 11:46:39 +02:00
889ea15936
fe310: Use read-modify-store instruction on GPIO
The rv32imac supports the A (atomic) extensions containing
read-modify-store operations. This commit modifies the GPIO code to use
these for all bitwise operations. The atomic operations are emitted with
relaxed ordering as they do not require multiprocessor synchronization.

This decreases the duration of the gpio operations from 59 ns to 50 ns
per call. depending a bit on the type of operation.
2020-08-29 09:24:02 +02:00
benpicco
029ae8c7d2
Merge pull request #14766 from benpicco/cpu/native-rtc_set_alarm
cpu/native: RTC: implement rtc_set_alarm()
2020-08-28 17:39:47 +02:00
d369eff042
Merge pull request #14868 from bergzand/pr/fe310/irq_trap_entry_optimize
fe310: Merge and optimize trap_entry with irq_arch
2020-08-28 15:04:14 +02:00
1e5dc928ad
fe310: Split sched_run call from handle_trap
This is a small optimization to the RISC-V trap handler. By splitting
the call to sched_run from the trap_handle call, loading the previous
thread ptr can be delayed until after it is determined that a schedule
run is required. This shaves of a few cycles during regular interrupts
that do not trigger the scheduler.
2020-08-28 14:17:58 +02:00
4289b09a33
fe310: Skip most context save on null thread 2020-08-28 14:17:56 +02:00
acf948a296
fe310: Only retrieve mepc and mtval on exception 2020-08-28 14:17:33 +02:00
503806cbb3
fe310: Only save caller-saved registers on regular trap
This commit reworks the trap entry to only save the callee-saved
registers when a context switch is required. the caller-saved registers
are always stored and restored to adhere to the RISC-V ABI. This saves
considerable cycles on interrupts.
2020-08-28 14:17:01 +02:00
45646a811d
Merge pull request #13003 from benpicco/lpc2387-timer 2020-08-28 13:35:15 +02:00
7eed33bf78
Merge pull request #14846 from hugueslarrive/adc_config
Declare adc_config[] like others peripherals configuration arrays
2020-08-28 09:59:21 +02:00
Benjamin Valentin
e2addab7f0 cpu/kinetis: RTC use rtc_mktime()
Use RTC helper functions instead of libc functions.
This gives us y2038 safety by the extended epoch
and saves a good chunk of memory:

mktime():

   text	   data	    bss	    dec	    hex	filename
  24756	    232	   2736	  27724	   6c4c	testssperiph_rtc/bin/openlabs-kw41z-mini/tests_periph_rtc.elf

rtc_mktime():

   text	   data	    bss	    dec	    hex	filename
  16348	    132	   2696	  19176	   4ae8	tests/periph_rtc/bin/openlabs-kw41z-mini/tests_periph_rtc.elf
2020-08-27 23:16:02 +02:00
benpicco
b6a542668b
Merge pull request #14845 from fjmolinas/pr_driver_netdev_common
tests/driver_netdev_common: add netdev_default
2020-08-27 17:01:50 +02:00
benpicco
779fb7d470
Merge pull request #14860 from hugueslarrive/adc_f3
STM32F3 familly ADC implementation
2020-08-27 16:50:44 +02:00
hugues
e314632c2e cpu/stm32/periph/adc_f3: initial ADC implementation for f3 2020-08-27 15:43:43 +02:00
hugues
6959a905a2 cpu/stm32/include/periph/f3/periph_cpu.h: add ADC support 2020-08-27 15:43:43 +02:00
Francisco
578b8b8885
Merge pull request #14372 from benpicco/cpu/nrf52-full
cpu/nrf52: add support for the whole family, fix nrf52811
2020-08-27 13:51:12 +02:00
Francisco Molina
c05dd9e6d3
treewide: change netdev driver dependencies against netdev_default
- gnrc_netdev_default depends on netdev_default, no need for checking
against both modules.
- fix documentation mentions of the double check
2020-08-27 11:46:25 +02:00
hugues
4c4b754e1c cpu/nrf51/include/periph_cpu.h: add adc_conf_t typedef 2020-08-27 11:43:22 +02:00
hugues
692f99989a cpu/nrf51/periph/adc: removes ADC configuration loading 2020-08-27 03:59:44 +02:00
hugues
07cdad29d7 cpu/stm32/periph/adc_f0: removes ADC configuration loading 2020-08-27 03:59:44 +02:00
hugues
5a26f74124 cpu/stm32/periph/adc_l0: removes ADC configuration loading 2020-08-27 03:58:33 +02:00
hugues
779d7a3b00 cpu/stm32/periph/adc_l4: removes ADC configuration loading 2020-08-27 03:56:26 +02:00
hugues
05702d5593 cpu/stm32/periph/adc_f2: removes ADC configuration loading 2020-08-27 03:56:26 +02:00
hugues
7680c8e2cb cpu/stm32/periph/adc_f1: removes ADC configuration loading 2020-08-27 03:56:26 +02:00
hugues
323725bcf5 cpu/stm32/periph/adc_f4: removes ADC configuration loading 2020-08-27 03:56:26 +02:00
hugues
3921a2f925 cpu/stm32/periph/adc_l1: removes ADC configuration loading 2020-08-27 03:56:26 +02:00
343f183f05
fe310: Merge intr.S into irq_arch 2020-08-26 20:17:21 +02:00
Martine Lenders
3d457b76cc
Merge pull request #14757 from benpicco/socket_zep_reboot
socket_zep: fix reboot
2020-08-26 19:41:16 +02:00
Benjamin Valentin
a41817bebd socket_zep: fix reboot
The `_zep_params_setup()` function will modify the `argv` string passed to it.
This is a problem because that string is re-used on reboot.

The modified string is then later processed in `socket_zep_setup()`, so we have to keep
the memory around.

The `strdup()` fulfills all this and the memory is freed by `execve()` on reboot.
A proper solution would be to parse the strings in `_zep_params_setup()`.
2020-08-26 15:38:03 +02:00
077a43948b
Merge pull request #14849 from hugueslarrive/max_adc_speed
cpu/stm32/periph/adc: remove MAX_ADC_SPEED from implementations where it is not used
2020-08-26 15:31:19 +02:00
12f670ea22
Merge pull request #14854 from bergzand/pr/fe310/irq_no_timer_init
fe310: Remove timer initialization from IRQ code
2020-08-26 14:49:40 +02:00
Francisco
f963089b28
Merge pull request #14718 from bergzand/pr/cortexm_common/hard_fault_add_thread_info
cortexm_common: Add thread info to hard fault handler
2020-08-26 12:40:25 +02:00
0d484f4d3a
cortexm_common: Add thread info to hard fault handler
While the hard fault handler prints the offending program counter, it
does not print information about the context triggering the hard fault.
This commit adds a line printing the thread ID and name that triggered
the hard fault. If the hard fault is triggered during an ISR, it only
prints that the hard fault happened during ISR context, not which ISR
triggered it.
2020-08-26 11:42:07 +02:00
32297a9818
fe310: Remove timer initialization from IRQ code
The RISC-V timer should only be touched by periph/timer and must not be
initialized and enabled by the IRQ code. The current code can cause an
unhandled interrupt when the timer is not used and the mtime register
hits UINT64_MAX.
2020-08-26 10:33:22 +02:00
hugues
629a5af8ed cpu/stm32/periph/adc_f0: remove unused MAX_ADC_SPEED 2020-08-25 17:16:49 +02:00
hugues
205ae92b84 cpu/stm32/periph/adc_l0: remove unused MAX_ADC_SPEED 2020-08-25 17:15:39 +02:00
hugues
c519149979 cpu/stm32/periph/adc_l1: remove unused MAX_ADC_SPEED 2020-08-25 17:14:55 +02:00
Benjamin Valentin
d2e0af2941 cpu/native: gpio: provide dummy implementations for GPIO IRQ 2020-08-25 13:53:14 +02:00
Benjamin Valentin
39b41d62cd cpu/native: allow to disable native periph implementations 2020-08-25 13:53:14 +02:00
Frank Hessel
4275b36cdb cpu/native: Adapt HW SPI for HW GPIO support 2020-08-25 13:53:14 +02:00
Benjamin Valentin
ea25e8580c cpu/native: add Linux GPIO implementation 2020-08-25 13:53:14 +02:00
Leandro Lanzieri
8b00d14014
Merge pull request #14837 from aabadie/pr/boards/stm32gx_clock_kconfig
cpu: boards: stm32gx: improve and add Kconfig clock configuration
2020-08-25 13:33:31 +02:00
9b2aa40e03
Merge pull request #14038 from benpicco/mtd_pagewise
mtd: add page addressed operations to allow access > 4GiB on SD cards
2020-08-25 13:10:20 +02:00
a1038aa70e
cpu: boards: stm32g4: improve clock configuration 2020-08-25 12:55:16 +02:00
a7f9b4d793
Merge pull request #14836 from aabadie/pr/cpu/stm32g4_full_speed
cpu/stm32g4: add transition phase when raising +80MHz clock
2020-08-25 10:02:13 +02:00
Benjamin Valentin
178167621b cpu/lpc2387: timer: use bitarithm_test_and_clear() 2020-08-25 09:19:27 +02:00
Benjamin Valentin
8126651009 cpu/lpc2387: timer: implement timer_set()
We can achieve greater accuracy for the relative timer_set()
if we don't use the generic implementation.

Use the same approach as used by atmega_common to trigger interrupts
for too small offsets.

tests/periph_timer_short_relative_set should now succeed for all intervals.
2020-08-25 09:19:27 +02:00
Leandro Lanzieri
53187c5ef7
Merge pull request #14782 from benpicco/cpu/sam0_common-full
cpu/sam0_common: add all parts to Kconfig
2020-08-24 18:38:11 +02:00
Benjamin Valentin
727e9240eb cpu/arm7_common: enable support for picolibc 2020-08-24 18:08:08 +02:00
Benjamin Valentin
af57b156c3 cpu/lpc23xx: add support for thread-local storage 2020-08-24 18:08:08 +02:00
benpicco
f3e1032f6e
Merge pull request #14827 from keith-packard/pr/libc/picolibc
Pr/libc/picolibc
2020-08-24 18:06:56 +02:00
Keith Packard
e215261ced picolibc: Use most NEWLIB code with picolibc
In most places, picolibc and newlib are the same, so use
the existing newlib code when compiling with picolibc.

Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-24 08:26:16 -07:00
Keith Packard
531050ada2 picolibc: Enable TLS support [v4]
Allocate and initialize a thread-local block for each thread at the
top of the stack.

Set the tls base when switching to a new thread.

Add tdata/tbss linker instructions to cortex_m and risc-v scripts.

Signed-off-by: Keith Packard <keithp@keithp.com>

---

v2:
	Squash fixes

v3:
	Replace tabs with spaces

v4:
	Add tbss to fe310 linker script
2020-08-24 08:26:16 -07:00
Keith Packard
a0d3436486 cpu/fe310: Add PICOLIBC support [v3]
Disable the newlib-nano stubs code when picolibc is in use

Signed-off-by: Keith Packard <keithp@keithp.com>

---
v2:
	Squash fixes in
v3:
	call stdio_init in _PICOLIBC_ mode to initialize uart
v3:
	Remove call to stdio_init from nanostubs_init, always
	call from cpu_init.
2020-08-24 08:24:54 -07:00
Benjamin Valentin
cd5a847684 cpu/sam0_common: define CPU_FAM based on CPU_MODEL 2020-08-24 16:13:18 +02:00
Benjamin Valentin
52a95642d5 sam0/adc: make driver MCU family agnostic
Replace checks for `CPU_SAMD21` with checks for actual defines.
2020-08-24 16:13:18 +02:00
Benjamin Valentin
7ed4979148 cpu/samd5x: define CPU_COMMON_SAMD5X symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
cc7f897cbc cpu/saml1x: define CPU_COMMON_SAML1X symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
5d96151775 cpu/saml21: define CPU_COMMON_SAML21 symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
e32b0783c4 cpu/samd21: define CPU_COMMON_SAMD21 symbol and use it 2020-08-24 16:13:18 +02:00
Benjamin Valentin
582da9b233 cpu/sam0_common: add script to generate Kconfig files for all parts
e.g. Usage:

	./sam0_common/dist/kconfig_gen.sh samd51
2020-08-24 16:13:18 +02:00
Benjamin Valentin
bc904cb396 cpu/saml21: add all parts to Kconfig 2020-08-24 16:13:18 +02:00
Benjamin Valentin
2cd0236a8c cpu/samd5x: add all parts to Kconfig 2020-08-24 16:11:48 +02:00
Benjamin Valentin
6a490af52b cpu/saml1x: add all parts to Kconfig 2020-08-24 16:11:48 +02:00
Benjamin Valentin
6b7cce02ec cpu/samd21: add all parts to Kconfig 2020-08-24 16:11:48 +02:00
benpicco
4b91866392
Merge pull request #14781 from ant9000/yarm
boards/yarm: Support for YARM board
2020-08-24 16:11:17 +02:00
84bbee784d
cpu/stm32: add transition phase when raising +80MHz clock 2020-08-24 15:42:13 +02:00
benpicco
500bb83d16
Merge pull request #14760 from janosbrodbeck/adc/same54
cpu/sam0_common: ADC: add support for samd5x/same5x
2020-08-24 13:49:21 +02:00
Keith Packard
76f6362292 cpu/fe310: Don't register __libc_fini_array with atexit
Picolibc makes atexit state per-thread instead of global, so we can't
register destructors with atexit in a non-thread context as we won't
have any TLS space initialized.

Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-23 13:13:28 -07:00
ff3bee24b9 picolibc: Provide integration into the build system [v3]
Support for picolibc as alternative libc implementation is added with
this commit. For now only cortex-m CPU's are supported.

Enable via PICOLIBC=1

---
v2:
	squash fixes in

v3:
	Remove picolibc integer printf/scanf stuff from sys/Makefile.include,
	it gets set in makefiles/libc/picolibc.mk

fixup for dependency
2020-08-23 13:12:57 -07:00
659c351c02
Merge pull request #14821 from bergzand/pr/cortexm_common/enable_mpu_after_config
cortexm_common: Enable MPU after configuring regions
2020-08-23 18:02:40 +02:00
b4aa2dae3e
cpu/stm32: remove MPU feature from stm32l052t8 2020-08-21 15:25:26 +02:00
Antonio Galea
6a59569f1f boards/yarm: definition for SAML21J18B CPU model 2020-08-21 15:18:41 +02:00
fd71e09b69
cpu/stm32: disable MPU for stm32g0
MPU is broken on cortex-m0+ in the current state
2020-08-21 14:56:47 +02:00
e2d8d40792
cortexm_common: Enable MPU after configuring regions
Reordering this ensures that the MPU regions are configured before
enabling the MPU and restricting the memory access.
2020-08-21 13:38:59 +02:00
6fa2b44c01
saml1x: Remove MPU feature
The MPU on the cortex-m23 has some differences with the MPU on the older
cortex-m devices. It is not implemented in the cortex-m MPU driver. This
removes the available feature as it gives a false sense of security by
advertising the feature, but implementing it with noop's
2020-08-20 14:37:08 +02:00
benpicco
157705c0c6
Merge pull request #14772 from maribu/esp_sched_cleanup
cpu/esp: Use API to access sched internals
2020-08-20 00:09:35 +02:00
benpicco
5913e0dc25
Merge pull request #14786 from leandrolanzieri/pr/cpu/esp_atmega/check_stdio
cpu/[esp/atmega]_common: check if other STDIO implementation is selected
2020-08-20 00:08:41 +02:00
János Brodbeck
083b3c167f
sam0/adc: add support for samd5x/same5x
Add samd5x/same5x support  through introducing ADC_DEV as alias for ADC0/ADC1/ADC. ADC (respectively ADC0) is the default if no device is set.
2020-08-19 18:00:29 +02:00
János Brodbeck
7a7f06a3e1
cpu/samd5x: add ADC resolution type 2020-08-19 17:48:37 +02:00
Francisco
e9833f68d6
Merge pull request #14794 from bergzand/pr/stm32/dma_add_unsuported_trigger_define
stm32: Add define for when DMA channel selection is not supported
2020-08-19 17:13:10 +02:00
5fab8f7a9a
stm32: Add define for when DMA channel selection is not supported
This adds a placeholder define for when the DMA peripheral available on
the MCU doesn't support channel/trigger filtering. This is the case on
the stm32f1 and stm32f3 family.
2020-08-19 16:09:55 +02:00
Francisco
505b9b4a30
Merge pull request #14785 from leandrolanzieri/pr/cpu/cc26x2_cc13x2/remove_pm
cpu/cc26x2_cc13x2: remove unnecessary pm.c
2020-08-19 13:29:16 +02:00
Francisco
4dce666435
Merge pull request #14764 from hugueslarrive/cpu/stm32/periph/dma
cpu/stm32/periph/dma: add support for STM32F3
2020-08-19 12:53:35 +02:00
hugues
d06aa3cd63 cpu/stm32/periph/dma: add support for STM32F3 2020-08-19 11:26:04 +02:00
hugues
2f0ac9e820 cpu/stm32/periph/spi: use dma_stop for STM32s that need it 2020-08-19 11:25:34 +02:00
Francisco
cc954274a7
Merge pull request #14763 from hugueslarrive/cpu/stm32/vectors/vectors_f3
cpu/stm32/vectors/vectors_f3: a small fix for STM32F334x8
2020-08-19 10:08:31 +02:00
Leandro Lanzieri
a64461cdad
cpu/esp_common: stdio_uart by default if there is no other 2020-08-19 10:00:35 +02:00
Leandro Lanzieri
67aec8392c
cpu/atmega_common: use stdio_uart only when no other is defined 2020-08-19 10:00:26 +02:00
Leandro Lanzieri
8f9ce7f81f
cpu/cc26x2_cc13x2: remove unnecessary pm.c
This CPU families already use the peripheral implementation of
cc26xx_cc13xx for PM.
2020-08-19 09:50:56 +02:00
benpicco
4a2d867339
Merge pull request #14749 from bergzand/pr/stm32/dynamic_spi_freqs
stm32: Add support for arbitrary SPI clock rates
2020-08-18 17:57:30 +02:00
Benjamin Valentin
277452807b cpu/esp_common: flash: implement write_page() 2020-08-18 17:25:40 +02:00
9d49a30560
stm32: Remove obsolete spi_divtable tool 2020-08-18 16:55:01 +02:00
b9d62e47d3
stm32: Add support for arbitrary SPI clock rates 2020-08-18 16:55:01 +02:00
benpicco
04df2bbd8a
Merge pull request #14779 from fjmolinas/pr_stm32f1_rtt_fixes
cpu/stm32/f1/rtt: fixes and improvements
2020-08-18 16:07:00 +02:00
Francisco Molina
14d4d2aacb
cpu/stm32/f1/rtt: don't trigger callbacks if unset 2020-08-18 14:10:15 +02:00
Francisco Molina
0d60b3370a
cpu/stm32/f1/rtt: some fixes to rtt_set_alarm
- disable alarm before setting a new one
- save cb and argument context before enabling the ISR
2020-08-18 13:43:10 +02:00
2f30aaaf06 cpu/cortexm_common: use mpu stack guard if DEVELHELP is enabled 2020-08-18 10:26:21 +02:00
benpicco
22d3bf7c51
Merge pull request #14594 from maribu/stm32-eth-cleanup
cpu/stm32: Clean up / fix periph_eth
2020-08-17 21:16:27 +02:00
Marian Buschsieweke
90c59b1c6f
Merge pull request #14733 from benpicco/cpu/lpc23xx/rtc_cleanup
cpu/lpc23xx: RTC: cleanup
2020-08-17 20:34:30 +02:00
Marian Buschsieweke
4fcf37c162
cpu/stm32/periph_eth: Handle lost & spurious IRQs
Fixes https://github.com/RIOT-OS/RIOT/issues/13496
2020-08-17 20:30:16 +02:00