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

6005 Commits

Author SHA1 Message Date
Benjamin Valentin
4980cb7abe cpu/nrf52: fix nrf52832 vector definition
The CPU has 39 interrupt vectors and the FPU interrupt is the last one.
(Yes this MCU has an FPU).

Compare with vendor/nrf52.h
2020-08-09 21:46:06 +02:00
Benjamin Valentin
3f8bb169c6 cpu/nrf52: fix nrf52840 vector definition
The CPU has 48 interrupt vectors and spi3 is the last one.
See vendor/nrf52840.h
2020-08-09 21:46:06 +02:00
Benjamin Valentin
ec67798cf0 cpu/nrf52: fix spi_twi_irq for nrf52805/10/11
These smaller parts have SPI1 mapped to TWI0 (if SPI1 exists at all).
2020-08-09 21:46:06 +02:00
Benjamin Valentin
ca2b7e1952 cpu/nrf5x_common: UART: capture whole nrf52 lineup 2020-08-09 21:46:06 +02:00
Benjamin Valentin
1713dca711 cpu/nrf52: gpio: fix build for nrf52811
We can use a more general conditional here.
2020-08-09 21:46:06 +02:00
Benjamin Valentin
2f236cb092 cpu/nrf52: only enable instruction cache if available
The instruction cache is not available on all nrf52 MCUs.
2020-08-09 21:46:06 +02:00
Benjamin Valentin
ea2638dcac cpu/nrf52: split up vector definition
The interrupt vectors vary between each member of the family.
To retain sanity, split the vectors file up for each MCU.
2020-08-09 21:46:06 +02:00
Benjamin Valentin
307495985a cpu/nrf52: not all parts have a FPU 2020-08-09 21:46:06 +02:00
Benjamin Valentin
7a9e68af96 cpu/nrf52: add vendor files for nrf52805/10/20/33 2020-08-09 21:46:06 +02:00
Marian Buschsieweke
234a720571
Merge pull request #14516 from benpicco/bitband_hw
cortexm_common: fix check for bitbanding feature
2020-08-08 14:26:49 +02:00
Benjamin Valentin
0e22910c94 cpu/sam_common: set CPU_HAS_BITBAND
- https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf
- http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11100-32-bit%20Cortex-M4-Microcontroller-SAM4S_Datasheet.pdf
2020-08-08 12:44:11 +02:00
Benjamin Valentin
e886dad430 cpu/lpc1768: set CPU_HAS_BITBAND
> Support for Cortex-M3 bit banding.

https://www.nxp.com/docs/en/data-sheet/LPC1769_68_67_66_65_64_63.pdf
2020-08-08 12:44:11 +02:00
Benjamin Valentin
225f56b5e6 cpu/lm4f120: set CPU_HAS_BITBAND
> A bit-band region maps each word in a bit-band alias region to a single bit in the bit-band region.
> The bit-band regions occupy the lowest 1 MB of the SRAM and peripheral memory regions. A

https://www.mouser.com/datasheet/2/405/lm4f120h5qr-124014.pdf
2020-08-08 12:44:11 +02:00
Benjamin Valentin
fae0b00918 cpu/cc26x0: set CPU_HAS_BITBAND
> Bit-banding is supported in order to reduce the execution time for
> read-modify-write (RMW) operations to memory.
> With bit-banding, certain regions in the memory map
> (SRAM and peripheral space) can use address aliases to access
> individual bits in one atomic operation.

https://www.ti.com/lit/ug/swcu117i/swcu117i.pdf
2020-08-08 12:44:11 +02:00
Benjamin Valentin
098b37a7dc cpu/cc26x2_cc13x2: set CPU_HAS_BITBAND
> Bit-banding is supported in order to reduce the execution time for
> read-modify-write (RMW) operations to memory.
> With bit-banding, certain regions in the memory map
> (SRAM and peripheral space) can use address aliases to access
> individual bits in one atomic operation.

https://www.ti.com/lit/ug/swcu185d/swcu185d.pdf
2020-08-08 12:44:11 +02:00
Benjamin Valentin
b8d49fe627 cpu/cc2538: set CPU_HAS_BITBAND 2020-08-08 12:44:11 +02:00
Benjamin Valentin
848326bed6 cpu/lpc23xx: RTC: cleanup
- reduce indentation
 - sanitize logic in rtc_set_alarm()
 - ILR register is clear-on-write, writing 0 has no effect
2020-08-07 19:25:38 +02:00
benpicco
4635be207b
Merge pull request #14726 from benpicco/riot_epoch
drivers/periph_common: RTC: use RIOT_EPOCH as the RTC reset value
2020-08-07 19:07:28 +02:00
Leandro Lanzieri
6b52c53db3
Merge pull request #14614 from aabadie/pr/boards/hifive1_clock_kconfig
boards/hifive1*: add kconfig options to configure the clock
2020-08-07 17:40:08 +02:00
Benjamin Valentin
97bf000bcd cpu/stm32: use RIOT_EPOCH 2020-08-07 17:39:25 +02:00
Benjamin Valentin
69c436b891 cpu/ezr32wg: set CPU_HAS_BITBAND 2020-08-07 17:38:38 +02:00
benpicco
a455d74621
Merge pull request #14729 from gschorcht/cpu/esp32/vendor_dependeny_boarddir
cpu/esp32: remove the dependency of vendor code on BOARDDIR
2020-08-07 17:03:40 +02:00
benpicco
cc1ffc8a4d
Merge pull request #13357 from benemorius/pr/efm32-letimer
cpu/efm32/timer: add support for LETIMER
2020-08-07 17:03:01 +02:00
Gunar Schorcht
d19a1f5af5 cpu/esp32: remove the dependency of vendor code on BOARDDIR 2020-08-07 16:09:12 +02:00
benpicco
574676b150
Merge pull request #14700 from fjmolinas/to_cc2538_enhance_rtt
cpu/cc2538: RTT: implement missing API functions
2020-08-07 15:11:53 +02:00
Benjamin Valentin
6d684ee748 cpu/lpc23xx: use RIOT_EPOCH 2020-08-07 13:24:58 +02:00
Benjamin Valentin
d02aa4a6b5 cpu/sam0_common: RTC: use RIOT_EPOCH 2020-08-07 13:24:10 +02:00
7acf81552a
boards/hifive1* cpu/fe310: improve clock customization 2020-08-06 15:59:34 +02:00
Benjamin Valentin
39d71ac671 cpu/sam0_common: GPIO: ignore interrupts when interrupts are disabled
If we disable an external interrupt, GPIO events that would generate an interrupt will still set the interrupt flag.
That means once we enable the interrupt again, a stale interrupt will be triggered.

This is surprising and probably not what the user wants, unfortunately the API documentation is not very clear about what to expect.
There is however no way to drop those intermediate interrupts with the current API.

Ignoring the events that occurred while the GPIO interrupt were disabled is probably the right (and expected) thing to.
2020-08-05 16:57:05 +02:00
789f10e816 cpu/msp430_common: increase THREAD_STACKSIZE_DEFAULT to 384
Both tests/pthread_tls and tests/prng_sha256prng fail without this, but
other platforms run fine with their defaults. Lets consider the higher
value a better default.
2020-08-05 14:32:58 +02:00
4f233cd7ea cpu: remove cc430
The only board with this chipset was the chronos, which has been
removed.
2020-08-05 14:32:58 +02:00
038823c731 cpu/msp430_common/vendor/README.md: add some explanation 2020-08-05 14:32:58 +02:00
5a00e2e36c cpu/msp430_common: use __stack for ISR stacks 2020-08-05 14:32:58 +02:00
aa2f500d51 cpu/msp430_common: update thread_stack_init to changed ABI
The old mspgcc used R15-R12 for args 0-3. The newer MSP430 EABI uses
R12-15.

See https://www.ti.com/lit/an/slaa664/slaa664.pdf for more details.
2020-08-05 14:32:58 +02:00
909d740d37 cpu/msp430_common: bump msp430-gcc-support-files to 1.210 2020-08-05 14:32:58 +02:00
ef099f9d46 cpu/msp430_common: add NOPs to irq functions
They might not be necessary, but GCC warns if they're absent.
Thus let's pay the one or two extra instructions for silencing the
warnings.
2020-08-05 14:32:58 +02:00
08c50947cc cpu/msp430_common: move newlib default module decl to Makefile.dep 2020-08-05 14:32:58 +02:00
fd335d30ee cpu/msp430: re-create c11_atomics_compat_cpu.hpp using msp430-elf-gcc 2020-08-05 14:32:58 +02:00
10213057b1 cpu/msp430: update deps, move to Makefile.dep 2020-08-05 14:32:57 +02:00
260ec3666f cpu/msp430: select newlib_nano module if newlib is used 2020-08-05 14:29:07 +02:00
8753457e45 cpu/msp430_common: use default newlib heap_stats 2020-08-05 14:29:07 +02:00
9db23b6c3d cpu/cc430: update to new support headers 2020-08-05 14:29:07 +02:00
dbcf59f196 cpu/msp430: call newlib _init() in startup script 2020-08-05 14:29:07 +02:00
178e39afc2 cpu/msp430: remove obsolete stdio code 2020-08-05 14:29:07 +02:00
30cf61dd35 cpu/msp430: remove obsolete msp430 specific headers 2020-08-05 14:29:07 +02:00
a0aeeb5ff4 cpu/msp430: update to modern gcc & newlib 2020-08-05 14:29:00 +02:00
bf072bdd55 cpu/msp430_common: add msp430-gcc-support-files 1.208 2020-08-05 14:27:25 +02:00
0268a772ed Revert "cpu/msp430_common: set top of heap for sbrk"
This reverts commit 55f433103b.
2020-08-05 14:27:25 +02:00
5b6534e02d Revert "cpu/msp430_common: add real malloc/free functions"
This reverts commit 419cedf58e.
2020-08-05 14:27:25 +02:00
Benjamin Valentin
a8d5f13ad9
cpu/cc2538: rtt: allow to set alarm and overflow cb independently
Previously the setting the alarm would overwrite the overflow callback
and vice versa.

Since we can only set one alarm in hardware, always set the alarm to the
closest event of the two.
2020-08-04 16:22:44 +02:00
Benjamin Valentin
852fd7f531
cpu/cc2538: rtt: implement rtt_get_alarm()
We can't read back the alarm, so just store it in a variable.
2020-08-04 16:21:19 +02:00
Benjamin Valentin
d7f722e98f
cpu/cc2538: rtt: implement rtt_set_counter()
We can't set the hardware counter directly, so always add an offset.
2020-08-04 16:21:17 +02:00
Leandro Lanzieri
d7dbbb71ac
Merge pull request #14226 from benpicco/cpu/sam0_common/i2c_arbitrary_freqs
cpu/sam0_common: i2c: fix BAUD handling & cleanup
2020-08-04 14:49:10 +02:00
Benjamin Valentin
1472d2095c cpu/sam0_common: i2c: document frequency constraints 2020-08-04 12:13:28 +02:00
Benjamin Valentin
e560042488 cpu/sam0_common: flashpage: split RWWEE and normal functions
Move common code into helper functions and extract the commands
that differ between normal and RWWEE page reading / writing.
This cuts down on `#ifdef` use.
2020-08-04 12:00:49 +02:00
Peter Kietzmann
6adf07caf0
Merge pull request #14672 from jia200x/pr/fix_cc2538_rssi
cc2538: fix RSSI offset
2020-08-03 09:45:16 +02:00
Peter Kietzmann
c1f83aeac8
Merge pull request #14673 from jia200x/pr/fix_nrf_pow
nrf802154: fix set_tx_power function
2020-08-02 15:19:51 +02:00
Benjamin Valentin
548f59d380 cpu/samd5x: remove RTC workaround
This is no longer needed.
2020-07-31 22:00:09 +02:00
Benjamin Valentin
83a56ae666 cpu/sam0_common: merge RTC & RTT implementation
The RTC and RTT share the same peripheral, so they can also
share the same code.

This is needed to integrate the Tamper Detection into common
RTC/RTT code.
2020-07-31 22:00:09 +02:00
Jose Alamos
5c824f6f12 nrf802154: fix set_tx_power function 2020-07-31 17:16:10 +02:00
Jose Alamos
519f8f4529 cc2538: fix RSSI offset 2020-07-31 16:08:04 +02:00
Francisco
7e6fee8260
Merge pull request #14615 from maribu/atmega-idle-stack-size
cpu/atmega_common: Increase idle stack size with xtimer
2020-07-30 14:43:20 +02:00
Martine Lenders
5cd3ded485
Merge pull request #14649 from gschorcht/cpu/esp32/cleanu_cpp
cpu/esp32: cleanup of C++ hacks
2020-07-29 11:20:44 +02:00
Francisco
9adc79f91a
Merge pull request #14562 from benpicco/cpu/cc2538-bitarithm_test_and_clear
cpu/cc2538: GPIO: use bitarithm_test_and_clear()
2020-07-29 10:38:37 +02:00
Gunar Schorcht
2ed4486f21 cpu/esp32: cleanup of C++ hacks
Since former ESP32 toolchain versions used POSIX threads, module `pthread` was required. The built-in `cxa_ctor_guards` had to be replaced since they used the `pthread_once` function for singleton objects initialization where the parameter `once` was of incompatible type with that provided by RIOT's `pthread` module. The current ESP32 toolchain version no longer uses POSIX threads. The dependency on module `pthread` as well as according C++ hacks can be removed.
2020-07-29 10:14:57 +02:00
Martine Lenders
b1bf8ab981
Merge pull request #14565 from bergzand/pr/sched/fix_retrigger
sched: Prevent retriggering the scheduler interrupt during idle sleep
2020-07-28 22:11:25 +02:00
Marian Buschsieweke
9a14903066
Merge pull request #14326 from benpicco/cpu/sam0_common/uart_arithmetic
cpu/sam0_common: UART: implement arithmetic BAUD mode
2020-07-28 19:43:25 +02:00
Martine Lenders
ab88a96a4a
Merge pull request #14638 from benpicco/cpu/native/async_read-cleanup
cpu/native/async_read: close fds on cleanup
2020-07-28 18:39:41 +02:00
0b1a793dbe
Merge pull request #14624 from kaspar030/fix_msp430_thread_yield_higher 2020-07-28 16:32:30 +02:00
Benjamin Valentin
bd2e6c30e6 cpu/native/async_read: close fds on cleanup
This was lost when moving to poll().
We need to close the fds on cleanup.

fixes #14636
2020-07-28 14:47:59 +02:00
1d46cf70eb cpu/msp430_common: fix thread_yield_higher() when called in isr 2020-07-28 13:27:55 +02:00
Benjamin Valentin
274357d583 cpu/lpc23xx: GPIO: use bitarithm_test_and_clear() 2020-07-28 12:44:36 +02:00
Benjamin Valentin
08b3e2bd6b cpu/cc2538: GPIO: use bitarithm_test_and_clear() 2020-07-28 12:44:23 +02:00
Benjamin Valentin
cc2a3c9fd3 cpu/sam0_common: GPIO: use bitarithm_test_and_clear() 2020-07-28 12:43:39 +02:00
Benjamin Valentin
9970c57cdf cpu/stm32: GPIO: use bitarithm_test_and_clear() 2020-07-28 12:43:24 +02:00
benpicco
403b6b15c6
Merge pull request #14481 from maribu/cpp-fix-linking
Makefile.{base,include}: Fix linking for C++ code in external modules
2020-07-28 12:42:14 +02:00
Benjamin Valentin
003c25b2e8 cpu/sam0_common: uart: document frequency constraints 2020-07-28 11:22:22 +02:00
Benjamin Valentin
e1f84de6c5 cpu/sam0_common: UART: simplify init sequence
We don't need to read-modify-write the CTRLA register to disable
the UART.
The entire CTRLA register is re-written just a few lines below, so
we can just set it to 0 to disable the UART.

There is also no need to reset the UART since we re-write all config
registers in init.
2020-07-28 11:22:22 +02:00
Benjamin Valentin
28c1c502bc cpu/sam0_common: UART: implement arithmetic BAUD mode
SAMD20 does not implement a Fractional Baud mode, so we have to
implement Asynchronous Arithmetic mode.
2020-07-28 11:22:22 +02:00
benpicco
ecab75b529
Merge pull request #13632 from benpicco/cpu/sam0_common/uart-deinit
drivers/periph/uart: add periph_uart_reconfigure feature & implementation for sam0
2020-07-28 11:12:19 +02:00
d59233baf1
Merge pull request #14556 from benpicco/bitarithm_test_and_clear
core/bitarithm: add bitarithm_test_and_clear()
2020-07-28 10:11:47 +02:00
Benjamin Valentin
e6f33fc436 cpu/sam0_common: uart: implement the periph_uart_reconfigure feature 2020-07-28 10:10:15 +02:00
Benjamin Valentin
62dbb21f19 cpu/sam0_common: UART move pin configuration to function
Makes the init code easier to read.
2020-07-28 10:10:15 +02:00
benpicco
22e9ba12a3
Merge pull request #14598 from maribu/avr-cpp
cpu/atmega_common: Provide C++ support (without libstdc++)
2020-07-27 17:41:31 +02:00
Marian Buschsieweke
040bad0425
cpu/atmega_common: increase stack size with xtimer
If a timer triggers while the idle thread is running, previously a stack
overflow was triggered. This commit increases the idle threads stack size if
xtimer is used.
2020-07-27 16:52:36 +02:00
millotp
69858916c7 boards: enable CAN bus on nucleo-f446re & nucleo-f446ze
Changed the pinout for the CAN bus:
CAN RX: PB8
CAN TX: PB9

And added periph_can to FEATURES_PROVIDED and to Kconfig files
2020-07-27 14:36:29 +02:00
Marian Buschsieweke
53375f04bf
cpu/stm32/periph_eth: Optimize / fix flush
- Added missing wait for TX flush
- Grouped access to the same registers of the Ethernet PHY to reduce accesses.
  (The compiler won't optimize accesses to `volatile`, as defined in the C
  standard.)
2020-07-26 22:12:03 +02:00
Marian Buschsieweke
a5dbec33d9
cpu/stm32/periph_eth: Cleanup & fix DMA descriptor
- Add missing `volatile` to DMA descriptor, as memory is also accessed by the
  DMA without knowledge of the compiler
- Dropped `__attribute__((packed))` from DMA descriptor
    - The DMA descriptor fields need to be aligned on word boundries to
      properly function
    - The compiler can now more efficiently access the fields (safes ~300 B ROM)
- Moved the DMA descriptor struct and the flags to `periph_cpu.h`
    - This allows Doxygen documentation being build for it
    - Those types and fields are needed for a future PTP implementation
- Renamed DMA descriptor flags
    - They now reflect to which field in the DMA descriptor they refer to, so
      that confusion is avoided
- Added documentation to the DMA descriptor and the corresponding flags
2020-07-26 22:12:03 +02:00
Benjamin Valentin
4df36cbfda cpu/sam0_common: i2c: improve readability of baud rate calculation
Use variables to represent fSCL an fGCLK to make the baud rate calculation
more readable.
2020-07-25 15:14:55 +02:00
Benjamin Valentin
2fb0d9061f cpu/sam0_common: i2c: fix High Speed 2020-07-25 15:14:55 +02:00
Benjamin Valentin
7269dc4e3a cpu/sam0_common: i2c: allow arbitrary I2C frequencies
The Atmel I2C peripheral supports arbitrary I2C frequencies.
Since the `i2c_speed_t` enum just encodes the raw frequency values,
we can just use them in the peripheral definition.

We just have to remove the switch-case block that will generate an error
for values outside of `i2c_speed_t`.
2020-07-25 15:14:55 +02:00
42eb044ec6
Merge pull request #14482 from hugueslarrive/cpu/stm32/periph/pwm
cpu/stm32/periph/pwm: some bugfixes...
2020-07-24 21:05:57 +02:00
Marian Buschsieweke
7b49310147
cpu/atmega_common: Enable cpp feature 2020-07-24 15:22:34 +02:00
Marian Buschsieweke
7d4911e3ad
cpu/native/Kconfig: Select HAS_LIBSTDCPP 2020-07-23 20:34:20 +02:00
Marian Buschsieweke
c6df3ad643
cpu/arm7_common/Kconfig: Select HAS_LIBSTDCPP 2020-07-23 20:30:26 +02:00
Marian Buschsieweke
d15606908a
cpu/mips32r2_common/Kconfig: Select HAS_LIBSTDCPP 2020-07-23 20:28:32 +02:00
Marian Buschsieweke
f8b7c899f8
cpu/esp_common: Allows use feature cpp
The vendor code uses C++ code, thus, C++ support needs to be enabled in any
case.
2020-07-23 20:18:33 +02:00
benpicco
f3bce19646
Merge pull request #14503 from maribu/cpp-feature
build system: Add libstdcpp feature and doc
2020-07-23 19:05:10 +02:00
107356ec5d
Merge pull request #14575 from gschorcht/cpu/stm32/fix_gpio_definition
cpu/stm32: GPIO ports definition fix
2020-07-23 12:24:44 +02:00
56f9a4a686
Merge pull request #14577 from fjmolinas/pr_cc2538_uart_write_synchronous
cpu/cc2538/uart: uart_write wait for all bytes to be sent
2020-07-22 14:51:50 +02:00
Francisco Molina
da171f2254
cpu/cc2538/uart: uart_write wait for all bytes to be sent
uart_write should block until all bytes are sent out, so wait for
transmit fifo to empty before returning.
2020-07-22 12:56:12 +02:00
Gunar Schorcht
044d08d599 cpu/stm32: GPIO ports definition fix
The available GPIO ports may also differ within a family. Therefore, the vendor definitions GPIO* are used instad of CPU_FAM_STM definitions to determine which ports are available for a certain MCU.
2020-07-22 09:13:52 +02:00
Benjamin Valentin
464dc63f08 cpu/arm7_common: add __ARM_FEATURE_CLZ feature test
The feature test macro should work on all ARM CPUs supported by gcc.
2020-07-21 16:03:59 +02:00
Benjamin Valentin
a8904edd7d core/bitarithm: add bitarithm_test_and_clear() 2020-07-21 16:03:59 +02:00
185f703c23
Merge pull request #14163 from aabadie/pr/cpu/stm32g0
cpu/stm32g0: add basic support + add nucleo-g070rb board
2020-07-21 14:53:59 +02:00
b7219d68f4
Merge pull request #12428 from benpicco/native_poll
native/async_read: use poll() instead of select()
2020-07-21 14:01:32 +02:00
fc1d642113
cpu/cortexm_init: add specific case for stm32g0 svcall irq 2020-07-21 12:45:25 +02:00
dada52ecd2
cpu/stm32: add stm32g0 support 2020-07-21 12:45:25 +02:00
0b549c6e0c
Merge pull request #14152 from aabadie/pr/pkg/stm32cube
pkg/stm32cmsis: retrieve STM32 CMSIS header from a package
2020-07-21 12:27:19 +02:00
47e2885f80 cpu/native: async_read: add native_async_read_add_int_handler()
fcntl(fd, F_SETOWN, getpid()); doesn't seem to work on Linux
to get generate a signal when an event on the GPIO fd occurs.

So fall back to the same method as on OS X and call poll() in
a child process.
2020-07-21 11:50:18 +02:00
a274ea45fc cpu/native: async_read: rewrite select() call to poll()
select() can not listen to POLLPRI events which are used by the
Kernel's GPIO API.

In preparation for that, rewrite async_read() to use poll() instead
of select().
2020-07-21 11:50:18 +02:00
0eb66a429f
cortexm_common: Clear PendSV request after idle sleep
The PendSV interrupt is used to request a scheduling operation. An
interrupt during the idle sleep can re-request the PendSV interrupt,
while the PendSV is still busy scheduling the next thread. This clears
the request after sleep to prevent triggering an extra PendSV interrupt
after the current PendSV handler finished.
2020-07-21 11:23:49 +02:00
f013be5507
Merge pull request #14497 from aabadie/pr/drivers/makefile_dep_cleanup
drivers/Makefile.dep: remove inappropriate use of FEATURES_PROVIDED for rtt_rtc
2020-07-20 13:04:59 +02:00
Leandro Lanzieri
64f75bcc30
cpu/saml21: Add Kconfig symbols 2020-07-16 21:29:46 +02:00
4da79fa0ca
Merge pull request #14471 from leandrolanzieri/pr/kconfig/lpc2387_boards_symbols
boards/lpc2387-based: Model features in Kconfig
2020-07-16 21:25:00 +02:00
3b778451e1
Merge pull request #14485 from leandrolanzieri/pr/kconfig/saml1x_based_symbols
boards/saml1x-based: Model features in Kconfig
2020-07-16 21:04:22 +02:00
Leandro Lanzieri
110793be0c
cpu/lpc23xx: Add Kconfig symbols 2020-07-16 19:03:38 +02:00
Leandro Lanzieri
c71c2b79a7
cpu/arm7_common: Add Kconfig symbols
HAS_ARCH_ARM features now is moved to Kconfig.features as it is being
used by multiple architectures.
2020-07-16 19:03:38 +02:00
a20d663086
Merge pull request #14470 from leandrolanzieri/pr/kconfig/lpc1768_boards_symbols
boards/lpc1768-based: Model features in Kconfig
2020-07-16 18:59:55 +02:00
d0fb8d727a
Merge pull request #14539 from aabadie/pr/cpu/lpc2387_rename
cpu/lpc2387: rename to lpc23xx
2020-07-16 18:38:47 +02:00
Leandro Lanzieri
38636a8089
cpu/saml1x: Add Kconfig symbols 2020-07-16 18:09:59 +02:00
Leandro Lanzieri
84de2d8f7b
cpu/saml1x: Specify CPU_FAM only in Makefile.features 2020-07-16 18:09:58 +02:00
e246e7ed2a
Merge pull request #14538 from leandrolanzieri/pr/kconfig/native_symbols
boards/native: Model features in Kconfig
2020-07-16 18:04:42 +02:00
dea506a719
cpu/stm32wb: define missing IMR bit in CMSIS 2020-07-16 17:35:50 +02:00
1a095b36fa
cpu/stm32: adapt UART driver for stm32l4r5 cpu line 2020-07-16 17:35:49 +02:00
8e87dedbce
cpu/stm32: remove not needed CMSIS vendor headers 2020-07-16 17:35:49 +02:00
f21440b176
cpu/stm32: use CMSIS headers from the stm32cmsis package 2020-07-16 17:35:48 +02:00
1f0a3a6bae
cpu/cortexm_common: add special case for SVC interrupt configuration
by default stm32f0/l0/l1 families simply call the interrupt enum SVC_IRQn
2020-07-16 17:35:48 +02:00
def5f80998
Merge pull request #14477 from leandrolanzieri/pr/kconfig/sam3_boards_symbols
boards/sam3-based: Model features in Kconfig
2020-07-16 17:07:03 +02:00
0a699e87c7
cpu/lpc23xx: rename remaining occurrences of lpc2387 2020-07-16 17:01:10 +02:00
46a053e674
cpu/lpc23xx: rename Doxygen group 2020-07-16 17:01:10 +02:00
829b16b472
cpu/lpc23xx: rename lpc2387 to lpc23xx 2020-07-16 17:01:10 +02:00
a4129d0f8f
Merge pull request #14483 from leandrolanzieri/pr/kconfig/samd5x_based_symbols
boards/same54-xpro: Model features in Kconfig
2020-07-16 16:38:21 +02:00
Leandro Lanzieri
8e5c0f3f84
cpu/lpc1768: Add Kconfig symbols
Also specify CPU_FAM in Makefile.features
2020-07-16 15:39:02 +02:00
Leandro Lanzieri
44be83e4bb
cpu/sam3: Add Kconfig symbols 2020-07-16 15:35:23 +02:00
Martine Lenders
ea8e867611
Merge pull request #14534 from bergzand/pr/cortexm/irq_during_idle
cortexm_common: disable IRQ during thread_sched_idle
2020-07-16 15:35:14 +02:00
Leandro Lanzieri
1c9a95e955
cpu/samd5x: Add Kconfig symbols 2020-07-16 15:33:29 +02:00
15110af51c
Merge pull request #14475 from leandrolanzieri/pr/kconfig/mips32r2_boards_symbols
boards/mips32r2-based: Model features in Kconfig
2020-07-16 15:14:29 +02:00
Benjamin Valentin
f53ae74269 cpu/kinetis: set CPU_HAS_BITBAND 2020-07-16 14:44:28 +02:00
Benjamin Valentin
8f36c88b93 cpu/stm32: set CPU_HAS_BITBAND 2020-07-16 14:44:28 +02:00
Benjamin Valentin
b716419462 cpu/efm32: set CPU_HAS_BITBAND 2020-07-16 14:44:28 +02:00
Benjamin Valentin
95ec5890b0 cortexm_common: fix bit-banding check
Not all MCUs ≥ Cortex-M3 provide the Bit-Banding feature.
It is up to the manufacturer to implement it.

Instead, rely on the CPU_HAS_BITBAND being set in `periph_cpu.h`.
2020-07-16 14:44:28 +02:00
Leandro Lanzieri
64970ab131
cpu/native: Add Kconfig symbols 2020-07-16 13:53:45 +02:00
Leandro Lanzieri
52b31b5fce
cpu/lm4f120: Add Kconfig symbols
Also specify CPU_FAM in Makefile.features
2020-07-16 13:23:30 +02:00
Leandro Lanzieri
710c21805d
cpu/mips_pic32mz: Add Kconfig symbols 2020-07-16 13:20:05 +02:00
Leandro Lanzieri
6091c31bd6
cpu/mips_pic32mx: Add Kconfig symbols 2020-07-16 13:20:05 +02:00
Leandro Lanzieri
c1b25655fd
cpu/mips_pic32_common: Add Kconfig symbols 2020-07-16 13:20:04 +02:00
Leandro Lanzieri
ea3166e08e
cpu/mips32r2_common: Add Kconfig symbols
Also this moves the specification of CPU_ARCH to the common folder
2020-07-16 13:20:01 +02:00
8046a74e50
cpu/stm32: model features in Kconfig 2020-07-16 11:34:02 +02:00
055c43c878
cpu/stm32: enable flashpage feature for stm32f031k6 2020-07-16 11:15:30 +02:00
eec7aa2e42
cortexm_common: disable IRQ during thread_sched_idle
A race condition is present where an IRQ is serviced between the
priority increase of the PENDSV and the sleep. When the IRQ
is serviced before the WFI sleep, the core will sleep until the next
IRQ and the thread activated by the IRQ will not be scheduled until
a new IRQ triggers.

This commit wraps an IRQ disable and restore around the priority
modification and sleep to prevent interrupts from being serviced until
the WFI call returns.
2020-07-16 11:11:15 +02:00
Leandro Lanzieri
6a9c28aa72
cpu/nrf52: Add Kconfig symbols 2020-07-16 10:23:49 +02:00
Leandro Lanzieri
83252e8f0d
cpu/nrf51: Add Kconfig symbols 2020-07-16 10:23:49 +02:00
Leandro Lanzieri
31b288443a
cpu/nrfx_common: Add Kconfig symbols 2020-07-16 10:23:48 +02:00
7fd25f21c9
Merge pull request #14426 from maribu/stm32f4_uart_init
cpu/stm32: Fix garbage on UART init
2020-07-15 21:14:42 +02:00
Marian Buschsieweke
0ed7ead587
cpu/native: Workaround for libstdcpp for FreeBSD
On FreeBSD, libstdc++ is known to not work with -m32. Thus, we don't provide
it feature libstdcpp there.
2020-07-15 20:29:02 +02:00
Francisco
1167867d02
Merge pull request #14362 from maribu/msp430-irq-inline
cpu/msp430_common: Update to inline-able IRQ API
2020-07-15 15:34:04 +02:00
Marian Buschsieweke
1a8defd209
cpu/msp430_common: Refactor cpu.{c,h}
Drop `__enable_irq()` and `__disable_irq()` and replace single remaining
call of them with the standard IRQ API, as this is now equally fast.
2020-07-15 13:09:11 +02:00
Marian Buschsieweke
aec9eb7f6a
cpu/stm32: Fix uart_init()
- Make use of the fact that gpio_init_af() does not need prior call to
  gpio_init() for all STM32 families anymore and drop call to gpio_init()
- Initialize the UART periph first, before initializing the pins
    - While uninitialized, the UART periph will send signal LOW to TXD. This
      results in a start bit being picked up by the other side.
    - Instead, we do not connect the UART periph to the pins until it is
      initialized, so that the TXD level will already be HIGH when the pins
      are attached.
    - This results in no more garbage being send during initialization
2020-07-15 12:12:46 +02:00
Marian Buschsieweke
73c9161517
cpu/stm32: Fix gpio_init() / gpio_int_af()
- Do not set an intermediate mode, prepare correct mode settings in a temporary
  variable
- Consistently enabled the GPIO periph in gpio_init_af()
    - Previously, STM32 F1 did not require a separate call to gpio_init() prior
      to a call of gpio_init_af(), but other STM32 families did
    - Now, gpio_init_af() can be used without gpio_init() consistently
- STM32 F1: Do not touch ODR for non input pins
    - For input pins, this enables / disabled pull up resistors. For outputs,
      this register should remain untouched (according to API doc)
2020-07-15 12:12:45 +02:00
Marian Buschsieweke
cf482c5d46
build system: Add libstdcpp feature and doc
- Add libstdcpp feature to indicate a platform is providing a libstdc++
  implementation ready for use
- The existing cpp feature now only indicates a working C++ toolchain without
  libstdc++. (E.g. still useful for the Arduino compatibility layer.)
- Added libstdcpp as required feature were needed
- Added some documentation on C++ on RIOT
2020-07-15 11:45:22 +02:00
Marian Buschsieweke
91a294aa45
cpu/cortexm_common: Drop LTO workaround for Cortex M thread_arch.c
The `ldr    r1, =sched_active_thread` instruction couldn't be assembled with
LTO, as the no immediate offset could be found to construct the address of
`sched_active_thread`. This commit instructs the assembler to generate a
literate pool which can be used to construct the address. While this issue
was only triggered during LTO, it theoretically could also pop up without LTO
due to unrelated changes. Thus, it is a good idea to create the literate pool
even without LTO enabled.
2020-07-15 10:37:15 +02:00
Marian Buschsieweke
0feebcb094
cpu/cortexm_common: Drop #7776's LTO workaround
The workaround from #7776 is no longer needed with recent toolchains, e.g. such
as the toolchain in the riot/riotbuild docker image.
2020-07-15 10:37:15 +02:00
Benjamin Valentin
48340f971f cpu/sam0_common: flashpage: clean up helper function 2020-07-14 20:50:50 +02:00
hugues
0926a04b08 cpu/stm32/periph/pwm: useless static var and a semicolon removed 2020-07-14 01:41:16 +02:00
Thomas Stilwell
754d790b3f boards: efm32 boards: add support for LETIMER 2020-07-10 20:44:03 -05:00
Thomas Stilwell
37a6cc66f5 cpu/efm32/timer: add pm blockers 2020-07-10 20:44:03 -05:00
Thomas Stilwell
651a3bf423 cpu/efm32/timer: add support for LETIMER 2020-07-10 20:44:03 -05:00
988638715f
cpu/nrf5x_common: remove inappropriate rtc dependency resolution 2020-07-10 21:58:03 +02:00
Gilles DOFFE
892370121d
cpu/stm32/qdec: test null callback pointer (#14125)
cpu/stm32/qdec: test if callback pointer is set

Callback pointer is not tested and could result in a hard fault
if the pointer is NULL.
Thus only activate interrupt if a callback provided.

Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
2020-07-10 15:05:53 +02:00
hugues
304d3f9e8d cpu/stm32/periph/pwm: some bugfixes... 2020-07-10 13:47:45 +02:00
hugues
d069c6e787 cpu/stm32/periph/pwm: CCMR1 was defined a second time instead of CCMR2 2020-07-10 13:47:45 +02:00
hugues
a5da5953b2 cpu/stm32/periph/pwm: multiple devices PWM_RIGHT mode bugfix 2020-07-10 13:47:09 +02:00
Gunar Schorcht
fb47f094d3 cpu/esp32: support multiple heaps for newlib
Several unsused DRAM sections are added to the heap.
2020-07-10 08:42:12 +02:00
hugues
16e454ccaf cpu/stm32/periph/pwm: some bugfixes... 2020-07-09 23:49:00 +02:00
benpicco
30ebabb84e
Merge pull request #14007 from benpicco/cpu/sam0_common-pwm
cpu/sam0_common: move PWM to common code, add support for saml21, samd5x
2020-07-09 10:01:08 +02:00
Bas Stottelaar
1d97783175 cpu/efm32: DCDC is available on Series 2 as well 2020-07-08 21:54:57 +02:00
Bas Stottelaar
1105f60a23 cpu/efm32: make series defines explicit
The EFM32 uses the provided _SILICON_LABS_32B_SERIES_0 and
_SILICON_LABS_32B_SERIES_1 definitions to enable or disable certain
code. With the introduction of new MCUs, there is also the
_SILICON_LABS_32B_SERIES_2 definition.

This PR ensures that the defines are explicit, and that #else
statements don't target the wrong series.
2020-07-08 21:54:57 +02:00
Benjamin Valentin
bce7d25f10 cpu/sam0_common: add PWM support for saml2x, samd5x 2020-07-08 21:51:12 +02:00
benpicco
63a0014456
Merge pull request #14467 from benpicco/fix_file_permission
treewide: fix file permissions
2020-07-08 18:30:01 +02:00
Benjamin Valentin
9d836888c2 treewide: fix file permissions
C files should not be executable.
2020-07-08 17:32:36 +02:00
benpicco
99553e882c
Merge pull request #14461 from hugueslarrive/iss14361
Fix bad assertion in cpu/stm32/periph/pwm.c
2020-07-08 16:42:08 +02:00
hugues
11e847c9af cpu/stm32: fix off-by-one error in clock frequency assert 2020-07-08 14:17:14 +02:00
d02d54b76a
Merge pull request #14455 from benpicco/fe310-heap_markers
cpu/fe310: use common names for heap markers
2020-07-08 14:14:38 +02:00
Benjamin Valentin
0ddca68de9 cpu/fe310: use common names for heap markers
Other archs use `_sheap` and `_eheap` to mark the start and end of
the heap.

fe310 uses `_heap_start` and `_heap_end`, so platform independent
code that wants to make use of this will needlessly fail.

For compatibility with common code, name them the same on fe310.
2020-07-07 17:25:00 +02:00
Leandro Lanzieri
7a2e4c819d
cpu/esp8266: Add Kconfig symbols 2020-07-07 16:27:43 +02:00
Leandro Lanzieri
0b0a03bef9
cpu/esp32: Add Kconfig symbols 2020-07-07 16:27:35 +02:00
Leandro Lanzieri
e6b698c69b
cpu/esp_common: Add Kconfig symbols 2020-07-07 16:27:34 +02:00
Jean Pierre Dudey
3003cf737a
boards/common/esp32: move ESP features to cpu/esp_common
>All of them are features of each ESP SoC and have not to be configured by the
board definition.

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2020-07-07 16:02:23 +02:00
Martine Lenders
60469026cf
Merge pull request #14434 from maribu/irq_cleanup
cpu/cortexm_common: Fix cpu_switch_context_exit()
2020-07-04 11:42:54 +02:00
Marian Buschsieweke
056100c1ca
cpu/cortexm_common: Fix cpu_switch_context_exit()
- Use `irq_enable()` over `bl irq_enable`, as `irq_enable()` is an inline
  function and not a C function any more
- Drop `__attribute__((naked))` qualifier
    - It must be used with the declaration of the function, but there it is
      missing. (And it cannot be added there, as this function would need to
      be implemented as "naked" by every platform; which is impossible for
      platforms not supporting `__attribute__((naked))`.)
    - Only functions consisting completely of basic asm may be marked as naked.
      But both the assembly used to trigger the SVC interrupt as well as the
      assembly used in `irq_enable()` are extended asm, not basic asm
- Use ` UNREACHABLE();` over a custom asm construct
2020-07-03 12:48:42 +02:00
Leandro Lanzieri
215e77f2ad
cpu/kinetis: Add Kconfig symbols 2020-07-02 14:41:41 +02:00
Leandro Lanzieri
6ea04d146b
cpu/kinetis: Provide features based on CPU series
Also, rename CPU_FAMILY to the standard CPU_FAM.
2020-07-02 14:41:39 +02:00
Francisco
772b638d2a
Merge pull request #14405 from aabadie/pr/cpu/mips_no_binfile
cpu/mips: disable BINFILE generation
2020-07-01 10:21:41 +02:00
Francisco
41888674a4
Merge pull request #14385 from aabadie/pr/make/appdeps_export
boards/mips: remove use of APPDEPS, un-export globally APPDEPS
2020-07-01 09:13:35 +02:00
b3e566bcd8
cpu/mips: disable BINFILE generation 2020-07-01 08:08:23 +02:00
Peter Kietzmann
2250c67240
Merge pull request #14388 from leandrolanzieri/pr/kconfig/ezr32wg_board_symbols
boards/slwstk6220a: Model features provided in Kconfig
2020-06-30 18:24:44 +02:00
Francisco
325b7a8d8e
Merge pull request #13631 from benpicco/cpu/sam0_common/spi-deinit
drivers/periph/spi: add periph_spi_reconfigure feature & implementation for sam0
2020-06-30 15:34:53 +02:00
Gunar Schorcht
028c0d4b3c
Merge pull request #14353 from fjmolinas/pr_reorder_makefiles_cleanup
Makefile: use normal conditionals
2020-06-30 09:59:02 +02:00
Francisco Molina
e98341da93
Makefile: use normal conditionals 2020-06-29 22:40:29 +02:00