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

6813 Commits

Author SHA1 Message Date
Benjamin Valentin
a5c222d830 cpu/stm32: GPIO/f1: use bitarithm_test_and_clear() 2021-02-01 13:47:41 +01:00
Vincent Dupont
3e8e109e8b cpu/stm32/gpio: fix EXTI flag clearing
In case a non-gpio EXTI (>= 16) is pending, the isr_exti() used to clear
the flag and try to call a callback, which was out-of-bouds, thus
generating a hard fault.
This fixes it by masking the pending_isr variables with 0xFFFF.
2021-02-01 13:30:48 +01:00
Benjamin Valentin
2ffd7b4261 cpu/kinetis: enable floating point support
I think this CPU was added before RIOT had support for the FPU on
Cortex-M4F, this should now have been long fixed.

Advertise the FPU on these CPUs.
2021-02-01 12:18:13 +01:00
118643ab2d
stm32: Resolve RAM size to bytes
The ram size is exposed as macro value and available for use in code.
For the stm32 it has a value in kilobytes suffixed with 'k'. This is
less than optimal for usage in arithmetic. This commit modifies the
value to bytes so that it can be used in preprocessor magic
2021-02-01 10:53:40 +01:00
benpicco
e87874ae54
Merge pull request #15689 from iosabi/qn908x_spi
cpu/qn908x: Implement blocking SPI support
2021-01-31 18:35:13 +01:00
iosabi
dfdd076125 cpu/qn908x: Implement blocking SPI support.
This patch implements the basic support the last of the FLEXCOMM modes,
Serial Peripheral Interface, in a simple blocking mode with busy wait,
which is enough to test all the SPI functionality end-to-end.

Tested reading and writing registers on a SPI peripheral, and checked
with the oscilloscope that the frequencies were as expected.

Results from `tests/periph_spi`:

```
> init 0 0 2 -1 0
SPI_DEV(0) initialized: mode: 0, clk: 2, cs_port: -1, cs_pin: 0
> bench

 1 - write 1000 times 1 byte:			16002	16009
 2 - write 1000 times 2 byte:			18001	18008
 3 - write 1000 times 100 byte:		802000	802007
 4 - write 1000 times 1 byte to register:	24003	24010
 5 - write 1000 times 2 byte to register:	26001	26008
 6 - write 1000 times 100 byte to register:	810001	810008
 7 - read 1000 times 2 byte:			23003	23009
 8 - read 1000 times 100 byte:		807002	807009
 9 - read 1000 times 2 byte from register:	32002	32009
10 - read 1000 times 100 byte from register:	816002	816009
11 - transfer 1000 times 2 byte:		23003	23009
12 - transfer 1000 times 100 byte:		807003	807010
13 - transfer 1000 times 2 byte to register:	32003	32009
14 - transfer 1000 times 100 byte to register:816002	816009
15 - acquire/release 1000 times:		7222	7228
-- - SUM:					5059250	5059351

```
2021-01-31 16:27:20 +00:00
iosabi
e085232da4 cpu/qn908x: Fix BOARD_HAS_ADC_PA06_CAP usage.
The macro was moved from Kconfig to the periph_cpu.h which means that
the macro name needed to be updated to BOARD_HAS_ADC_PA06_CAP instead
of CONFIG_BOARD_HAS_ADC_PA06_CAP.
2021-01-30 23:30:43 +00:00
iosabi
965ebaa15b cpu/qn908x: Implement ADC support
The ADC in the QN908x cpu offers multiple options for ADC conversion
using up to 8 external pins, one external reference pin and some
internal signals like a 1.2V reference, Vss, Vcc and an internal
temperature monitor.

This patch implements support for sampling ADC values from the ADC lines
defined in the board configuration. Some configurations are really
always present and don't require a board configuration, like the Vcc or
internal temperature monitor but to coexist with other board ADC line
options they are only set as part of the board configuration.
2021-01-30 17:25:09 +00:00
Hauke Petersen
deafa9074a cpu/nrf/radio/nrfble: request HFXO clock source 2021-01-29 11:10:15 +01:00
Hauke Petersen
11a914ed8a cpu/nrf/radio/nrfmin: request HFXO clock source 2021-01-29 11:10:15 +01:00
Hauke Petersen
cea6d8dd2d cpu/nrf/radio/nrf802154: request HFXO clock source 2021-01-29 11:10:15 +01:00
Hauke Petersen
9d1692c45a cpu/nrf5x: allow to request/release HFXO clk src 2021-01-29 11:10:15 +01:00
Dylan Laduranty
1d0dbb4626
Merge pull request #15846 from benpicco/cpu/sam0_common-spi_fixes
cpu/sam0_common: SPI: MOSI only operation & fix for adafruit-itsybitsy-m4
2021-01-28 09:26:28 +01:00
Benjamin Valentin
f12a82e4f9 cpu/stm32: use common pm_off() function
The code is identical to the one found in sys/pm_layered/pm.c
2021-01-27 14:07:22 +01:00
Benjamin Valentin
9c1455d55f cpu: make pm_layered a DEFAULT_MODULE
Allow to disable pm_layered in the bootloader to save some ROM.
2021-01-27 13:21:20 +01:00
ce97e9d8ce
Merge pull request #15859 from fjmolinas/pr_newlib_feature
treewide: model newlib as a FEATURE
2021-01-27 10:06:08 +01:00
Francisco Molina
63a2a6ce1b
treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Benjamin Valentin
31bf0c5257 cpu/sam0_common: SPI: only mux MISO on spi_acquire() 2021-01-26 21:42:06 +01:00
Benjamin Valentin
b894b280f4 cpu/samd21: update doc.txt with supported MCUs
SAMD10, SAMD20, SAMD21, SAMR21 all belong to the same family/generation
of Atmel MCUs, they are all supported by `cpu/samd21`.
2021-01-26 19:23:52 +01:00
benpicco
98726ded6d
Merge pull request #14662 from benpicco/cpu/samd20
cpu/samd21: add support for SAMD20 & SAM D20 Xplained Pro board
2021-01-26 19:14:36 +01:00
b3ffb690b1
Merge pull request #15857 from bergzand/pr/fe310/remove_nanostubs
cpu/fe310: Use newlib_syscalls_default stub implementations
2021-01-26 14:50:24 +01:00
128423edc6
cpu/fe310: Use newlib_syscalls_default stub implementations
This switches the fe310 to use the common newlib_syscalls_default
implementation.
2021-01-26 13:42:52 +01:00
Marian Buschsieweke
38188017a8
Merge pull request #15610 from maribu/stm32-ethernet-rx-timestamp
drivers/stm32_eth: add RX timestamps
2021-01-26 13:32:19 +01:00
Marian Buschsieweke
62aa3d103f
cpu/stm32/periph_eth: RX Timestamps 2021-01-26 10:44:04 +01:00
Benjamin Valentin
61bce4dc9c socket_zep: get MAC address from EUI provider 2021-01-25 22:59:04 +01:00
Benjamin Valentin
d8918c24fa socket_zep: register with netdev 2021-01-25 22:59:01 +01:00
Benjamin Valentin
ac9cd80aa7 cpu/native: clean up usage output
Remove newlines between block of arguments.
Add a newline at the end.

Makes usage output look tidier.
2021-01-25 22:58:38 +01:00
Francisco
de9f29cf42
Merge pull request #15835 from leandrolanzieri/pr/makefile/fix_default_modules_in_usemodules
Makefile.include: avoid recursive expansion of USEMODULE
2021-01-25 21:50:03 +01:00
87cd41a6d1
Merge pull request #15657 from aabadie/pr/cpu/stm32_merge_clock_headers
cpu/stm32: merge clock source selection headers
2021-01-25 13:57:05 +01:00
49a3592f92
Merge pull request #15849 from benpicco/cpu/stm32f7-adc
cpu/stm32: add periph_adc for STM32F7
2021-01-25 13:12:22 +01:00
5fef40ab5a
cpu/stm32/clk: cleanup common clock configuration 2021-01-25 11:46:35 +01:00
dfed1b0567
cpu/stm32: merge g0 and g4 clock configuration headers 2021-01-25 11:46:34 +01:00
0aadf367cc
cpu/stm32: rework common clock source selection header 2021-01-25 11:46:34 +01:00
Francisco
947c63666e
Merge pull request #15834 from leandrolanzieri/pr/cpu/stm32/kconfig_features_conflict_fix
cpu/stm32/kconfig: fix rtt/rtc error symbol
2021-01-25 10:15:32 +01:00
Leandro Lanzieri
2e2dcd5c27
cpu/msp430: move default module to Makefile.default 2021-01-25 09:17:00 +01:00
AravindKarri
63252d17c0 cpu/stm32/adc_f4: add support for stm32f7 2021-01-24 22:30:49 +01:00
Benjamin Valentin
00a467e86d cpu/sam0_common: SPI: allow to only configure MOSI/CLK
Some slave devices (e.g. LED strips) don't have a back-channel and
will only need MOSI and CLK.
2021-01-24 17:51:44 +01:00
Leandro Lanzieri
e5aca465bd
cpu/stm32/kconfig: fix rtt:rtc error symbol
It only exists conflict between the usage of RTC and RTT on the F1
family, but the error symbol was being set for all of them. This fixes
the issue.
2021-01-23 09:59:03 +01:00
b57b3d490d
cpu/fe310: Allow using immediates for ecall arguments
The mv instruction (which is usually implemented as `add rd, x0, r1`) is
changed to `add rd, x0, %input`. This can either be used as a load
immediate or as an move.

The code size grows by two bytes. This because GCC does not compress the
li instruction to the compressed version (even though this is possible).
2021-01-22 20:49:52 +01:00
896227ab08
cpu/fe310: Add used registers to clobbers 2021-01-22 20:49:17 +01:00
benpicco
46337efd93
Merge pull request #15783 from maribu/stm32_eth_fix_error_handling
cpu/stm32/periph_eth: fix error handling in send()
2021-01-22 20:25:25 +01:00
benpicco
4c403d6559
Merge pull request #15788 from bergzand/pr/core/inline_thread_yield_higher
core/thread: Allow for inline thread_yield_higher
2021-01-22 20:25:11 +01:00
benpicco
1a30a3a280
Merge pull request #15707 from ML-PA-Consulting-GmbH/fix/20210105__sam0_common-periph-flashpage__fix_unaligned_write
sam0_common/periph/flashpage: fix unaligned write
2021-01-22 20:24:53 +01:00
Marian Buschsieweke
0d432b59fe
Merge pull request #15840 from benpicco/cpu/atmega-rm_ldscripts_compat
cpu/atmega*: drop ldscripts_compat
2021-01-22 20:20:57 +01:00
Benjamin Valentin
236c4db83e cpu/atmega*: drop ldscripts_compat
Those were only needed with very old toolchains.
These days they cause more confusion than benefit, so drop them.
2021-01-22 19:05:20 +01:00
benpicco
e1052f0152
Merge pull request #15833 from yarrick/esp_emac_debug
cpu/esp32: Add newline to emac_main debug prints
2021-01-22 14:36:24 +01:00
517fc585b1
cpu/native: Add dummy thread_arch.h header 2021-01-22 09:21:46 +01:00
Erik Ekman
1d6aa2e865 cpu/esp32: Add newline to emac_main debug prints 2021-01-21 20:55:02 +01:00
Benjamin Valentin
f11fc64af6 cpu/sam0_common: PWM: fix build on samd20
There is no SYNCBUSY register, so the dummy fallback does not work.
This code path is not used anyway, so just ifdef it out.
2021-01-21 20:29:15 +01:00
b1f7fd3905
cpu/stm32: fix wrong max clock for stm32f423xx line 2021-01-21 18:31:15 +01:00
84dfc88ca3
cpu/arm7_common: Inline thread_yield_higher function 2021-01-20 10:37:42 +01:00
Marian Buschsieweke
21264b80cf
cpu/stm32/periph_eth: improve debugging output
Add ENABLE_DEBUG_VERBOSE flag, so that the noise during debugging can be
reduced. This is super helpful when testing under load, as otherwise there is
just too much noise in the output.
2021-01-20 10:36:59 +01:00
Marian Buschsieweke
788f997452
cpu/stm32/periph_eth: fix error handling
An earlier version of periph_eth used to always pack the first chunk of the
outgoing frame to the first DMA descriptor by telling the DMA to jump back
to the first descriptor within the last descriptor. This worked fine unless
the frame was send in one chunk (as e.g. lwip does), which resulted due to a
hardware bug in a frame being send out twice. For that reason, the behavior was
changed to cycle throw the linked DMA descriptor list in round-robin fashion.
However, the error checking was not updated accordingly. Hence, the error
check might run over (parts of) unrelated frames and fail to detect errors
correctly.

This commit fixes the issue and also provides proper return codes for errors.

Additionally, an DMA reset is performed on detected errors during RX/TX. I'm
not sure if/when this is needed, as error conditions are neigh impossible to
produce. But better be safe than sorry.
2021-01-20 10:35:05 +01:00
Francisco
4cc6c23ec6
Merge pull request #15809 from maribu/bitband-fix
sys/bit: provide CPU_HAS_SRAM_BITBAND
2021-01-20 10:22:04 +01:00
Daniel Lockau
ef7cbdb312 cpu/sam0_common/periph/flashpage: fix unaligned writes 2021-01-20 09:55:47 +01:00
Marian Buschsieweke
716441d0c3
cpu/cortexm_common: fix atomic_utils_arch.h
Only use bit-banding if all of SRAM supports bit-banding
2021-01-20 09:19:33 +01:00
Marian Buschsieweke
51db33375a
sys/bit: provide CPU_HAS_SRAM_BITBAND
CPU_HAS_SRAM_BITBAND can be used to check whether bit-banding is supported for
all of SRAM. With partially supported bit-banding, this feature is more of a
foot gun that a valuable tool.
2021-01-20 09:18:09 +01:00
e1941d8976
cpu/stm32f2f4f7: expose clock settings in Kconfig 2021-01-19 22:09:16 +01:00
b35e4f4a95
Merge pull request #15796 from fjmolinas/pr_rtc_lock_unlock
cpu/stm32/rtc: add unlock/lock to rtc_clear_alarm
2021-01-19 17:29:22 +01:00
Francisco Molina
7c12ea7416
cpu/stm32/rtc: add unlock/lock to rtc_clear_alarm 2021-01-19 13:33:17 +01:00
bce9e3caeb
cpu/msp430_common: Add dummy thread_arch.h header 2021-01-19 11:03:22 +01:00
0b01a999be
cpu/mips32r2_common: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
9979646b8b
cpu/fe310: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
0129e73ec0
cpu/cortexm_common: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
0d43c96ac7
cpu/avr8_common: Add dummy thread_arch.h header
The thread_yield_higher function is complex enough to not inline it for
the avr8 cpu
2021-01-19 11:03:21 +01:00
6d3d067443
cpu/cortexm_common: Do not use SVC for cpu_switch_context_exit
Directly use the pendsv interrupt instead of chaining through the SVC
interrupt
2021-01-18 16:27:17 +01:00
Leandro Lanzieri
63407b5e5b
cpu/lpc23xx/mci: add module to Kconfig 2021-01-18 10:42:34 +01:00
ba518ede09
cpu/fe310: Uncrustify code 2021-01-15 12:02:55 +01:00
Marian Buschsieweke
253a634b85
Merge pull request #15636 from jia200x/pr/nrf802154/fix_rssi
radio/nrf802154: fix set_cca_threshold range
2021-01-14 15:28:29 +01:00
Jose Alamos
f2fa3ca12f
radio/nrf802154: fix set_cca_threshold range
This commit fixes the CCA threshold range for set_cca_threshold.
Without this commit the threshold overflows when using values below
the receiver sensitivity.
2021-01-14 14:33:56 +01:00
Jose Alamos
698df63cfb
nrf802154/hal: fix unwanted emissions at the end of ACK frame
This commit turns off the transceiver immediately after sending an ACK
frame in order to avoid unwanted emissions (see ERRATA ID 204).
When the radio stays in TX_ON without an explicit transition, the radio
keeps sending a spurious signal for some milliseconds.
2021-01-14 11:06:11 +01:00
Jose Alamos
3c56cdf0c0
cc2538_rf/radio_hal: fix transmit function
This commit sets the correct value to the MCU_CTRL bit for the
cc2538_rf. This variable is used to detect when the radio is doing
transmission with CCA. Since this was not set to 1 when sending without
CCA, the `confirm_transmit` function returned -EAGAIN after the TX_DONE
event (which violates the HAL API).

This error was discovered using some Radio HAL riotctrl scripts by @LarsKowoll.
2021-01-14 10:34:50 +01:00
José Alamos
2bf10413d0
Merge pull request #15397 from fjmolinas/pr_ieee802154_crc_error
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR
2021-01-14 10:29:17 +01:00
Francisco Molina
fe1e16cdc7
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR 2021-01-13 23:42:41 +01:00
Francisco Molina
6d4d00ebe9
cpu/nrf52/nrf802154_radio: fix rssi calculation 2021-01-13 19:45:13 +01:00
Francisco Molina
f8bc934785
cpu/cc2538/radio/cc2538_rf_radio_ops: fix rssi reporting 2021-01-13 19:45:11 +01:00
Marian Buschsieweke
605220ce06
Merge pull request #15736 from bergzand/pr/riscv/use_ecall
cpu/fe310: Use ecall instruction for thread yield
2021-01-13 14:03:19 +01:00
Marian Buschsieweke
582f8d8430
Merge pull request #15754 from maribu/rssi
sys/net/gnrc: fix in-band signaling of no RSSI
2021-01-13 13:28:06 +01:00
5a203413a1
cpu/fe310: Remove software IRQ handling 2021-01-13 12:51:32 +01:00
1b2adb4821
cpu/fe310: Use ecall instruction for thread yield 2021-01-13 12:51:25 +01:00
Marian Buschsieweke
e2c5467d09
cpu/nrf5x_common/radio/nrfmin: drop duplicated code
`gnrc_netif_hdr_build()` calls internally `gnrc_netif_hdr_init()`, which does
initialize `gnrc_netif_hdr_t::rssi` and `gnrc_netif_hdr_t::lqi`. So no need to
do this twice.
2021-01-13 08:53:17 +01:00
Benjamin Valentin
3a7aa5d09a cpu/sam0_common: RTC: add timeout to spurious tamper event
Errate 2.17.4 says:

> Upon enabling the RTC tamper detection feature, a false tamper
> detection *can* be reported by the RTC.

It turns out that this spurious event is not always generated.
If RTC alarm is used and the CPU was previously woken from hibernate
by RTC, it *can* happen that the false tamper event is *not* generated.

In this case, we will block indefinitely on the mutex.

To solve this, add a timeout to the event.
Also poll the event instead of using a mutex, as we have already set
`PM->SLEEPCFG.bit.SLEEPMODE` at this point.
2021-01-12 17:36:40 +01:00
Benjamin Valentin
5b11da01c1 cpu/sam0_common: UART: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
93d27bb9a0 cpu/sam0_common: I2C: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
81e06f46a4 cpu/samd21: add samd20 to Kconfig 2021-01-12 15:48:39 +01:00
Benjamin Valentin
31b8dad147 cpu/samd21: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
7b65398ae1 cpu/sam0_common: add samd20 vendor files
Files from Atmel.SAMD20_DFP.1.3.165.atpack
2021-01-12 15:48:39 +01:00
Benjamin Valentin
8004aa4d34 cpu/sam0_common: not every CPU has DMA 2021-01-12 15:48:37 +01:00
Leandro Lanzieri
2cf3c603c7
cpu/kinetis/timer: consider no LPTMR when no config present 2021-01-12 15:31:37 +01:00
dylad
bca340d338 cpu/nrf52: update RIOTBOOT_LEN w/ MODULE_USBUS_DFU 2021-01-12 11:34:22 +01:00
dylad
9d02efb4ea cpu/cortexm_common: increase RIOTBOOT_LEN size when usbus_dfu is used 2021-01-12 11:34:22 +01:00
Martine Lenders
19565f4aea
Merge pull request #15741 from aabadie/pr/boards/lpc1768_common_conf
boards/lpc1768: move vendor conf code to CPU level
2021-01-12 10:30:03 +01:00
Sebastiaan de Schaetzen
6e90111eb9 stm32/periph/uart: set flow control bits before enabling uart 2021-01-12 07:37:19 +01:00
Jens Wetterich
450ede0da0 cpu/esp_common: Add missing includes and ISO-C++ compatibility 2021-01-10 18:02:39 +01:00
1090e55683
boards/lpc1768: move vendor conf code to CPU level 2021-01-08 21:47:10 +01:00
b13598cdc4
cpu/stm32: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
ba85c2d9ca
cpu/sam0_common: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
8dbe37969b
cpu/qn908x: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
189f7d862d
cpu/esp32: fix typo in timer documentation 2021-01-08 12:04:24 +01:00
8acf9398e8
Merge pull request #15723 from aabadie/pr/tools/codespell_fixes
tools/codespell: fix new typos found by recent version + add new ignored words
2021-01-08 11:01:49 +01:00
b4458e73f2
cpu/esp32: fix typo in Doxygen comment
depenend => depend
2021-01-08 10:15:32 +01:00
Leandro Lanzieri
131c0069d8
Merge pull request #15706 from aabadie/pr/cpu/stm32_mco_kconfig
cpu/stm32: model MCO clock configuration in kconfig
2021-01-08 09:49:00 +01:00
Bas Stottelaar
31c5c4988e
Merge pull request #15377 from basilfx/feature/efm32_slstk3400a
boards/slstk3400a: add support
2021-01-08 07:29:03 +01:00
Gerson Fernando Budke
1426e15679 cpu/avr8_common: Normalize method prefix name
Refactor atmega_ prefix to avr8_ prefix and update copyrights.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:42 -03:00
Gerson Fernando Budke
4cbd311196 cpu: Refact atmega_common into avr8_common
Split atmega_common code into avr8_common folder.  This moves common
avr8 code to be used for all avr8 variants: tiny, mega and xmega.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:22 -03:00
Gerson Fernando Budke
a0028a9ff8 cpu/atmega_common: Split cpu.c into atmega_cpu/cpu.c
Split cpu.c file into cpu.c and atmega_cpu.c files.  This extract mega
specific code from common code.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
Gerson Fernando Budke
4d68dd5aea cpu/atmega_common: Extract clock definitions
Refactor clock definitions from cpu.h to clock.h.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
d027454ad4
cpu/stm32/kconfig: use depends on instead of if 2021-01-07 16:07:04 +01:00
e8a5493080
cpu/stm32: model MCO in Kconfig for l4/wb 2021-01-07 16:02:30 +01:00
0e39c2ba17
cpu/stm32: model MCO in Kconfig for l0/l1 2021-01-07 16:02:29 +01:00
a9b154b4ac
cpu/stm32: model MCO in Kconfig for g0/g4 2021-01-07 16:02:29 +01:00
1f0e6c1057
cpu/stm32: model MCO in Kconfig for f0/f1/f3 2021-01-07 16:02:29 +01:00
5e719816d2
cpu/stm32/kconfigs: select cpu fam/lines without mco prescaler 2021-01-07 16:02:29 +01:00
Bas Stottelaar
d831a7e746 cpu/efm32: adapt MPU-capable cpus 2021-01-06 23:44:54 +01:00
Bas Stottelaar
ef8985fbbd cpu/efm32: add support for efm32hg family 2021-01-06 23:44:53 +01:00
Marian Buschsieweke
4714e38911
cpu/atmega_common: drop unused module
The module cpu_atmega_common_cxx seems to be non-existing and not used. It is
unclear whether this slipped in by accident or if this was actually useful at
some point in time. In any case, the module is not present (anymore) and cannot
be used, so let's clean up the Makefile.
2021-01-06 20:46:56 +01:00
Marian Buschsieweke
b14ca8318e
Merge pull request #15680 from maribu/msp430-malloc
cpu/msp430_common: use malloc_thread_safe
2021-01-03 11:21:03 +01:00
Marian Buschsieweke
cc8070cede
Merge pull request #15681 from maribu/mips-malloc
cpu/mips32r2_common: use malloc_thread_safe
2021-01-03 11:20:41 +01:00
Jens Wetterich
e36a0d883a esp_common/esp_now: use netdev_register() 2020-12-23 19:44:57 +01:00
73d3232f67
Merge pull request #15673 from maribu/fe310-malloc
cpu/fe310: use malloc_thread_safe
2020-12-21 13:29:02 +01:00
Marian Buschsieweke
9a61e27f8d
Merge pull request #15679 from maribu/arm7-malloc
cpu/arm7_common: use malloc_thread_safe
2020-12-21 10:00:34 +01:00
benpicco
7d8f801b20
Merge pull request #15650 from aabadie/pr/cpu/stm32_clk_merge_f0f1f3
cpu/stm32: merge f0/f1/f3 clock configuration headers
2020-12-20 02:31:12 +01:00
iosabi
70113b5fd3 cpu/qn908x: Implement blocking I2C support
This initial I2C support allows to use the I2C bus in controller mode to
interact with multiple peripherals in blocking mode. The CPU will
perform a busy wait when transferring data over I2C.
2020-12-19 22:41:57 +00:00
Marian Buschsieweke
7f7bf8454b
cpu/mips32r2_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 18:17:32 +01:00
Marian Buschsieweke
dfb67cef91
cpu/msp430_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 17:30:40 +01:00
Marian Buschsieweke
915d14eb98
cpu/arm7_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 17:23:12 +01:00
Martine Lenders
6646682873
Merge pull request #15611 from benpicco/boards/eui_provider.h
net/eui_provider: API cleanup
2020-12-18 15:02:57 +01:00
Marian Buschsieweke
277ddcb108
cpu/cortexm_common: fix select in Kconfig
Only select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG is true.
2020-12-18 12:50:33 +01:00
Marian Buschsieweke
b422ef9970
cpu/fe310: use malloc_thread_safe 2020-12-18 10:29:37 +01:00
Leandro Lanzieri
a76deec9a8
Merge pull request #15646 from aabadie/pr/cpu/fe310_common_clock_kconfig
cpu/fe310: boards/hifive1*: move all clock configuration at CPU level
2020-12-18 09:46:34 +01:00
Marian Buschsieweke
c8d16d21f7
Merge pull request #15606 from maribu/malloc-newlib-picolibc
sys/malloc_thread_safe: new module
2020-12-17 19:55:32 +01:00
dc77914ce8
cpu/fe310: add clock configuration header 2020-12-17 15:53:31 +01:00
aaca1331ca
cpu/fe310: move clock Kconfig to cpu 2020-12-17 15:53:31 +01:00
Marian Buschsieweke
09b41d2e1e
cpu/cortexm_common: use malloc_thread_safe module 2020-12-17 15:39:05 +01:00
Marian Buschsieweke
902aa29b62
sys/malloc_thread_safe: split out of cpu/atmega_common
Split out Gunar Schorcht's clever approach to provide thread safe malloc for
AVR into a system module and make AVR depend on this. This allows other
platforms to also use this.
2020-12-17 15:39:05 +01:00
048e8446ef
cpu/stm32f0: remove old clock configuration header 2020-12-17 08:38:40 +01:00
45c2b19f25
cpu/stm32: merge f0f1f3 clock configuration headers 2020-12-17 08:38:40 +01:00
ab477a94b0
Merge pull request #15635 from bergzand/pr/cortex_m0/pendsv_r12_clobber
cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M0
2020-12-15 22:58:25 +01:00
Kevin "Tristate Tom" Weiss
5a1dabc025
Merge pull request #15639 from dylad/pr/saml11/fix_iobus_gpio
cpu/saml11: fix GPIO/IOBUS management
2020-12-15 20:52:29 +01:00
dylad
e98459f414 cpu/saml11: fix GPIO/IOBUS management 2020-12-15 17:00:54 +01:00
8f1a42cbbf
cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M0 2020-12-15 13:16:02 +01:00
Daniel Lockau
33afc0ddab cpu/native/rtc: add rtc_set_time implementation 2020-12-15 12:52:35 +01:00
Dylan Laduranty
aec905d697
Merge pull request #15620 from benpicco/cpu/sam0_common/dac_startup
cpu/sam0_common: DAC: wait for DAC to be ready
2020-12-15 12:25:32 +01:00
benpicco
89c32e5be2
Update cpu/cc2538/include/cc2538_eui_primary.h
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2020-12-14 15:23:13 +01:00
Benjamin Valentin
fe9ae5bc80 net/eui_provider: provide index to the callback function
If the same callback function is used for multiple interfaces
(`NETDEV_INDEX_ANY`), it is necessary to also provide the index of
the interface to hand out and address.
2020-12-14 00:22:18 +01:00
dylad
c934d5dde3 kconfig: add PERIPH_ETH feature to samd5x 2020-12-13 22:30:54 +01:00
dylad
a1f5b6182d cpu/sam0: add initial Ethernet support 2020-12-13 22:01:50 +01:00
Benjamin Valentin
c5c46ba35b cpu/sam0_common: DAC: wait for DAC to be ready
The DAC can have some start-up delay.
If we try to write to it before it's ready, it will get stuck.

This happens now that `tests/driver_dac_dds` immediately sets a DAC
value after init.

The samd2x class of MCUs doesn't have this bit, but a quick test on
samd10 shows that it might not be nececary there - the DAC does not
get stuck when writing to it immediately after init.
2020-12-13 02:11:36 +01:00
Benjamin Valentin
8f72212eb0 cpu/sam0_common: SPI: add support for QSPI in SPI mode
We can use the QSPI peripheral as an additional (non-Quad) SPI peripheral.
2020-12-11 22:33:08 +01:00
Benjamin Valentin
94c7f40b9c cpu/sam0_common: SPI: add support for SAMD20 2020-12-11 22:33:07 +01:00
Benjamin Valentin
fb2a6b7024 cpu/sam0_common: SPI: cleanup
Insert whitespace and factor out functions to make it easier to
add functionality.
2020-12-11 22:33:07 +01:00
Benjamin Valentin
b6642a8cb7 cpu/samd21: add samd10 to Kconfig 2020-12-11 18:25:36 +01:00
Benjamin Valentin
a94919aeed cpu/samd21: add support for SAMD10 2020-12-11 18:25:36 +01:00
Benjamin Valentin
531fca952b cpu/sam0_common: add samd10 vendor files
Files from Atmel.SAMD10_DFP.1.1.77.atpack
2020-12-11 18:25:36 +01:00
benpicco
e6a4d0a4d5
Merge pull request #15569 from fjmolinas/pr_cc2538_uart_nonblocking
cpu/cc2538: add periph_uart_nonblocking
2020-12-11 10:57:36 +01:00
Francisco Molina
bc737a1f76
cpu/cc2538: add periph_uart_nonblocking
Add periph_uart_nonblocking. Since cc2538 has a transmit FIFO write
to the FIFO first and to a tsrb buffer only when the transmit FIFO
is full.

Rely on the FIFO TXIFLSEL condition to fill up FIFO as space becomes
available.
2020-12-11 09:36:16 +01:00
benpicco
c5b5788eb7
Merge pull request #15570 from benpicco/sys/bit.h
sys/bit: move bit.h header to sys/
2020-12-11 08:36:36 +01:00
Francisco
7bbe36ff6b
Merge pull request #15588 from benpicco/native/pm_layered
cpu/native: pm: fix build with pm_layered
2020-12-10 13:05:45 +01:00
Leandro Lanzieri
c4d832e653
Merge pull request #15001 from aabadie/pr/boards/stm32f0f1f3_clock_kconfig_only
boards/stm32f1f3: model clock configuration in Kconfig
2020-12-09 14:04:25 +01:00
benpicco
dd7a268ef8
Merge pull request #15527 from Einhornhool/pr/nrf52_i2c_reconfigure
cpu/nrf52: Add i2c reconfigure feature
2020-12-08 21:09:55 +01:00
Einhornhool
40d749644f cpu/nrf52: Add i2c reconfigure for use with CryptoAuth devices 2020-12-08 21:27:03 +02:00
Benjamin Valentin
d7ed3418b5 cpu/native: pm: fix build with pm_layered 2020-12-08 18:24:02 +01:00
8f6005b26e
boards: cpu: stm32f1: use .config for specific iotlab PLL_PREDIV 2020-12-08 18:02:57 +01:00
Francisco
ee80e5aced
Merge pull request #15534 from jia200x/pr/cc2538_rf_submac
cc2538_rf: default to netdev_ieee802154_submac
2020-12-08 17:59:37 +01:00
c68f63b318
cpu/stm32f1f3: handle custom pll prediv/mul at cpu level 2020-12-08 17:36:52 +01:00
0f23c875a2
cpu/stm32: adapt Kconfig clock configuration for f1/f3 2020-12-08 17:36:51 +01:00
Benjamin Valentin
e300dfe47e sys/bit: move bit.h from cortexm_common/ to sys/
The bit access functions are not tied to Cortex-M CPUs, here they only
provide optimisations via bit-banding.

But the functions are generally useful - so move them to an arch independent
location.
2020-12-08 17:07:41 +01:00
04ca147f59 cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M3+ 2020-12-08 13:29:54 +01:00
977f0dfd70 cpu/cortexm_common: split isr_pendsv() 2020-12-08 10:14:45 +01:00
iosabi
3890091ced cpu/qn908x: Add the RTC module.
This patch implements the real time clock module for the QN908X cpus.

This module is very straightforward with only the one notable drawback
that it doesn't have a match register like the CTIMER block to implement
the alarm function. Instead, this driver can only use the interrupt
generated ever 1 second to implement the alarm match comparison in
software.
2020-12-06 20:49:51 +00:00
iosabi
ac4c4d6132 cpu/qn908x: Fix triggering GPIO IRQ.
The IRQ for each GPIO port needs to be enabled in the NVIC on top of
enabling the corresponding bit in the GPIO port.

This was not caught in tests before because I was testing with a larger
stack of commits (including UART and timers) which also had this fix.

Manually poking the GPIOs while using tests/periph_gpio now properly
fires the interrupts.
2020-12-06 18:07:44 +00:00
benpicco
f72e98d0a0
Merge pull request #15557 from iosabi/qn908x_ctimer
cpu/qn908x: Add timer driver based on CTIMER.
2020-12-05 17:36:36 +01:00
iosabi
ef4b58f4f0 cpu/qn908x: Add timer driver based on CTIMER.
The QN908x CPU has several timer modules: one RTC (Real-Time Clock) that
can count from the 32kHz internal clock or 32.768 kHz external clock,
four CTIMER that use the APB clock and have four channels each and one
SCT timer with up to 10 channels running on the AHB clock.

This patch implements a timer driver for the CTIMER blocks only, which
is enough to make the xtimer module work. Future patches should improve
on this module to support using the RTC CNT2 32-bit free-running
counter unit and/or the SCT timer.
2020-12-04 23:18:27 +01:00
iosabi
80bd203b4d cpu/qn908x: Add missing gpio & uart enum values.
GPIO_BOTH gpio_flank_t; UART_PARTY_MARK and UART_PARTY_SPACE in
uart_parity_t; and UART_DATA_BITS_5 and UART_DATA_BITS_6
uart_data_bits_t enum values where missing from the periph_cpu.h header
since they are not supported by the CPU. This was causing some tests to
fail to compile, but only after adding the periph_timer module.

This patch adds those missing macros and makes the corresponding
functions fail when trying to use them.

A minor fix to the NWDT_TIME_LOWER_LIMIT value setting it to 1U to avoid
a -Werror=type-limits error in the tests/periph_wdt test. In theory 0
is a totally valid value although a bit useless since it will trigger
the WDT right away.
2020-12-04 23:18:27 +01:00
benpicco
ffebb5d792
Merge pull request #15529 from chrysn-pull-requests/nrf5x-periph_timer_periodic
cpu/nrf5x: implement periph_timer_periodic
2020-12-04 22:02:50 +01:00
chrysn
e3e89fe513 cpu/nrf5x: implement periph_timer_periodic 2020-12-04 19:03:44 +01:00
iosabi
bd929a3746 cpu/qn908x: Add support for UART.
The QN908x has four FLEXCOMM interfaces that support a subset of UART,
SPI or I2C each one. This patch adds generic support for dealing with
the FLEXCOMM initialization and interrupts and adds a driver for
RX/TX support in UART.

With this patch is now possible to use a shell on the device over UART.
2020-12-03 20:53:49 +01:00
benpicco
a80631a297
Merge pull request #15074 from maribu/ptp-clock
drivers/periph/ptp_clock
2020-12-03 09:59:07 +01:00
Marian Buschsieweke
ea3752db77
cpu/stm32: Added PTP clock implementation 2020-12-02 17:53:00 +01:00
benpicco
646e665a86
Merge pull request #13855 from iosabi/qn908x_initial
cpu/qn908x: Initial minimal support for NXP QN908x CPUs.
2020-12-02 10:31:38 +01:00
iosabi
cde8ac6093 cpu/qn908x: Initial minimal support for NXP QN908x CPUs.
The NXP QN908x CPU family is a Cortex-M4F CPU with integrated USB,
Bluetooth Low Energy and in some variants NFC. This patch implements the
first steps for having support for this CPU.

While the QN908x can be considered the successor of similar chips from
NXP like the KW41Z when looking at the feature set, the internal
architecture, boot image format and CPU peripherals don't match those
in the Kinetis line. Therefore, this patch creates a new directory for
just the QN908x chip under cpu/qn908x.

The minimal set of peripherals are implemented in this patch to allow
the device to boot and enable a GPIO: the gpio and wdt peripheral
modules only.

The wdt driver is required to boot and disable the wdt. On reset, the
wdt is disabled by the chip, however the QN908x bootloader stored in
the internal ROM enables the wdt and sets a timer to reboot after 10
seconds, therefore it is needed to disable the wdt in RIOT OS soon
after booting. This patch sets it up such that when no periph_wdt module
is used the Watchdog is disabled, but if the periph_wdt is used it must
be configured (initialized) within the first 10 seconds.

Tests performed:
Defined a custom board for this CPU and compiled a simple application
that blinks some LEDs. Manually tested with periph_wdt and with
periph_wdt_cb as well.
2020-12-02 02:47:07 +00:00
iosabi
21fd1f9258 Add vendor files for the NXP QN908x cpu
In preparation for adding support for the QN908x cpus, this patch adds
a pristine copy of the vendor SDK files needed for initial support.
The only modification to these files is to add '#ifdef __cplusplus'
guards to all the header files, even if not needed or already
present as '#if defined(__cplusplus)', to make sure
./dist/tools/externc/check.sh check passes.

These files are located under vendor/ directories (both
cpu/qn908x/include/vendor/ and cpu/qn908x/vendor/) and are part of NXP's
SDK for the QN908x family available for download from:
  https://mcuxpresso.nxp.com/en/builder

The files included in these vendor/ directories are released by NXP
under an Open Source license as described in each file, but only the
files used by the next patch are included here.
2020-12-02 02:45:53 +00:00
benpicco
418aaa6e67
Merge pull request #15388 from benpicco/boards/e104-bt5010a-tb
boards/e104-bt5011a-tb: add support for the E104-BT5011A Test Board
2020-12-02 00:24:33 +01:00
Jose Alamos
28ca3e202f cc2538_rf: default to netdev_ieee802154_submac 2020-12-01 13:20:49 +01:00
Martine Lenders
e2af953cc8
Merge pull request #15132 from benpicco/nrf802154-submac
cpu/nrf52: nrf802154: default to netdev_ieee802154_submac
2020-12-01 12:23:42 +01:00
b0b19203a7
Merge pull request #15190 from benpicco/boards/wefun-f401cc
boards/common/weact-f4x1cx: create common WeAct boards
2020-12-01 12:03:38 +01:00
Benjamin Valentin
fea9e68b88 nrf802154: don't hard-code max TX power
The smaller family members only have 4dBm max output power.
2020-12-01 11:42:52 +01:00
d527ab6994
cpu: boards: esp: use common esptool makefile 2020-12-01 10:36:42 +01:00
Francisco
4afc04523c
Merge pull request #14490 from yarrick/esp32_eth_kit
boards: add support for the ESP32-Ethernet-Kit board
2020-12-01 10:09:36 +01:00
Benjamin Valentin
0ed34cdb4d cpu/stm32: periph_eth: drop addr from eth_conf_t
MAC address is now supplied by EUI provider, no need to hard-code
it for the board.
2020-11-29 23:11:14 +01:00
Benjamin Valentin
a28a60f16c cpu/stm32: periph_eth: register with netdev 2020-11-29 23:10:37 +01:00
6e658868e0
cpu/cc2538: enable UART IRQ only if cb is not NULL 2020-11-28 10:30:33 +01:00
Erik Ekman
2afa93c9f7 boards/esp32-ethernet-kit: Setup Kconfig to match makefiles 2020-11-28 10:18:54 +01:00
Erik Ekman
064f58e7aa boards/esp32: add ESP32-Ethernet-Kit v1.2 board 2020-11-28 10:18:54 +01:00
Erik Ekman
db91be6ef8 cpu/esp32: add esp_jtag pseudomodule and feature
Available on esp32-wrover-kit and esp32-ethernet-kit boards.
2020-11-28 10:18:54 +01:00
Erik Ekman
e3142c39f0 boards/esp32: add ESP32-Ethernet-Kit board
Mostly copied from esp32-wroom-kit and Ethernet part from
esp32-olimex-evb.

Ethernet and serial port has been tested (on v1.2 board).
2020-11-28 10:18:54 +01:00
Erik Ekman
f28de6a544 cpu/esp32: add support for IP101G Ethernet phy
As used in ESP32-Ethernet-Kit board:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html

Inspired by existing code for lan8720 PHY as well as latest ESP32 code:
https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth_phy_ip101.c

Phy datasheet available: http://www.bdtic.com/ICplus/IP101G.html
2020-11-28 10:15:14 +01:00
a1ca06d6f4 cpu/efm32: coretemp.h: add missing stdint.h include 2020-11-25 17:52:34 +01:00
1d5e2e9cd9 all: remove traces of kernel_types.h
Automatically removed using:

    $ git grep -l kernel_types | xargs sed -i '/^#include .kernel_types/d'
2020-11-25 17:52:34 +01:00
575189510d
Merge pull request #15465 from maribu/atomic-utils-volatile
sys/atomic_utils: Use volatile qualifier
2020-11-24 22:05:33 +01:00