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

432 Commits

Author SHA1 Message Date
Gunar Schorcht
470208e685 cpu/esp32/i2c_hw: assert added for unsupported I2C clock speeds
The former correction factors were determined by measuring the resulting clocks without a device connected to the bus.

However, when testing the changes for low CPU clock frequencies, it was figured out that the clocks not only depend on configured register values

    _i2c_hw[dev].regs->scl_low_period.period
    _i2c_hw[dev].regs->scl_high_period.period

but also on the bus capacity. Obviously, the register values are not absolute times in APB clock cycles, but rather times that start as soon as the corresponding level is reached. In this case, the higher the bus capacity, the longer the period would be.

This means that the clock speed cannot be precisely controlled via the correction factors anyway. For this reason, and because the I2C implementation in ESP-IDF also does not use correction factors, they were removed.
2021-12-17 17:44:27 +01:00
Gunar Schorcht
0b4fb5a9ea cpu/esp32/i2c_sw: add delays for 2 and 40 MHz 2021-12-16 10:44:53 +01:00
Gunar Schorcht
85313ccc02
Merge pull request #17232 from leandrolanzieri/pr/cpu/esp/model_kconfig
cpu/esp{32,8266}: model kconfig
2021-12-11 08:53:31 +01:00
benpicco
13f03ad161
Merge pull request #17314 from gschorcht/boards/esp/compile_optional_modules
cpu/esp: compile optional modules in CI
2021-12-10 19:28:24 +01:00
Leandro Lanzieri
a685e037c7
cpu/esp32: check for cpp module instead of used feature 2021-12-10 18:54:28 +01:00
Leandro Lanzieri
81b93c9b95
cpu/esp32/kconfig: move esp_wifi_enterprise feature to esp_common 2021-12-10 18:54:28 +01:00
Leandro Lanzieri
281519881e
cpu/esp32: fix esp_jtag dependency
In order to work properly dependencies should be placed on the
Makefile.dep files, not on Makefile.include.
2021-12-10 18:54:27 +01:00
Leandro Lanzieri
53134d0474
cpu/esp32: require esp_spi_ram feature to use the module 2021-12-10 18:54:27 +01:00
Leandro Lanzieri
9f31dfe28a
cpu/esp32: refactor esp_spi_ram feature
This feature is provided by all esp32_wrover% models, so group it in the
common file.
2021-12-10 18:54:27 +01:00
Leandro Lanzieri
bfdfbb1a48
cpu/esp32: model Kconfig 2021-12-10 18:54:07 +01:00
Leandro Lanzieri
59d3f0bcc6
cpu/esp32: remove unneeded crypto dependencies 2021-12-10 17:34:19 +01:00
Leandro Lanzieri
252c3886b0
cpu/esp32: do not expand USEMODULE 2021-12-10 17:34:16 +01:00
Marian Buschsieweke
d59d9c27d7
cpu/esp32/periph_can: use container_of()
This silences false positives of -Wcast-align
2021-12-03 10:12:35 +01:00
Marian Buschsieweke
d31b1f4854
cpu/esp32: disable -Wcast-align for vendor code 2021-12-03 10:12:32 +01:00
Gunar Schorcht
7da115f9e6 cpu/esp32: fix esp_hw_counter compile problem 2021-12-02 06:17:48 +01:00
Gunar Schorcht
6123cde033 cpu/esp32: cleanup of pseudomodule definition 2021-12-02 06:17:48 +01:00
Gunar Schorcht
09c0341442 cpu/esp32: fix esp_wifi_enterprise compilation problem
With the change from using archive files to using object files in PR #14754, the module `esp_wifi_enterprise` was no longer compilable. The reason for this was that the file `bignum.c` was present in two different vendor sub-directories and created two identical object files, which then led to a symbol conflict when linking. This commit removes one of these identical files. The one that is used in all `esp_wifi` variants is kept, the one that is only used in `esp_wifi_enterprise` is dropped.
2021-12-01 11:25:57 +01:00
Gunar Schorcht
007e29ebb5 cpu/periph/i2c: update implementations to new I2C API
Make all `spi_acquire` implementations return `void` and add assertions to check for valid device identifier where missing.
2021-11-29 06:35:25 +01:00
Benjamin Valentin
3d8e0d7f43 cpu/esp32: fix cast to periph type 2021-11-18 10:14:51 +01:00
Francisco
691601fbe2
Merge pull request #17087 from gschorcht/cpu/esp32/fix_code_placement
cpu/esp32: place freertos and periph in IRAM
2021-11-18 10:05:25 +01:00
Marian Buschsieweke
b2f9e2c226
cpu/esp32: fix wrong control flow 2021-11-17 13:10:37 +01:00
Marian Buschsieweke
e46c1f732e
cpu/esp32: make CI happy 2021-11-17 13:10:37 +01:00
Gunar Schorcht
aecc516ce9 cpu/esp32: place freertos and periph in IRAM
The IRAM is much faster, while the IROM is much slower and can only be accessed via a cache, which is also sometimes disabled, e.g. by the WiFi module or when writing to the flash. Therefore, time-critical code as well as code that has to work even when the cache is disabled must be placed in the IRAM.
2021-10-30 14:46:57 +02:00
Erik Ekman
cbfe502cc6 cpu/esp32: Reset when starting debugging
To avoid 'Target not examined yet' error
2021-10-18 20:11:32 +02:00
Erik Ekman
1c6d7dcdaf tools/openocd: Make verifying flashed image optional
Checksumming flash is not supported on xtensa platform:

Warn : not implemented yet

make: *** [.../RIOT/examples/saul/../../Makefile.include:796: flash] Error 1
2021-10-15 10:13:25 +02:00
Erik Ekman
2df7d499c8 tools/openocd: Export IMAGE_OFFSET only when flashing 2021-10-15 10:12:40 +02:00
Erik Ekman
d47aa2d550 cpu/esp32: Flash bootloader, partition and app via openocd
https://github.com/espressif/openocd-esp32 is needed.

Example config (when compiled from source):
export OPENOCD="~/esp/openocd-esp32/src/openocd -s ~/esp/openocd-esp32/tcl"
2021-10-15 10:00:57 +02:00
Marian Buschsieweke
94921942d3
cpu/esp32/doc: Restore center alignment of tables 2021-10-13 14:56:00 +02:00
Marian Buschsieweke
8d1d00776c
cpu/esp32: Fix documentation format
Fix various issues with incompatibilities to flavor of markdown
supported by Doxygen and re-format text.
2021-10-10 21:35:30 +02:00
Jean-Pierre De Jesus DIAZ
35d1a2fc02 cpu/esp*: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-11 12:45:15 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Jose Alamos
0e65605c39
esp-eth: avoid explicit cast to netdev 2021-07-09 10:38:34 +02:00
Marian Buschsieweke
a9dea12eb8
cpu/esp_common: add overflow detection to calloc
If esp_idf_heap is not used, implement calloc through a custom wrapper
function on top of malloc to add overflow detection, which is not
present in the newlib forks with xtensa support yet.
2021-05-10 15:29:48 +02:00
Benjamin Valentin
6d42c9fcfe cpu: make newlib_nano a DEFAULT_MODULE
This allows to disable nanospecs with

    DISABLE_MODULE += newlib_nano

if a full-features version of newlib is desired.
2021-05-04 12:12:36 +02:00
Benjamin Valentin
d47a880915 cpu: add periph_rtt_overflow feature
The RTT overflow callback is not available on all RTT implementations.
This means it is either a no-op or `rtt_set_overflow_cb()` is a no-op
or it will overwrite the alarm set with `rtt_set_alarm()`.

This adds a feature to indicate that proper overflow reporting is available.
2021-04-30 11:58:00 +02:00
Francisco Molina
5ae5c40f26
cpu/esp*: add CLOCK_CORECLOCK 2021-04-21 08:54:43 +02:00
Marian Buschsieweke
ab89234040
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-08 14:16:46 +01:00
Marian Buschsieweke
b9cb75fedf
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-04 18:05:06 +01:00
Erik Ekman
95196fb7e4 esp32/eth: Don't overwrite queued event with RX packet
If there is an event to be handled by _esp_eth_isr(), don't
overwrite it if a new packet has been received.

In my testing, all SYSTEM_EVENT_ETH_CONNECTED events except the first
are immediately followed by at least one SYSTEM_EVENT_ETH_RX_DONE event.
This causes the SYSTEM_EVENT_ETH_CONNECTED to not get handled, and the
IP stack will not be notified of the new link state.

Protect the other events by dropping the packet instead. If an earlier
unhandled SYSTEM_EVENT_ETH_RX_DONE event exists, overwrite it with the
newer packet.

I only saw this happen with lwIP and not with GNRC - I am not sure why.
But it still is a race waiting to happen. The nice long term solution
is probably to have a queue of unhandled events, allowing them all to
be processed once there is time.
2021-02-24 01:20:43 +01:00
430770886b
make/esptool: fix FFLAGS inclusion order for qemu 2021-02-22 10:35:38 +01:00
858b5ca6ed xfa: remove obsolete empty xfa.ld 2021-02-18 10:46:08 +01:00
2474fa7af5 cpu/esp32: add XFA support 2021-02-18 10:46:08 +01:00
Benjamin Valentin
9c1455d55f cpu: make pm_layered a DEFAULT_MODULE
Allow to disable pm_layered in the bootloader to save some ROM.
2021-01-27 13:21:20 +01:00
Francisco Molina
63a2a6ce1b
treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Erik Ekman
1d6aa2e865 cpu/esp32: Add newline to emac_main debug prints 2021-01-21 20:55:02 +01:00
189f7d862d
cpu/esp32: fix typo in timer documentation 2021-01-08 12:04:24 +01:00
b4458e73f2
cpu/esp32: fix typo in Doxygen comment
depenend => depend
2021-01-08 10:15:32 +01:00
Erik Ekman
2afa93c9f7 boards/esp32-ethernet-kit: Setup Kconfig to match makefiles 2020-11-28 10:18:54 +01:00
Erik Ekman
064f58e7aa boards/esp32: add ESP32-Ethernet-Kit v1.2 board 2020-11-28 10:18:54 +01:00
Erik Ekman
db91be6ef8 cpu/esp32: add esp_jtag pseudomodule and feature
Available on esp32-wrover-kit and esp32-ethernet-kit boards.
2020-11-28 10:18:54 +01:00