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

4686 Commits

Author SHA1 Message Date
a5c594ae5f
nrfusb: Check chip revision before enabling
Engineering sample A doesn't have a functional USB peripheral (errata
issue 94). This commit adds an assertion check for this revision to
prevent some developer headaches.
2019-09-06 10:00:32 +02:00
benpicco
999fffdc59
Merge pull request #11997 from gschorcht/cpu/esp32/esp_wifi/cleanups
cpu/esp32: esp_wifi improvements and cleanups
2019-09-05 13:51:10 +02:00
Gunar Schorcht
b3737715e5
Merge pull request #12170 from benpicco/esp32-fix_doc
cpu/esp32: fix documentation about toolchain installation
2019-09-05 12:58:32 +02:00
Gunar Schorcht
6d77529c83 cpu/esp32: cleaning up left overs in esp_wifi 2019-09-05 12:49:43 +02:00
Gunar Schorcht
3d5ef14650 cpu/esp32: local buffer in send of esp_wifi
Instead of having a send buffer as member `esp_wifi` netdev, a local variable is used now as send buffer. This avoids the need for a locking mechanism and reduces the risk of deadlocks.
2019-09-05 12:49:43 +02:00
Gunar Schorcht
74cbc410b7 cpu/esp32: ringbuffer introduced in esp_wifi
Receive call back function `_esp_wifi_rx_cb` is called from WiFi hardware driver with a pointer to a frame buffer that is allocated in the WiFi hardware driver. This frame buffer was freed immediately after copying its content to a single local receive buffer of the `esp_wifi` netdev. The local receive buffer remained occupied until the protocol stack had processed it. Further incoming packets were dropped.  However, very often a number of subsequent WiFi frames are received at the same time before the first one is processed completely. Having the single local receive buffer to hold only one received frame, led to a number of lost packets, even at low network load. Therefore, a ringbuffer of rx_buf elements was introduced which doesn't store the frames directly but only references to the frame buffers allocated in WiFi hardware driver. Since there is enough memory to hold several frames, the frames buffers allocated in WiFi hardware driver aren't freed immediatly any longer but are kept until the frame is processed by the protocol stack. This results in a much less loss rate of packets.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
0e4ab63735 cpu/esp32: uniform debug output in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
1ed09492a4 cpu/esp32: param checks replaced by asserts in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
28ce17e64c cpu/esp32: event handling changed in esp_wifi
Events of different type can be pending at the same time. Therefore it is not possible to use ascending identifiers for the presence of a pending event. Rather, each event type has to be represented by one bit. Thes bits ORed identify all types of pending events. In the esp_wifi_isr function all pending events are then handled in one call. Otherwise, some events might be lost.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
5cc990fb7c cpu/esp32: cleanup of includes in esp_wifi 2019-09-05 12:49:02 +02:00
benpicco
dbd97b7588
Merge pull request #11947 from gschorcht/cpu/esp32/freertos-critcial-sections
cpu/esp32: critcial section handling changed in FreeRTOS adaptation layer
2019-09-05 12:40:45 +02:00
Sebastian Meiling
c4dbdb7626
Merge pull request #12134 from gschorcht/cpu/esp/fix_i2c_ack_err_errno
cpu/esp*: fix of the error code for I2C address ACK errors
2019-09-05 12:23:24 +03:00
Gunar Schorcht
cb8b1b12c1 cpu/esp32: fix errno for I2C addr ack error
fixup! cpu/esp32: fix errno for I2C addr ack error
2019-09-05 10:35:02 +02:00
Gunar Schorcht
dfef2ce638 cpu/fe310: changes for common heap command 2019-09-05 09:20:55 +02:00
Gunar Schorcht
a9db53e04a cpu/msp430_common: changes for heap command 2019-09-05 09:20:55 +02:00
Gunar Schorcht
a63c0dda9c cpu/mips32r2_common: changes for heap command 2019-09-05 09:20:55 +02:00
Gunar Schorcht
4b009649c6 cpu/atmega_common: changes for common heap command 2019-09-05 09:20:55 +02:00
Gunar Schorcht
e9e6b7f31a cpu/esp32: changes for common heap command 2019-09-05 09:20:55 +02:00
Gunar Schorcht
056a223c33 cpu/esp8266: changes for common heap command 2019-09-05 09:20:55 +02:00
Benjamin Valentin
7fc7272394 cpu/esp32: fix documentation about toolchain installation
Checking out the submodules first and then the commit makes a mess.
Doing it the other way round results in a working toolchain.
2019-09-05 01:01:09 +02:00
Gaëtan Harter
422644bd3a
cpu/esp8266: update deprecated flash_size argument
Using flash size in megabits is deprecated by esptool.
Use the new megabyte notation.

    WARNING: Flash size arguments in megabits like '8m' are deprecated.
    Please use the equivalent size '1MB'.
    Megabit arguments may be removed in a future release.
    esptool.py v2.6
2019-09-04 15:07:37 +02:00
Gunar Schorcht
37ecb4fc5d cpu/esp8266: periph/uart FIFO resized to 1 byte
UART FIFO must contain only 1 byte when newlib's `printf` function is used. Otherwise, outputs that are still not sent over UART are lost when `printf` is called asynchronousely.
2019-09-04 14:58:59 +02:00
Gunar Schorcht
7fe1056aa7 cpu/esp8266: enable newlib with nano-formatted-io 2019-09-04 14:41:31 +02:00
Gunar Schorcht
646a173738 cpu/esp8266: fix unresolved symbols
To avoid unresolved symbols for unused functions during linking, compiler option `-ffunction-sections` is used now. Linker option `--warn-unresolved-symbols` is removed to get errors if required symbols cannot be resolved.
2019-09-04 14:41:31 +02:00
Gunar Schorcht
69a5cc753d cpu/esp8266: use always newlib stdio functions
The modules `newlib, `newlib_syscalls_default` and `stdio_uart` are now used by default for output to the UART interface. This also reduces the dependency rules.
2019-09-04 14:41:31 +02:00
Gunar Schorcht
ae8afaf42e cpu/esp8266: remove overridden stdio functions
The overridden stdio functions `puts`, `putchar` and `printf` were removed. Instead, the corresponding newlib functions are always used. Using the newlib functions fixes output conflicts when using `f *` functions like `fprintf`,` fputs`, ... with `stdout` as the file parameter.
2019-09-04 14:41:31 +02:00
Gunar Schorcht
98dfdef276
Merge pull request #12135 from benpicco/libb2-fix
pkg/libb2: rename config.h to avoid conflicts in the global namespace, set HAVE_ALIGNED_ACCESS_REQUIRED based on CPU (fixes build on esp8266)
2019-09-04 14:39:07 +02:00
Benjamin Valentin
7047a200af cpu/native: advertise support for unaligned memory access
On Linux, even if the architecture does not support it, the kernel will
catch the fault and emulate the unaligned accesss.
2019-09-04 14:15:52 +02:00
benpicco
1ffe2e5e30
Merge pull request #11512 from skullbox305/cpu-nrf5x
cpu/nrf52: i2c bugfix
2019-09-03 18:43:38 +02:00
Juan Carrano
63c475cd4d toolchain/cflags: enable dwarf compression.
Use the -gz option to compress ELF sections containing DWARF information.
This saves around 50% of disk space, without any side effects.

See https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Debugging-Options.html#Debugging-Options
for more infomation on this option.

Some platforms have an outdated toolchain that does not support -gz so
the flag is blacklisted there. Even then, the results are quite impressive.

I used @cladmi's `buildtest` branch (https://github.com/cladmi/RIOT/tree/wip/du/buildtest)
with this change and compiled the `examples/default` application:

```
$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" make -C examples/default buildtest-indocker
```

The size was obtained with:

```
$ find output -name "*.bin.bindirsize" -type f -exec tail  -n1 '{}' \; | cut -f 1 | awk '{s+=$1} END {printf "%.0f", s}'
```

Results:

- Vanilla: 10328112 KB (~10GB).
- with -gz: 4982788 KB (~5GB).

This was inspired by #8496.
2019-09-02 14:43:26 +02:00
Gunar Schorcht
8c8306e1ca cpu/esp8266: fix errno for I2C addr ack error 2019-08-31 12:09:09 +02:00
benpicco
2101458900
Merge pull request #11911 from maribu/arm7_common-irq
cpu/arm7_common: Cleaned up IRQ code
2019-08-30 19:17:09 +02:00
Toon Stegen
95b61a1970 cpu/stm32_common/uart: fix typos in rts/cts pins 2019-08-30 14:17:14 +02:00
Gaëtan Harter
e4331e8391
cpu/arch: blacklist incompatible CFLAGS
Blacklist incompatible CFLAGS that are currently "optionally" included
in 'cflags.inc.mk'.

This prepares for the migration to 'OPTIONAL_CFLAGS'.
2019-08-29 17:43:54 +02:00
Benjamin Valentin
ba8dfc8341 cpu/sam0_common/gpio: don't hard-code number of ports
_exti() always assumes only 2 ports, so it will always fail when using
e.g. port C or port D on same54.

Instead, determine the number of ports from the dimensions of the exti_config
array.
2019-08-29 15:27:42 +02:00
Martine Lenders
92a8e5d0ee
nrfmin_gnrc: use gnrc_netif_hdr_set_netif() 2019-08-29 14:51:44 +02:00
Kevin "Tristate Tom" Weiss
969e3b3e95
Merge pull request #12098 from cladmi/pr/export/remove_local_export_compilation_variables
make: do not locally export compilation variables
2019-08-29 14:32:22 +02:00
Martine Lenders
b83c7dd61d
Merge pull request #11927 from maribu/arduino-leonardo
cpu/atmega32u4: Fixed external interrupts; boards/arduino-leonardo: Fixed dependency tracking
2019-08-29 12:12:56 +02:00
Gaëtan Harter
1be5b7b10b
cpu: do not locally export compilation variables
These are already exported by `makefiles/vars.inc.mk`.
It is a prerequisite to allow handling compilation without global exports.
2019-08-29 10:35:53 +02:00
Sören Tempel
0e724e3d5d cpu/fe310: don't call thread_yield when sched_active_thread is invalid
As the comment above cpu_switch_context_exit notes:

	sched_active_thread is not valid when cpu_switch_context_exit() is called.

Unfortunately, thread_yield(), which is called directly by
cpu_switch_context_exit(), uses sched_active_thread possibly resulting
in a null pointer dereference.

Solution: Trigger a software interrupt to perform a context switch and
let sched_run() determine the next valid thread from there.
2019-08-28 18:09:05 +02:00
Toon Stegen
3f74a8a7b4 cpu/stm32_common/uart: init rts at right time
once hardware flow control is enabled, rts should only be initialized
after the uart is enabled by setting the UE flag. This is stated in the
stm32f4 errata.
2019-08-27 19:15:47 +02:00
Toon Stegen
ac1d1ffda2 cpu/stm32_common: enable/disable uart peripheral
in uart_poweroff the peripheral should be disabled through the register
instead of just disabling the peripheral clock. In uart_poweron the
peripheral should be enabled after enabling the clock.

Not explicitely disabling the peripheral causes some bad signals on the
uart line sometimes.
2019-08-27 19:09:36 +02:00
Gaëtan Harter
3010d1cef4
cpu/arm7_common: remove deprecated CFLAGS_BASIC
Nothing declares this anymore
2019-08-27 17:06:52 +02:00
Marian Buschsieweke
1a51b01db9
cpu/cc2538/periph/i2c: Made cppcheck happy 2019-08-27 13:59:23 +02:00
Juan I Carrano
5ece3dc323
Merge pull request #12050 from gschorcht/cpu/esp32/fix_ctor_initialization
cpu/esp32: fix of global ctor initialization
2019-08-27 11:38:00 +02:00
Gunar Schorcht
7b160a7dd3 cpu/esp32: workaround for static object init 2019-08-27 09:41:41 +02:00
Marian Buschsieweke
dd56b3bb71
cpu/sam0_common: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
b604934189
cpu/stm32_common: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
0863410c09
cpu/nrf52: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
01f77433a8
cpu/nrf51: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
a4810f3276
cpu/esp32: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
cc0fb9836e
cpu/cc26x0: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
530cf801fe
cpu/esp8266: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
6b7d27ece9
cpu/kinetis: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Marian Buschsieweke
6917934946
cpu/cc2538: Updated i2c_release() 2019-08-22 12:03:07 +02:00
Marian Buschsieweke
450b251823
cpu/efm32: Updated i2c_release() 2019-08-22 12:03:07 +02:00
Marian Buschsieweke
454d25ae68
cpu/atmega_common: Updated i2c_release() 2019-08-22 12:03:07 +02:00
Gunar Schorcht
328813ce12 cpu/esp32: fix of ctor and newlib initialization
Module `newlib` is now used by default. Therefore, the separation of initialization of ctors and the newlibc is not needed any longer. Instead of calling `do_global_ctors` and `_init` separately, `__libc_init_array` is called. Explicit function `do_global_ctors` is removed.
2019-08-21 16:31:06 +02:00
Gunar Schorcht
5fc015e31b cpu/esp32: fix periph_flash param checks for mtd 2019-08-21 01:16:47 +02:00
Peter Kietzmann
f0272ed262
Merge pull request #12005 from haukepetersen/fix_nrfmin_doc
cpu/nrf5x: fix bitrate doc for nrfmin driver
2019-08-20 08:31:29 +02:00
Gunar Schorcht
c6d33cf5de cpu/esp32: erase improvement for periph_flash
Performance of erasing the whole flash is drastically improved by erasing blocks of 64 kbyte, if possible, instead of erasing sectors of 4 kByte.
2019-08-20 01:56:38 +02:00
Gunar Schorcht
1c60e175ca cpu/esp32: fix periph_flash timing problems
While deleting multiple sectors in flash, interrupts were disabled over the whole time. Thus, deleting the entire flash led to the triggering of the watchdog timer and thus to a restart. Therefore, the interrupts and the cache are disabled only for the time of deleting a single sector. The same problem occurred for read and write large data sets.
2019-08-20 01:51:05 +02:00
Gunar Schorcht
bf331bd54b cpu/esp32: use printf/puts from newlib
Initializing the stdio file descriptors in global reent structure with newlib fake stdio file descriptors led to the problem that newlib stdio functions printf and puts were not working since they can't operate on these fake stdio file descriptors. Therefore, this initialization was removed. Now, the real stdio file descriptors as created automatically by newlib are used. Specific functions `printf`, `puts`, `getchar`and `putchar` are not required any longer and are removed now.
2019-08-19 15:14:32 +02:00
Gunar Schorcht
87cd181f56 cpu/esp32: use always newlib_syscalls_default
Modules newlib and newlib_syscalls_default are now used by default. Conditional compilations for MODULE_NEWLIB_SYSCALLS_DEFAULT as well as alternative code are removed completely.
2019-08-19 15:13:53 +02:00
Gunar Schorcht
6a378f71a0 cpu/esp32: fixes printf and puts
printf and puts used ets_printf before. Unfortunately, ets_printf adds an additional \r for each \n which is not consistent with other RIOT platforms. As a result some automatic tests failed. Therefore, both functions write now character-wise directly to the UART interface.
2019-08-17 11:34:20 +02:00
MrKevinWeiss
b0c05431f7 cpu/stm32: Fix 16 bit reg endianess for i2c_1
Since i2c_1 i2c_write_regs is cpu specific reg endianess must be swapped there
Change reg from little endian to big endian
2019-08-16 15:04:13 +02:00
MrKevinWeiss
fb38cf37fd cpu/stm32: Fix read bytes flag for i2c_2
This commit stops a repeated start read which causes slave bus lockup
When trying to do a repeaded start i2c_read_bytes it returns -EOPNOTSUPP error
2019-08-14 16:32:28 +02:00
Hauke Petersen
cc5f2cae20 cpu/nrf5x: fix bitrate doc for nrfmin driver 2019-08-14 11:15:08 +02:00
Gunar Schorcht
f52162bcb0 cpu/atmega_common: wrappers to avoid preemtion
Memory management function like `malloc`, `calloc`, `realloc` and `free` must not be preempted when they operate on allocator structures. To avoid such a preemption, wrappers around these functions are used which simply disable all interrupts for the time of their execution.
2019-08-12 23:22:23 +02:00
Gunar Schorcht
8c5de9b714 cpu/esp32: module riot_freertos is always required 2019-08-12 16:51:50 +02:00
Gunar Schorcht
d2de4858e2 cpu/esp32: compile riot_freertos only if required 2019-08-12 16:51:50 +02:00
Gunar Schorcht
1b041083ab cpu/esp32: change of critical section handling in freertos
Using a mutex for critical section handling with portENTER_CRITICAL and portEXIT_CRITICAL does not work for RIOT, as this function can also be called in the interrupt context. Therefore, the given mutex is not used. Instead, the basic default FreeRTOS mechanism for critical sections is used by simply disabling interrupts. Since context switches for the ESP32 are also based on interrupts, there is no possibility that another thread will enter the critical section once the interrupts are disabled.
2019-08-12 16:51:50 +02:00
Gunar Schorcht
26b71a3f14 cpu/esp32: removes additional spaces in freertos 2019-08-12 16:51:50 +02:00
fabian18
2c001f5a6c drivers/include/periph/eeprom: Changed uint8_t* to void* in API 2019-08-09 17:27:32 +02:00
Juan I Carrano
e806d4bcbd
Merge pull request #11985 from fjmolinas/pr_k64f_hwrng
cpu/kinetis: enable HWRNG for k64f
2019-08-09 16:45:52 +02:00
Francisco Molina
0ce2081817 cpu/kinetis: re-enable HWRNG for k64f
- Fix SCGx used for RNGA since RNGA is not mapped
  to SCG3 for K64F.
2019-08-09 15:47:13 +02:00
9cf8da0287
Merge pull request #11899 from fjmolinas/pr_stm32f7_riotboot_requirements
cpu/stm32f7: add riotboot requirements
2019-08-09 15:36:50 +02:00
6f14de38c5
Merge pull request #11900 from fjmolinas/pr_stm32f2_riotboot_requirements
cpu/stm32f2: add riotboot requirements
2019-08-09 11:06:49 +02:00
1f5761ccfa
cpu/stm32l4: add support for stm32l496ag 2019-08-08 22:20:22 +02:00
2ef1a86722
cpu/stm32l4: add missing PORT_I enum 2019-08-08 22:20:21 +02:00
Martine Lenders
3bfa03dcc9
Merge pull request #11981 from aabadie/pr/cpu/atmega_common_array_size
cpu/atmega_common/gpio: use ARRAY_SIZE macro
2019-08-08 19:13:05 +02:00
f802bbb5ae
Merge pull request #11682 from fjmolinas/pr_stm32f4_riotboot
cpu/stm32f4: add riotboot requirements
2019-08-08 18:05:36 +02:00
3e519e164b
cpu/atmega_common/gpio: use ARRAY_SIZE macro 2019-08-08 17:52:51 +02:00
Francisco Molina
dc958b3b38 stm32f7/Makefile.include: add riotboot requirements
- stm32f7 use sectors instead of pages, they go either from 16KB to
  128KB, or from 32KB to 25KB. Smaller sectors are at the begining of
  the flash. Slots must start at the begining of a sector to not overlap.
- Minimum required RIOBOOT_HDR_LEN or stm32f7 is 0x200
  to respect vector table alignment
- Add CPU_FLASH_BASE
2019-08-07 18:37:07 +02:00
Francisco Molina
f5b8355140 stm32f2/Makefile.include: add riotboot requirements
- stm32f2 uses sectors instead of pages, they go from 16KB to
  128KB. Smaller sectors are at the begining of the flash. Slots
  must start at the begining of a sector to not overlap.
- Minimum required RIOBOOT_HDR_LEN or stm32f2 is 0x200
  to respect vector table alignment
2019-08-07 18:34:48 +02:00
fjmolinas
c67dfd9918 stm32f4/Makefile.include: add riotboot requirements
- Stm32f4 use sectors instead of pages. They go from 16 KB to 128KB.
  The bootloader will use the first sector(16Kb). Slots must start
  at the begining of a sector to not overlap.
- Minimum required RIOBOOT_HDR_LEN or stm32f4 is 0x200
  to respect vector table alignment
2019-08-07 18:29:51 +02:00
Peter Kietzmann
1e7a468ecb
Merge pull request #11972 from dylad/pr/saml1x/fix_adc
cpu/saml1x: fix adc resolution issue
2019-08-07 14:06:40 +02:00
a6685b0b48
Merge pull request #11956 from fjmolinas/pr_nrf5x_flashpage_raw
cpu/nrf5x_common: add flashpage_raw_support
2019-08-07 09:23:57 +02:00
Martine Lenders
1dc6bded04
Merge pull request #11946 from gschorcht/cpu/esp32/lwip_netdev
cpu/esp32: lwIP netdev
2019-08-07 08:10:03 +02:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Benjamin Valentin
8af04cd939 boards: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Gunar Schorcht
73552b2c11 cpu/esp32: _esp_wifi_dev exposed for lwIP
To be able to access the single esp_wifi network device from lwIP adaptation layer, static keyword was removed from esp_wifi_dev variable.
2019-08-06 19:12:29 +02:00
Gunar Schorcht
33a6f42fa5 cpu/esp32: lwIP Ethernet address option length
The option value length of Ethernet addresses can be more than 6 byte in lwIP. Therefore, the max_len parameter is check to be greater than or equal to ETHERNET_ADDR_LEN.
2019-08-06 19:12:29 +02:00
MichelRottleuthner
900fdcf783
Merge pull request #11971 from gschorcht/cpu/esp32/make/fix-conditional-linker-options
cpu/esp32: fix of conditional linker options for esp_idf_heap
2019-08-06 19:11:10 +02:00
dylad
f92eb109e7 cpu/saml1x: fix adc resolution issue 2019-08-06 19:08:39 +02:00
Gunar Schorcht
b2b17c5912 cpu/esp32: fix conditional linker options for esp_idf_heap
Module esp_idf_heap is enabled in cpu/esp32/Makefile.dep depending on other modules. Since cpu/esp32/Makefile.dep is read after cpu/esp32/Makefile.include, the conditional  definition of the linker options for the wrapper functions had to be moved from cpu/esp32/Makefile.include to cpu/esp32/Makefile.dep.
2019-08-06 18:17:59 +02:00
653c23ea31
Merge pull request #11963 from fjmolinas/pr_efm32_flashpage_raw
cpu/efm32: add flashpage_raw
2019-08-06 16:29:15 +02:00
MichelRottleuthner
8589382899
Merge pull request #11967 from gschorcht/cpu/esp32/make/fix-undefined-symbols
cpu/esp32: cleanup to fix undefined symbols
2019-08-06 15:36:58 +02:00
Gunar Schorcht
e4198542d1 cpu/esp32: fix multiple definitions with esp_idf_heap
If module esp_idf_heap is used, the memory management functions _malloc_r, _realloc_r, _calloc_r and _free_r have to be overridden by wrapper functions to use the heap_* functions of module _esp_idf_heap. However, this can lead to multiple symbol errors for these functions for some applications. To solve this symbol conflict, _malloc_r, _realloc_r, _calloc_r and _free_r functions are renamed to __wrap_* and the linker options are extended by -Wl,-wrap option when module esp_idf_heap is used.
2019-08-06 14:21:17 +02:00
Martine Lenders
d13d49d11f
Merge pull request #11814 from aabadie/pr/doc/remove_duplicate_group_define
doc: remove duplicate definitions of Doxygen groups
2019-08-06 09:50:59 +02:00
51e40084c1
Merge pull request #11832 from fjmolinas/pr_optimize_pm_stm32l1
cpu/stm32l1: optimize power consumption
2019-08-06 09:34:07 +02:00
Gunar Schorcht
7f30bf2aef cpu/esp32: optimizing compilation of subdirs
A number of subdirectories in cpu/esp32/vendor/esp-idf have to be compiled ony, when according modules are required by the application.
2019-08-06 08:05:28 +02:00
Gunar Schorcht
9e47872a59 cpu/esp32: fix multiple definition of putchar
When standard C libraries are added to BASELIBS to group them together with all other modules, there are multiple definitions for the putchar function. The one that is defined writing to the UART as standard output and the one that is provided by the standard C libraries. To solve this symbol conflict, putchar and getchar functions that use the UART as standard output/input are renamed to __wrap_putchar and __wrap_getchar and the linker options are extended by -Wl,-wrap option.
2019-08-06 08:05:22 +02:00
Gunar Schorcht
4972d5bd67 cpu/esp32: fix pthread_setcancelstate symbol problem
When linking an application, symbol pthread_setcancelstate is not known in standard C libraries, even if the pthread module is linked. This is because the pthread module is grouped with all other modules, but not with the default C libraries when they are added to LINK_FLAGS. Therefore, standard C libraries have to be added also to BASELIBS to group them with all other modules.
2019-08-06 08:05:18 +02:00
Gunar Schorcht
e9ecca2c62 cpu/esp32: fix unknown symbols for unused functions
Fixes the problem that the compilation of an applications can throw unknown symbol errors for functions that aren't use at all. Thus, it is possible to remove the warning for unknown symbols and the compilation can abort if there are real unknown symbols.
2019-08-06 08:04:57 +02:00
MichelRottleuthner
a55e1fcb15
Merge pull request #11964 from gschorcht/cpu/esp32/esp_wifi/fix_send_return_value
cpu/esp32: fix of the return code in esp_wifi_send
2019-08-05 18:50:52 +02:00
fjmolinas
254934dfa6 cpu/nrf5x_common: add flashpage_raw_support 2019-08-05 17:45:14 +02:00
Gunar Schorcht
b571757bcd cpu/esp32: fix of the return code in esp_wifi_send 2019-08-05 17:38:03 +02:00
fjmolinas
e1576c986c cpu/efm32: add flashpage_raw 2019-08-05 17:24:26 +02:00
570f308551
cpu/efm32: deduplicate cpu_efm32 group definition 2019-08-05 16:57:36 +02:00
c2d81fc246
stm32-common/spi: add customizable gpio modes for spi pins 2019-08-05 16:46:41 +02:00
Francisco Molina
3cd72441bd cpu/stm32_common: minimize consumption for STM32L1
- With this PR all GPIOs are set as AIN on start up.

Co-authored-by: Oleg Artamonov <oleg@unwds.com>
2019-08-05 15:40:35 +02:00
d99879eb32
Merge pull request #11489 from fjmolinas/pr-update_stm32l1-cmsis
stm32l1/vendor: update vendor files to v2.3.0
2019-08-05 15:03:09 +02:00
f4d65e10cd
Merge pull request #11897 from fjmolinas/pr_stm32_common_define_alignment
cpu/stm32_common: uniformize define alignments
2019-08-05 11:27:36 +02:00
francisco
e4a49f023e stm321l1/vendor: migrate to new v2.3.0 vendor files
- remove old header files
- fix new DMA header file macro definitions
- remove old cpu type groups (STM32L1XX_MD, STM32L1XX_MDP,
  STM32L1XX_HD, STM32L1XX_XL)
2019-08-05 11:13:08 +02:00
francisco
0adb36e5ef stm32l1/vendor: add v2.3.0 vendor files 2019-08-05 11:13:08 +02:00
Francisco Molina
d075e55bb4 cpu/cortexm_common: replace irq_restore by __set_PRIMASK for stm32l152re
- The __NOP() that was added in #8518 is now remooved.
- When DBG_STANDBY, DBG_STOP or DBG_SLEEP are set in DBG_CR a hardfault
  occurs on wakeup from sleep. This was first diagnosed in #8518. When
  enabled, a hardfault occured when returning from a branch to irq_restore()
  we avoid the call by inlining the function call. See #11830 for more
  details.
2019-08-05 10:40:28 +02:00
Benjamin Valentin
7e5088982b cpu: saml21: don't silently ignore missing makefile
-include will throw no error if sam0_common/Makefile.features does not exist.
This may not have been intentional as none of the other sam0 implementations
do this.

Replace it with a normal include.
2019-08-03 14:50:58 +02:00
Benjamin Valentin
a9b0db3ba4 cpu/sam0_common: add hwrng driver 2019-08-03 14:50:58 +02:00
Marian Buschsieweke
e612d3d71b
Merge pull request #11122 from ibr-cm/hartung/atmega-pin-change-interrupt-pseudomodules
cpu/atmega_common: pseudomodule-based pin change interrupt implementation
2019-08-02 13:41:37 +02:00
Gunar Schorcht
9772562359 cpu/esp32: fix of gpio_read for output ports
Although it isn't explicitly specified in API, gpio_read should return the last written output value for output ports. Since the handling of inputs and outputs is strictly separated by several registers in ESP32, gpio_read returned always the initial value of the input register. Therefore, a case distinction had to make. While for input ports the real value has to be read from the input register, the last written value for the output port has to be read from the output register.
2019-08-01 15:22:02 +02:00
Robert Hartung
c8d460eefe cpu/atmega256rfr2: pin change interrupts 2019-08-01 09:35:35 +02:00
Robert Hartung
57705d4386 cpu/atmega2560: pin change interrupts 2019-08-01 09:35:35 +02:00
Robert Hartung
eeb895fd4e cpu/atmega1284p: pin change interrupts 2019-08-01 09:35:35 +02:00
Robert Hartung
dcd9177271 cpu/atmega32u4: pin change interrupts 2019-08-01 09:23:58 +02:00
Robert Hartung
0fc55cdaf9 cpu/atmega1281: pin change interrupts 2019-08-01 09:23:43 +02:00
Robert Hartung
7bca1cc5d5 cpu/atmega_common: implements pseudomodule-based pin change interrupts 2019-08-01 09:23:04 +02:00
Gunar Schorcht
97bb33788b cpu/esp*: changes to use esp_wifi and esp_now 2019-07-31 13:53:48 +02:00
Gunar Schorcht
760168e403 cpu/esp_common: doc fixes 2019-07-31 13:53:48 +02:00
Gunar Schorcht
96a9949bf9 cpu/esp32: set WiFi config storage type 2019-07-31 13:53:48 +02:00
Gunar Schorcht
9981d2b05c cpu/esp32: cleanup comments/messages in esp_wifi 2019-07-31 13:53:48 +02:00
Gunar Schorcht
636c0847be cpu/esp_common: set WiFi config storage type 2019-07-31 13:53:48 +02:00
Gunar Schorcht
8f0f8f5993 cpu/esp_common: add/fix comments and messages 2019-07-31 13:53:48 +02:00
Gunar Schorcht
9db62bd401 cpu/esp_common: cleanup of compile time config 2019-07-31 13:53:48 +02:00
Gunar Schorcht
f34a1a3eef cpu/esp*: shorter netdev task names 2019-07-31 13:53:48 +02:00
Gunar Schorcht
1492f00690 cpu/esp32: esp_wifi compile configuration tuned
Downsized numbers of dynamic send and receive buffers.
2019-07-31 13:53:48 +02:00
Gunar Schorcht
dd6a5cde5c
Merge pull request #11239 from JulianHolzwarth/esp32/freertos/fix/semaphoreTake
cpu/esp32/freertos: fix semaphore take
2019-07-31 11:01:41 +02:00
Leandro Lanzieri
699fbc998a
Merge pull request #11922 from gschorcht/cpu/esp32/cpp
cpu/esp32: activate cpp feature
2019-07-30 21:04:04 +02:00
MichelRottleuthner
bd576e7839
Merge pull request #11896 from fjmolinas/pr_stm32l4_stmclk_hsemsi
cpu/stm32l4/stmclk: fix HSE overwrite when MSI is enabled
2019-07-30 18:46:17 +02:00
Gunar Schorcht
7962a0c179 cpu/esp32: activate cpp feature
Adds module pthread and the libstdc++ to linked libraries to solve the problem with unresolved symbols when feature cpp is required.
2019-07-29 16:06:04 +02:00
Kees Bakker
14a836d7a1 cpu/samr30: update vendor files using ASF 3.35.1 2019-07-26 22:03:12 +02:00
Marian Buschsieweke
f9f30ed15b
cpu/atmega32u4: Removed incorrect interrupt
Currently the configuration claims that external interrupt INT4 is present on
pin PE7. However, the ATmega32U4 datasheet (section 10.3.4 page 81) contains
the following remark to pin PE7: "Not present on pin-out". This commit removes
the PE7 from the interrupt config.
2019-07-26 17:22:55 +02:00
Marian Buschsieweke
2d415d16c9
cpu/arm7_common: Cleaned up interrupt vectors
- split up interrupt vector code from bootloader.c to vectors.c
- moved bootloader.c to arm7_init.c
- Use consistent naming:
    - use lower case for everything but preprocessor stuff
    - ISRs now named isr_foo()
2019-07-25 22:41:08 +02:00
Marian Buschsieweke
952e4a968b
cpu/arm7_common: Removed dead code
- Functions bl_uart_init(), bl_blink(), bl_config_init() declared but never
  implemented
    --> Removed declarations
- Check for c preprocessor macro CPU_MC1322X is obsolete, as CPU_MC1322X is
  nowhere defined in RIOT's code base
- IRQ_Routine() is never used, nor is it ever configured as ISR
- DEBUG_Routine() is never used, nor is it ever configured as ISR
2019-07-25 22:29:13 +02:00
Marian Buschsieweke
fd559bcdb5
cpu/arm7_common: Cleaned up IRQ code
- Moved VIC.c to irq_arch.c for consistent naming scheme
- Removed unused functions IRQenabled, disableFIQ, restoreFIQ, enableFIQ
    - There is not header for those functions, so they *cannot* be used
    - These is obviously no user, as they *cannot* be used
    - There is absolutely no documentation what they would be used for
2019-07-25 10:31:41 +02:00
Francisco Molina
c166b73e61 cpu/stm32_common: uniformize define alignments 2019-07-24 09:02:47 +02:00
Francisco Molina
51bc33de97 cpu/stm32l4/stmclk: fix HSE overwride when MSI is enabled 2019-07-23 17:26:26 +02:00
Francisco Molina
128e6ed2c9 stm32_common/gpio: remove unused guard 2019-07-23 17:05:37 +02:00
Marian Buschsieweke
7f77d69694
cpu/arm7_common: Fix thread_yield_higher in ISR
thread_yield_higher() in interrupt context must not yield immediately, but at
the end of the ISR. This commit fixes the behavior.
2019-07-23 07:55:05 +02:00
Juan I Carrano
7dd00b79e9
Merge pull request #11846 from jcarrano/mips32r2_generic-is-gone
cpu/mips32r2_generic: remove cpu.
2019-07-22 11:35:24 +02:00
3bcc72b614
Merge pull request #11878 from kaspar030/esp32_has_timer_set
esp32: define PERIPH_TIMER_PROVIDES_SET
2019-07-21 21:16:49 +02:00
3da6593a54 esp32: define PERIPH_TIMER_PROVIDES_SET 2019-07-19 22:28:27 +02:00
kenrabold
97d1dc0821 cpu/fe310: Add support for FE310_G002
Added support for FE310_G002 CPU variant that is on new HiFive1B board
2019-07-19 13:25:17 -07:00
Benjamin Valentin
56891fe7f2 cpu/sam0: update doc.txt with new MCU families 2019-07-17 11:37:46 +02:00
Juan Carrano
a2bcd7539c cpu/mips32r2_generic: remove cpu.
The `mips32r2_generic` CPU was only used by the `mips-malta` board which has
been removed. The reasons for this removal are the same as for the board:

- No hardware to test.
- The board that used this CPU is not available off the shelf.
- No UART input.
- No integrated flasher (one needs to use a separate Windows tool)

For more information and discussion around MIPS, see issues:

- #11831 (Removal of mips-malta)
- #11788 (General MIPS removal)
2019-07-16 11:09:48 +02:00
francisco
38ffe80a96 cpu/stm32l151cb_a: include _A suffix in CPU_MODEL defines 2019-07-09 08:56:37 +02:00
francisco
1d03634407 stm32_common/stm32_mem_length: fix RAM_LEN for stm32l1xx-A/X cpu's 2019-07-09 08:56:35 +02:00
Kevin "Bear Puncher" Weiss
f976aeb1af
Merge pull request #11720 from benemorius/efm32-gpio-init-int-disable
cpu/efm32/periph_gpio: fix wrong GPIO_IntDisable() in gpio_init_int()
2019-07-08 15:36:38 +02:00
7340de6129
cpu/stm32l4: add support for stm32l4r5zi model 2019-07-08 09:09:47 +02:00
3881128884
cpu/stm32_common: extend memory lengths support 2019-07-08 09:09:46 +02:00
33a878b70c
cpu/smt32l4: fix quadspi IRQ in vectors table 2019-07-08 09:09:46 +02:00
3f141e9184
Merge pull request #11314 from fjmolinas/pr_stm32l1_eeprom_null
cpu/stm32l1: fix issue when  writing NULL bytes to eeprom
2019-07-04 18:36:30 +02:00
francisco
8f1a835a59 stm32_common/eeprom: add _IO prefix to hardware access 2019-07-04 15:52:25 +02:00
francisco
f2f7fe1bab stm32l1/eeprom: fix eeprom write for cat 1 2019-07-04 15:51:32 +02:00
9e6d558596
stm32_eth: Code cleanup and some fixes
cpu/stm32_common: cleanup periph eth
boards/nucleo-f767zi: cleanup dependencies
boards/nucleo-f767zi: fix dma configuration attribute for eth
examples/default: add nucleo-767zi in boards with netif
drivers/stm_32_eth: Add header guard for eth_config

Co-authored-By: Robin <robin@chilio.net>
2019-07-04 15:27:50 +02:00
Robin
4729bea46e
stm32_eth: Multiple Improvements of the original codebase
stm32eth: Move to stm32_common periph
cpu/stm32_periph_eth: Rebase to current master branch

- Update DMA to use new vendor headers
- Update send to use iolist. It looks like the packet headers are now transfered as seperate iolist entries which results in the eth periph sending each header as own packet. To fix this a rather ugly workaround is used where the whole iolist content is first copied to a static buffer. This will be fixed soon in another commit
- If MAC is set to zero use luid to generate one
- Small code style fixes

cpu/stm312f7: Add periph config for on-board ethernet
boards/nucleo-f767zi: Add config for on board ethernet
tests/stm32_eth_lwip: Remove board restriction
boards/common/nucleo: Add luid module if stm32 ethernet is used
tests/stm32_eth_gnrc: Add Testcase for gnrc using the stm32 eth periph
stm32_eth: Rework netdev driver layour
tests/stm32_eth_*: Use netdev driver header file for prototypes
stm32_eth: Add auto init for stm32 eth netdev driver
boards/stm32: Enable ethernet conf for nucleo boards
stm32_eth_auto_init: Add dont be pendantic flag
stm32_eth: Remove dma specific stuff from periph_cpu.h

Looks like this was implemented in PR #9171 and 021697ae94 with the same interface.

stm32_eth: Remove eth feature from stm32f4discovery boards
stm32_eth: Migrate to stm32 DMA API
stm32_eth: Add iolist to module deps
stm32_eth: Rework send function to use iolist
stm32_eth: Fix ci build warnings
stm32_eth: Fix bug introduced with iolist usage
stm32_eth: Remove redundant static buffer
stm32_eth: Fix feature dependencies
stm32_eth: Fix wrong header guard name
stm32_eth: Implement correct l2 netstats interface
stm32_eth: Rename public functions to stm32_eth_*
stm32_eth: Fix doccheck
stm32_eth: Move register DEFINE to appropriate header file
stm32_eth: remove untested configuration for f446ze boards
stm32_eth: Move periph configuration struct to stm32_common
stm32_eth: Fix naming of eth_phy_read and eth_phy_write
stm32_eth: Remove obsolete test applications
2019-07-04 15:27:26 +02:00
Victor Arino
e206087d65
stm32_eth: Initial implementation by Victor Arino
drivers/eth-phy: add generic Ethernet PHY iface
cpu/stm32f4: implement eth driver peripheral

This implements the ethernet (MAC) peripheral of the stm32f4 as a
netdev driver.
boards/stm32f4discovery: add eth configuration
boards/stm32f4discovery: add feature stm32_eth
tests/stm32_eth_lwip: add test application
2019-07-04 15:04:01 +02:00
Hauke Petersen
1744b6bd92
Merge pull request #11559 from PeterKietzmann/pr_nrf5x_hwrng_softdev
cpu/nrf5x_common: map hwrng to SoC library if SoftDevice is present
2019-07-04 14:23:55 +02:00
PeterKietzmann
7ee9905fa6 cpu/nrf5x_common: map hwrng to SoC library if SoftDevice is present 2019-07-04 12:12:28 +02:00
5a62ec9798
Merge pull request #11790 from fjmolinas/pr_fix_wait_for_pending_isr
stm32_common/flash_common: fix _wait_for_pending_isr()
2019-07-04 11:28:50 +02:00
3f984a1128
Merge pull request #11776 from fjmolinas/pr_fix_stm32_flashpage
stm32_common/flashpage: fix stm32l4 erase error
2019-07-04 10:58:56 +02:00
francisco
24ea728007 stm32_common/flashpage: _wait_for_pending_operations() before write 2019-07-04 10:45:41 +02:00
francisco
7f675e9ca9 stm32_common/flash_common: properly clear EOP bit
- EOP bit is cleared by writing 1 to the register.
- Guard EOP bit clear for STM32F2, STM32F4, STM32F7
  and STM32L4 EOP bit is only set if EOPIE is enabled.
  Since this is not the case for any platform we exclude
  it when not needed.
2019-07-04 10:45:41 +02:00
59933d291b
Merge pull request #11758 from fjmolinas/pr_optimize_pm_stm32f
cpu/stm32: optimize stop mode for stm32f*
2019-07-04 10:36:24 +02:00
francisco
1b7a8611d8 cpu/stm32_common: minimize consumption for STM32F1
- With this PR all GPIOs are set as AIN on start up.
2019-07-03 16:50:21 +02:00
fjmolinas
940b80243f cpu/stm32_common: minimize consumption for STM32F0/2/3/4/7
- With this PR, On start up all GPIOs are configured as AIN. For stm32l0/4
  this is done by default. Doing this saves the consumption of the input Schmitt
  trigger in STOP mode which can reduce the consumption in at least 70%
  from current master.
2019-07-03 16:50:21 +02:00
francisco
26a8013502 stm32l4/flashpage: fix page erase
- The PNB in FLASH_CR wasn't cleared before every erase operation
  and the new value was just stacked on top. After a couple of erase
  the PNB written was overlapping with old ones failing to erase the
  correct page.
2019-07-03 09:30:06 +02:00
Francisco
bc6303fb59
Merge pull request #11750 from aabadie/pr/cpu/stm32l1-4_flashpage_numof
cpu/stm32l{1,4}: refactor flashpage numof macros
2019-07-01 14:58:10 +02:00
3b58b4b6b6
cpu/stm32f3: add support for flashpage 2019-06-28 17:16:10 +02:00
ea441bab5e
Merge pull request #11713 from bergzand/pr/nrf5x/uart_modecfg
nrf5x: Add UART modecfg feature implementation
2019-06-28 13:56:44 +02:00
Leandro Lanzieri
56ffb45f6c
Merge pull request #11719 from benemorius/efm32-numof_irqs-off-by-one
cpu/efm32/periph_gpio: fix NUMOF_IRQS off-by-one error
2019-06-28 11:25:04 +02:00
81df812c5b
nrf5x: Add UART modecfg feature implementation 2019-06-28 09:56:40 +02:00
Kevin "Bear Puncher" Weiss
135ad3817b
Merge pull request #10982 from gschorcht/cpu/esp8266/periph/pwm/pr
cpu/esp8266: fix pwm_set func
2019-06-27 16:35:53 +02:00
Gunar Schorcht
d3e0b78f7c cpu/esp8266: fix of set func in periph/pwm
In the `pwm_set` function, the switch-on and switch-off times for PWM channels were only determined for the following phase, but not for the current phase. This could result in a missing duty cycle when calling the function `pwm_set` if the switch-on time of the current phase was not yet reached or to an extended duty cycle if the switch-off time of the current phase had not yet been reached.
2019-06-26 16:00:02 +02:00
ee5181dd50
cpu/stm32l4: use flash size define to get the number of pages 2019-06-26 08:46:19 +02:00
cef14009d9
cpu/stm32l1: use flash size define to get the number of pages 2019-06-26 08:46:08 +02:00
56085b10a0
Merge pull request #11698 from bergzand/pr/usb/nrfusb_suspend
nrf52: Add suspend/resume detection to usbdev
2019-06-25 16:12:27 +02:00
ee39222b2e
nrf52: Add suspend/resume detection to usbdev 2019-06-25 15:39:52 +02:00
Sebastian Meiling
7fa201ef24
Merge pull request #11729 from MrKevinWeiss/pr/kinetis/i2c/errorcodefix
cpu/kinetis/i2c: Fix false positive for expected EIO during i2c write
2019-06-21 13:18:26 +02:00
Kevin "Bear Puncher" Weiss
a290f2d66c
Merge pull request #11712 from bergzand/pr/sam0_common/uart_modecfg
sam0_common: add uart modecfg support
2019-06-21 13:08:07 +02:00
MrKevinWeiss
ec62f1ccce cpu/kinetis/i2c: Suppress cppcheck unreadVariable warning
On cppcheck 1.82 it throws a warning.
Since it costs cycles and does nothing the ++dummy is (void)dummy.
A warning suppression is added so the CI is happy.
2019-06-21 12:29:14 +02:00
Sebastian Meiling
44d09f3ca0
Merge pull request #11728 from MrKevinWeiss/pr/stm/i2c2/fix
cpu/stm32/i2c: Fix error flag clearing in sr1
2019-06-21 11:43:09 +02:00
3241aff71c
sam0_common: add uart modecfg 2019-06-21 10:54:24 +02:00
Benjamin Valentin
99344e8030 cpu/samd5x: make sure RIOTBOOT_LEN is 2*FLASHPAGE_SIZE
The flashpage size on samd5x is 8k, so set RIOTBOOT_LEN accordingly.
2019-06-21 09:47:04 +02:00
Dylan Laduranty
c3c810b36e
Merge pull request #11655 from benpicco/same5x-fix_clock
cpu/samd5x: CPU init fixes
2019-06-21 09:44:54 +02:00
MrKevinWeiss
6419a7a3aa cpu/kinetis/i2c: Fix false positive for expected EIO during i2c write
This fixes the positive result when master write data is NACKed.
This false positive occurs when the write frame is finished but a data nack occurred.
The AF check should occur first.
2019-06-20 16:32:25 +02:00
MrKevinWeiss
b5db0dab2d cpu/stm32/i2c: Fix error flag clearing in sr1
This commit fixes the clearing of a error condition after read.
This causes the incorrect errorcodes if the register is read
then an error occurs, then it is cleared.
By clearing only after the error is processed the bug is fixed.
This can be tested by reading a i2c slave that is not there.
2019-06-20 15:53:44 +02:00
Benjamin Valentin
f29ca155d8 cpu/samd5x: fix CPU init
There were still some things wrong with samd5x CPU init which only
showed up when used in conjunction with RIOTBOOT, that is cpu_init()
was called twice.

 - gclk_connect() should block until the GCLK is ready.
 - DPLL should be disabled dring configuration.
 - make sure not to use DPLL for MCLK when re-configuring DPLL
 - All APBxMASK bits should be in a defined state.
 - always enable 1kHz oscilator output.
2019-06-20 11:29:05 +02:00
a671c6c247
Merge pull request #11715 from fjmolinas/pr_stm32_flashpage_cleanup
stm32_common/flashpage: cleanup
2019-06-20 10:03:18 +02:00
francisco
46b90134ad stm32_common/flashpage: cleanup stm32l0/1
- Since writes are performed per word no actions need
  to be performed for flash access, and the FPRG doesn't
  need to be cleared.
2019-06-20 09:43:13 +02:00
francisco
5e709edb31 stm32_common/flashpage: remove repeated command 2019-06-20 09:31:48 +02:00
francisco
eb78d35096 stm32_common/flashpage: make implicit CPU_FAM defines explicit 2019-06-20 09:28:27 +02:00
francisco
10875890e0 stm32_common/flashpage: use HSI only for stm32f0/1
- Before, HSI was enabled as the default case when it is only
  used for stm32f0 and stm32f1. It is now implemented explicitly
  for those platforms, and only those.
2019-06-20 09:27:26 +02:00
Thomas Stilwell
c2d98f9648 cpu/efm32/periph_gpio: fix wrong GPIO_IntDisable() in gpio_init_int() 2019-06-19 00:52:14 -07:00
Thomas Stilwell
5c8bf483e7 cpu/efm32/periph_gpio: fix NUMOF_IRQS off-by-one error 2019-06-18 16:46:35 -07:00
francisco
4acceefa65 cortexm_common/Makefile.include: set RIOTBOOT_HRD_LEN for cortex-m
- Since the Vector table must be naturally aligned to the next power
  of two of the amount of supported ISR, and the table will be
  placed after riotboot_hdr, we must ensure RIOTBOOT_HRD_LEN has the
  same alignment.
2019-06-18 15:11:05 +02:00
Benjamin Valentin
d6b8df1ff7 cpu/samd21: allow to use XOSC32K for GCLK2
GCLK2 is needed by RTC/RTT, so make it possible to configure it with
XOSC32K as source.
2019-06-18 13:20:04 +02:00
Benjamin Valentin
7928c74e26 sam0_common: rtc/rtt: don't setup oscilators
leave that to cpu.c
2019-06-18 13:20:04 +02:00
Benjamin Valentin
c9c3cb84bf cpu: saml1x/saml21: setup 32kHz Oscilator in cpu.c
Clock setup does not belong in the peripheral driver.
2019-06-18 13:20:04 +02:00
Benjamin Valentin
46565ad339 cpu: saml1x/saml21: reduce differences in cpu.c
The init code for both MCUs is so alike, but it diverged over time.
Re-order the code, so that it's the same on both families again.
2019-06-18 13:20:04 +02:00
18bb31c38e
Merge pull request #11643 from fjmolinas/pr_stm32l4_riotboot
boards/nucleo-l476rg: add riotboot
2019-06-14 16:50:28 +02:00
Gaëtan Harter
90a9adbbda
cpu/esp*: append to FLASHDEPS
Append to FLASHDEPS instead of overwriting/lazy setting it.
2019-06-14 15:58:36 +02:00
Kevin "Bear Puncher" Weiss
f44740ea5b
Merge pull request #11648 from cladmi/pr/esp/use_flashfile
cpu/esp*: use FLASHFILE for esp32 and esp8266 boards
2019-06-14 15:04:49 +02:00
ab05e63175
nrf52: Add USB device peripheral driver 2019-06-11 14:14:36 +02:00
Gaëtan Harter
632da8ae0a
Merge pull request #11562 from fjmolinas/pr_kinetis_riotboot_frdm_kw41z
boards/frdm-kw41z-k64f: add riotboot
2019-06-07 19:49:08 +02:00
Benjamin Valentin
f375b00ff3 cpu/samd5x: add support for samd5x/same5x MCUs
This adds supoprt for the Atmel SAMD51 & SAME54 SoC.
The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the samd2x Cortex-M0+ and saml1x Cortex-M23 parts.
2019-06-06 16:47:11 +02:00
Benjamin Valentin
3cd119a6e6 cpu/sam0_common: import vendor files for samd51
Atmel Software Framework (ASF) provides a set of low-level header files
that give access to different hardware peripherals of Atmel's ICs.

Origin: Atmel SAMD51 Series Device Support (1.1.96)
License: Apache-2.0
URL: http://packs.download.atmel.com/Atmel.SAMD51_DFP.1.1.96.atpack
2019-06-06 16:47:11 +02:00
Benjamin Valentin
cb9624909f cpu/sam0_common: import vendor files for same54
Atmel Software Framework (ASF) provides a set of low-level header
files that give access to different hardware peripherals of Atmel's
ICs.

Origin: Atmel SAME54 Series Device Support (1.0.87)
License: Apache-2.0
URL: http://packs.download.atmel.com/Atmel.SAME54_DFP.1.0.87.atpack
2019-06-06 16:47:11 +02:00
Dylan Laduranty
a37c0ccf70
Merge pull request #11610 from benpicco/sam0-timer_fix
sam0/timer: various fixes
2019-06-06 16:04:34 +02:00
Kevin "Bear Puncher" Weiss
002e033f5e
Merge pull request #11612 from ben-postman/pr_cc26x0_uart_mode
cpu/cc26x0: implement uart_mode()
2019-06-06 15:43:07 +02:00
Benjamin Valentin
f36d54f239 sam0/timer: various fixes
This cleans up the sam0 timer driver:

 - remove the check for the unused freq parameter
 - the MCU provides dedicated SET/CLR registers to avoid
   read-modify-write, so don't do read-modify-write on them.
 - workaround a possible hardware bug on SAMD5x:
   loop until the CMD_READSYNC is really set
2019-06-06 15:38:55 +02:00
francisco
42b1118f94 boards/frdm-k64f add riotboot support 2019-06-06 15:20:36 +02:00
Gunar Schorcht
563c41f191
cpu/esp8266: use FLASHFILE variable
Use ELFFILE as FLASHFILE as all files are created from this
one using esptool.
2019-06-06 14:59:24 +02:00
Gunar Schorcht
98d64dafef
cpu/esp32: use FLASHFILE variable
Use ELFFILE as FLASHFILE as all files are created from this
one using esptool.
2019-06-06 14:59:24 +02:00
Ben Postman
9a000cf4e6 cpu/cc26x0: Implement uart_mode()
This change required correcting the values for  LCRH_PEN and LRCH_EPS
values defined in cc26x0_uart.h, as they  were incorrect according to
19.8.1.7 of the TI CC26x0 reference manual.

on-behalf-of: @sparkmeter <ben.postman@sparkmeter.io>
2019-06-06 08:46:33 -04:00
francisco
4ca815445d kinetis/Makefile.include: set RIOTBOOT_HDR_LEN to 0x200 for KW2XD
- Minimum required RIOBOOT_HDR_LEN or kW2xD is 0x200
  to respect vector table alignment
2019-06-06 11:59:01 +02:00
francisco
4611725e95 stm32l4/Makefile.include: set RIOTBOOT_HDR_LEN to 0x200
- Minimum required RIOBOOT_HDR_LEN or stm32l4 is 0x200
  to respect vector table alignment
2019-06-06 11:54:12 +02:00
francisco
21d7ecaac0 cpu/stm32l4: add CPU_FLASH_BASE 2019-06-06 11:49:25 +02:00
Gaëtan Harter
bbb6dec054
Merge pull request #11630 from fjmolinas/pr_kinetis_ld
kinetis/ldscript: handle _rom_offset
2019-06-05 16:12:25 +02:00
francisco
1e0f44c28a kinetis/Makefile.include: cleanup unused LINKFLAGS
- _rom_start_addr, _ram_start_addr, _rom_length and _ran_length are
  already defined in cortexm_common/Makefile.included and can therefore
  be removed from kinetis/Makefile.include
- _ram_base_addr is never used and was not in commit history so
  is also removed
2019-06-04 18:11:55 +02:00
francisco
f0311ce1fa kinetis/ldscript: include _rom_offset
- To be able to flash at an offset the vector table must be
  relocated accordingly to the IMAGE_OFFSET, therefore linkage
  needs to take the offset into account.
2019-06-04 18:05:35 +02:00
francisco
43182bd8f7 cortexm_common/ldscript: use cortexm_rom_offset.ld 2019-06-04 18:05:35 +02:00
francisco
1e5a485539 cortexm_common/ldscript: add common script for rom_offset calculation 2019-06-04 18:05:35 +02:00
Gaëtan Harter
fcd7f2233a
Merge pull request #11615 from cladmi/pr/cpu/atmega_common/ldscripts_compat/doc
cpu/atmega*/ldscripts_compat: add command to generate ldscript
2019-06-03 16:49:38 +02:00
Gaëtan Harter
40e7dd3e6b
cpu/atmega*/ldscripts_compat: add command to generate ldscript
Add the command to generate the ldscript in the documentation.
It was only in the commit message before and had a typo 's/--mmcu/-mmcu/'.
2019-06-03 16:11:19 +02:00
smlng
2de4b3011b periph_common: add as dependency to periph drivers
Rational: the periph_common module is required by (most) other periph drivers
and also during startup of the CPU/MCU to run periph_init. The latter is only
required if other periph drivers are used, hence periph_common should be a
depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that
by making periph_common a depency of periph_* and removing the explicit
include in the CPU/MCU implementation.
2019-06-03 13:44:10 +02:00
b92f6a424a
Merge pull request #11502 from dylad/pr/saml21_pl2
cpu/saml21: set PL2 by default
2019-06-03 12:30:41 +02:00
Juan I Carrano
0d88de90c3
Merge pull request #11591 from benpicco/noinit_move
ldscripts: move .noinit section behind .bss section
2019-05-31 18:23:00 +02:00
dylad
f7ee2d2e15 cpu/saml21: set PL2 by default 2019-05-30 21:51:13 +02:00
Leandro Lanzieri
bf1b38aabe
Merge pull request #11503 from MrKevinWeiss/pr/cc2538/uartmode
cpu/cc2538: Add periph_uart_mode implementation
2019-05-29 16:00:09 +02:00
Juan I Carrano
245f04a33d
Merge pull request #11545 from cladmi/pr/kinetis/flash_no_arm_toolchain
cpu/kinetis: allow flashing without toolchain
2019-05-29 13:51:30 +02:00
Kevin "Bear Puncher" Weiss
4922321f1f
Merge pull request #11585 from fedepell/i2c_reg_endianess_2
periph/i2c: handle i2c register write/read helper function correctly in big endian
2019-05-29 11:54:24 +02:00
Federico Pellegrin
617124792c efm32/i2c: make sure 16-bit register access is done in big endian 2019-05-29 11:29:11 +02:00
Gaëtan Harter
dedbe9c737
Merge pull request #11554 from cladmi/pr/make/exports/remove_flash_debug_reset
make: remove exports for flash debug reset
2019-05-28 18:15:03 +02:00
Gaëtan Harter
e40d569204
kinetis: save 'wdog-disable.bin' binary in the repository
Keep the compiled '.bin' file to remove the need to compile it when
flashing. This remove the need to have the toolchain when flashing so
allow compiling and flashing with `BUILD_IN_DOCKER=1` without a local
toolchain.

Even if it ends up storing a binary, the file is only 34 bytes.
2019-05-28 14:37:11 +02:00
Gaëtan Harter
984cbc7e41
cpu/kinetis/check-fcfield: use OBJDUMP
Get OBJDUMP from the environment instead of hardwriting the value.

This is a prerequisite to allow using `objdump` when building from docker
when not having the `arm` toolchain installed.
2019-05-28 14:36:37 +02:00
francisco
c219fdc001 kinetis/check-fcfield: skip on IMAGE_OFFSET > 0x410
- fcfield is located in memory at 0x400-0x40f. Its content is only read
  upon reset, therefore if in presence of a bootloader and multiple
  applications, the fcfield will only be read when the bootloader
  is loaded. As long as we flash at IMAGE_OFFSET > 0x410 we do not
  care about the fcfield content since it won't get overwritten.
2019-05-28 10:19:00 +02:00
Gaëtan Harter
79280eb12e
boards/tools: remove exporting PREFLASH/FLASHDEPS
PREFLASHER/PREFFLAGS/FLASHDEPS are evaluated by the main Makefile.include.
Their value does not need to be exported.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `16 insertions(+), 16 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE` plus the newline that is said to have
changed.
2019-05-28 09:58:40 +02:00
Gaëtan Harter
ac113ca2f8
boards/tools: remove exporting FLASHER/FFLAGS
FLASHER and FFLAGS are evaluated by the main Makefile.include or by file
included by it. Their value does not need to be exported.

This will also prevent evaluating 'PORT' for FFLAGS when not needed.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `84 insertions(+), 84 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
2019-05-28 09:56:00 +02:00
francisco
7156977fed kinetis/check-fcfield: add fcfield verirication for bin files 2019-05-27 17:43:19 +02:00
francisco
963bbe75ba kinetis/check-fcfield: merge hex and elf script 2019-05-27 17:38:46 +02:00
Benjamin Valentin
7415e0590e sam0_common: spi: use sercom_set_gen() instead of re-implementing it
Don't repeat yourself and introduce errors in doing so.
2019-05-25 19:13:53 +02:00
Benjamin Valentin
84233ce5d5 sam0_common: replace sercom_id() calculation with switch statement
As the sercom_id() function grows it gets more unweidly.
Let's replace it with a simple switch statement that is true for all
sam0 parts.
2019-05-25 19:12:55 +02:00
Benjamin Valentin
31f88a2d0e sam0_common: periph/spi: use sercom_clk_en/dis()
Use already existing functions to turn on / off SERCOM clocks instead
of replicating the functionality in the driver.
2019-05-25 19:09:32 +02:00
1dcd3b6a08
Merge pull request #11563 from dylad/pr/saml1x/pm_layered
saml1x: enable pm_layered by default
2019-05-24 18:33:37 +02:00
Dylan Laduranty
0da43ba4ee cpu/saml1x: set custom PM_BLOCKER_INITIAL 2019-05-24 16:40:08 +02:00
Thomas Perrot
b63121c588
board: add support for arduino-leonardo 2019-05-24 15:12:47 +02:00
Thomas Perrot
44803ea4fd
cpu/atmega32u4: add support for ATmega32U4 2019-05-24 15:12:47 +02:00
35d43ccdc6
Merge pull request #11440 from maribu/arm7_barriers
cpu/arm7_common: Make irq_*() compiler barriers
2019-05-24 11:05:13 +02:00
Gunar Schorcht
2c555a72ec cpu/esp8266: print_meminfo function added 2019-05-24 00:28:57 +02:00
Gunar Schorcht
501d679f67 cpu/esp8266: fix of printf format identifiers
Format identifier `h` and `hh` removed since `esp_printf` does not support them.
2019-05-24 00:28:24 +02:00
Gunar Schorcht
46ea36ff52 cpu/esp8266: fix of esp_hexdump function
A space was mission after each field.
2019-05-24 00:28:24 +02:00
eac6a54648
stm32_common/rtt: add support for stm32f7 2019-05-23 14:49:39 +02:00
Sebastian Meiling
6b16df0dfd
Merge pull request #11453 from maribu/atmega_naked
cpu/atmega_common: Fix function attributes
2019-05-23 12:14:33 +02:00
Dylan Laduranty
aba9405dd4 saml1x: enable use for pm_layered 2019-05-22 17:04:55 +02:00
Dylan Laduranty
f6ba7ee106 sam0: correct number of PM for SAML10 2019-05-22 17:04:27 +02:00
Sebastian Meiling
6b56a104b7
Merge pull request #9908 from jia200x/pr/fix_uninitialized
cpu/lpc1768: fix uninitialized variable
2019-05-22 14:32:00 +02:00
Jose Alamos
840d8714e2 cpu/lpc1768: fix uninitialized variable 2019-05-22 13:42:07 +02:00
Dylan Laduranty
85d37bb94f
Merge pull request #11336 from benpicco/sam0-timer
sam0_common: make Timer implementation common across all sam0 MCUs
2019-05-21 12:13:39 +02:00
Benjamin Valentin
849dd4cdce sam0_common: make Timer implementation common across all sam0 MCUs
The currently supported SAM0 MCUs (samd21, saml21, saml1x) share the same
Timer peripheral, yet each of them carries it's own copy of the Timer
driver.

This introduces a new timer driver that is common for all sam0 MCUs and
uses structs for configuration instead of defines.
2019-05-21 11:47:59 +02:00
13cc513f30
cpu/stm32l0: add support for stm32l052xx 2019-05-21 09:54:35 +02:00
Benjamin Valentin
1c3f96495d ldscripts: move .noinit section behind .bss section
If the .noinit section starts at the beginning of the RAM,
a bootloader that is unaware of it will clear it.
Instead, move it behind the .bss section, hoping that a bootloader
will always use less .bss memory than RIOT proper.
2019-05-16 23:11:45 +02:00
Semjon Kerner
65b709aaa7 cpu/nrf5x/radio/nrfmin: apply errata workaround 2019-05-15 14:49:42 +02:00
Semjon Kerner
22b5f8a41a cpu/nrf5x/radio/nrfmin: wait for state transition 2019-05-15 14:49:42 +02:00
Semjon Kerner
1954807309 cpu/nrf5x/radio/nrfmin: explicit test for power mode 2019-05-15 12:32:14 +02:00
bf000a1fa5
Merge pull request #11514 from kaspar030/fix_c11_atomic_definitions
core: fix c11 atomic definitions (fix gcc9 compilation)
2019-05-15 12:29:23 +02:00
MrKevinWeiss
0aa6b04249 cpu/cc2538: Add periph_uart_mode implementation
This commit adds the periph_uart_mode USEMODULE
It implements all functionality defined in the common uart driver
This means all parity modes, data bits, and stop bits
2019-05-15 09:26:56 +02:00
Juan I Carrano
e4bc5d4718
Merge pull request #11521 from benpicco/cortexm_common-noinit
cortexm_common: add .noinit section
2019-05-14 13:13:21 +02:00
Kevin "Bear Puncher" Weiss
e40f483acf
Merge pull request #11261 from gschorcht/cpu/esp32/doc_fix/rom
boards/cpu/esp32: doc fix of built-in ROM size
2019-05-14 13:07:50 +02:00
Benjamin Valentin
29bf6c712b cortexm_common: add .noinit section
Make it possible to specify a section of RAM that is not touched by
the init routing so data can be kept across resets.

This should behave the same as on atmega & lpc2387.
2019-05-14 12:10:27 +02:00
Leandro Lanzieri
44d981947d
Merge pull request #11293 from gschorcht/cpu/esp32/periph/conf/spi
boards/esp32: changes the approach for configurations of SPI interfaces in board definitions
2019-05-14 12:07:19 +02:00
d85d96685f
Merge pull request #11518 from fjmolinas/pr_nrf52dk_bootloader_length
cpu/nrf52: set RIOTBOOT_LEN to 8k
2019-05-14 10:59:27 +02:00
francisco
de3314334e cpu/nrf52: set RIOTBOOT_LEN to 8k
- nrf52 flash page is 4k, the bootloader needs to be x2 so slots
  start at the beginning of a page.
2019-05-13 21:47:14 +02:00
68a4099c1c cpu/cortexm: fix pointer calculation
gcc9 started realizing that _sram is basically an uint8_t[1] and thus
HARDFAULT_HANDLER_REQUIRED_STACK_SPACE cannot be added to it without
exceeding the one-sized array.

This commit casts _sram to (uintptr_t) where that happens.
2019-05-13 17:38:10 +02:00
Leandro Lanzieri
ab6d0fe08c
Merge pull request #11292 from gschorcht/cpu/esp32/periph/conf/pwm
boards/esp32: changes the approach for configurations of PWM channels in board definitions
2019-05-13 16:11:05 +02:00
Juan I Carrano
cbc08edcd1
Merge pull request #11358 from fjmolinas/riot-cortexm-address-check
cpu/cortexm_common: function to check address validity
2019-05-13 11:50:48 +02:00
Igor Knippenberg
dbd8c2774f cpu/nrf52: i2c bugfix 2019-05-13 11:32:57 +02:00
Oleg Artamonov
a5ce6deb02 cpu/cortexm_common: function to check address validity 2019-05-13 09:35:34 +02:00
Benjamin Valentin
077056b949 sam0_common: make RTT implementation common across all sam0 MCUs
The currently supported SAM0 MCUs (samd21, saml21, saml1x) share the
same RTC peripheral, yet each of them carries it's own copy of the RTT
driver.

Unify the drivers and move them to sam0_common.
2019-05-09 20:54:00 +02:00
Kevin "Bear Puncher" Weiss
6afb0603aa
Merge pull request #11291 from gschorcht/cpu/esp32/periph/conf/i2c
boards/esp32: changes the approach for configurations of I2C in board definitions
2019-05-09 08:26:01 -07:00
Kevin "Bear Puncher" Weiss
795ad18f2e
Merge pull request #11294 from gschorcht/cpu/esp32/periph/conf/uart
boards/esp32: changes the approach for configurations of UART interfaces in board definitions
2019-05-09 08:25:40 -07:00
5d63e28e59
Merge pull request #11425 from OTAkeys/pr/fix_stm32_uart_flow_control
cpu/stm32_common: set RTS when uart is off
2019-05-09 09:13:13 +02:00
Leandro Lanzieri
9075e1d207
Merge pull request #11290 from gschorcht/cpu/esp32/periph/conf/dac
boards/esp32: changes the approach for configurations of DAC channels in board definitions
2019-05-07 11:35:34 +02:00
990086aee7
Merge pull request #11479 from cladmi/pr/kinetis/hwrng
kinetis: move filtering-out periph_hwrng in cpu/kinetis
2019-05-06 17:42:16 +02:00
Gaëtan Harter
19224ec1d5
kinetis: move filtering-out periph_hwrng in cpu/kinetis
This removes doing `filter-out periph_hwrng, $(FEATURES_PROVIDED)`
after processing `cpu/$(CPU)/Makefile.features`.
The current solution is a HACK as `CPU_MODEL` is currently not available
at that moment but will be in the near future.

It will allow always including `cpu/$(CPU)/Makefile.features` after
`boards/$(BOARD)/Makefile.features`.

It is a part of moving `CPU/CPU_MODEL` definitions to `Makefile.features`.
2019-05-06 15:12:47 +02:00
Gunar Schorcht
3cb08e9e99 cpu/esp32: fixup after rebase 2019-05-06 13:34:59 +02:00
Gunar Schorcht
3e79787bcc cpu/esp32: UART configuration approach changed
UART devices are now configured using static array in header files instead of static variables in implementation to be able to define UART_NUMOF using the size of the array instead of a variable.
2019-05-06 13:34:59 +02:00
Gunar Schorcht
26613ee9e7 cpu/esp32: SPI configuration approach changed
SPI devices are now configured using static array in header files instead of static variables in implementation to be able to define SPI_NUMOF using the size of the array instead of a variable.
2019-05-06 13:33:48 +02:00
Gunar Schorcht
e8828aded8 cpu/esp32: PWM configuration approach changed
PWM channels are now configured using static array in header files instead of static variables in implementation.
2019-05-06 13:32:52 +02:00
Gunar Schorcht
748164ad6a cpu/esp32: I2C configuration approach changed
I2C devices are now configured using static array in header files instead of static variables in implementation to be able to define I2C_NUMOF using the size of the array instead of a variable.
2019-05-06 13:32:06 +02:00