1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Go to file
bors[bot] 92529a8d14
Merge #19785
19785: cpu/esp8266: fix region overflow with '*periph' directory in app path r=gschorcht a=hugueslarrive

### Contribution description
This pull request addresses an issue where a region overflow occurs during the generation of the `.elf` file when the application path contains a directory named '*periph'. The problem arises due to an incorrect section mapping in the `esp8266.riot-os.ld` linker script.

The issue was causing the compilation of all tests which were moved to the `tests/periph` directory by PR #19552 to fail on the ESP8266 architecture.

To resolve the issue, the `esp8266.riot-os.ld` script has been modified. The section mapping for the `*periph` directory has been changed to `*esp_common_periph`, ensuring that the correct sections are included in the final binary.

### Testing procedure
To verify the effectiveness of this fix, the following testing procedure was performed:
1. Checked out the `master` branch of the RIOT repository
2. Cleaned and built the `blinky` example for the `esp8266-esp-12x` board:
- **Expected Result**: The build process completes successfully without any region overflow errors. The resulting `blinky.elf` file is generated.
```
hugues@p700:~/github/riot_small_fixes/RIOT$ BOARD=esp8266-esp-12x make -j64 -C examples/blinky clean all | grep -v make
rm -rf /home/hugues/github/riot_small_fixes/RIOT/examples/blinky/bin/esp8266-esp-12x/pkg-build/esp8266_sdk
Building application "blinky" for "esp8266-esp-12x" with MCU "esp8266".

esptool.py v2.4.0
   text	   data	    bss	    dec	    hex	filename
 278112	   5228	  28640	 311980	  4c2ac	/home/hugues/github/riot_small_fixes/RIOT/examples/blinky/bin/esp8266-esp-12x/blinky.elf
esptool.py v2.4.0
Parsing CSV input...
```
3. Created a directory named `somethingperiph` and copied the `blinky` example into it:
```
mkdir somethingperiph && cp -a examples/blinky/ somethingperiph
```
4. Cleaned and attempted to build the `blinky` example in the `somethingperiph` directory:
- **Expected Result**: The build process fails with a linker error, indicating a region overflow issue.
```
hugues@p700:~/github/riot_small_fixes/RIOT$ BOARD=esp8266-esp-12x make -j64 -C somethingperiph/blinky clean all | grep -v make
Building application "blinky" for "esp8266-esp-12x" with MCU "esp8266".
rm -rf /home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/bin/esp8266-esp-12x/pkg-build/esp8266_sdk

esptool.py v2.4.0
/home/hugues/esp/xtensa-esp8266-elf/bin/../lib/gcc/xtensa-esp8266-elf/5.2.0/../../../../xtensa-esp8266-elf/bin/ld: /home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/bin/esp8266-esp-12x/blinky.elf section `.text' will not fit in region `iram1_0_seg'
/home/hugues/esp/xtensa-esp8266-elf/bin/../lib/gcc/xtensa-esp8266-elf/5.2.0/../../../../xtensa-esp8266-elf/bin/ld: region `iram1_0_seg' overflowed by 24372 bytes
collect2: error: ld returned 1 exit status
make: *** [/home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/bin/esp8266-esp-12x/blinky.elf] Erreur 1
```
5. Checked out this PR's branch
6. Cleaned and attempted to build the `blinky` example in the `somethingperiph` directory again:
- **Expected Result**: The build process completes successfully without any region overflow errors. The resulting `blinky.elf` file is generated.
```
hugues@p700:~/github/riot_small_fixes/RIOT$ BOARD=esp8266-esp-12x make -j64 -C somethingperiph/blinky clean all | grep -v make
Building application "blinky" for "esp8266-esp-12x" with MCU "esp8266".
rm -rf /home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/bin/esp8266-esp-12x/pkg-build/esp8266_sdk

esptool.py v2.4.0
   text	   data	    bss	    dec	    hex	filename
 278080	   5228	  28640	 311948	  4c28c	/home/hugues/github/riot_small_fixes/RIOT/somethingperiph/blinky/bin/esp8266-esp-12x/blinky.elf
esptool.py v2.4.0
Parsing CSV input...
```
7. Verified the size of the `blinky.elf` file:
- **Expected Result**: The size of the `blinky.elf` file is similar to the size obtained in step 2, indicating a successful build. However, a slight difference in size was observed due to the linker script modification.

8. Cleaned and attempted to build the `blinky` example in the `examples` directory again:
- **Expected Result**: The size of the `blinky.elf` file is similar to the size obtained in step 6.
```
hugues@p700:~/github/riot_small_fixes/RIOT$ BOARD=esp8266-esp-12x make -j64 -C examples/blinky clean all | grep -v make
Building application "blinky" for "esp8266-esp-12x" with MCU "esp8266".
rm -rf /home/hugues/github/riot_small_fixes/RIOT/examples/blinky/bin/esp8266-esp-12x/pkg-build/esp8266_sdk

esptool.py v2.4.0
   text	   data	    bss	    dec	    hex	filename
 278080	   5228	  28640	 311948	  4c28c	/home/hugues/github/riot_small_fixes/RIOT/examples/blinky/bin/esp8266-esp-12x/blinky.elf
esptool.py v2.4.0
Parsing CSV input...
```
The tests confirm that this pull request resolves the region overflow issue when the application path contains a directory named '*periph'. Additionally, all relevant tests in the `tests/periph` directory successfully compile again on the ESP8266 architecture:
```
hugues@p700:~/github/riot_small_fixes/RIOT$ for p in tests/periph/*; do BOARD=esp8266-esp-12x make -j64 -C $p clean all 2>&1 | grep elf; done
 279368	   5200	  28728	 313296	  4c7d0	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/adc/bin/esp8266-esp-12x/tests_adc.elf
 277492	   5192	  28672	 311356	  4c03c	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/cpuid/bin/esp8266-esp-12x/tests_cpuid.elf
 289044	   5264	  28856	 323164	  4ee5c	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio/bin/esp8266-esp-12x/tests_gpio.elf
 288884	   5288	  29160	 323332	  4ef04	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio_arduino/bin/esp8266-esp-12x/tests_gpio_arduino.elf
 279520	   5252	  28712	 313484	  4c88c	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/hwrng/bin/esp8266-esp-12x/tests_hwrng.elf
 292312	   5268	  28872	 326452	  4fb34	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/i2c/bin/esp8266-esp-12x/tests_i2c.elf
 284064	   5208	  28720	 317992	  4da28	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/pm/bin/esp8266-esp-12x/tests_pm.elf
 285800	   5248	  28856	 319904	  4e1a0	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/pwm/bin/esp8266-esp-12x/tests_pwm.elf
 281756	   5252	  28768	 315776	  4d180	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtc/bin/esp8266-esp-12x/tests_rtc.elf
 278832	   5192	  28704	 312728	  4c598	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt/bin/esp8266-esp-12x/tests_rtt.elf
 280552	   5252	  28736	 314540	  4ccac	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt_min/bin/esp8266-esp-12x/tests_rtt_min.elf
 294164	   5296	  30104	 329564	  5075c	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/spi/bin/esp8266-esp-12x/tests_spi.elf
 279440	   5192	  28800	 313432	  4c858	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer/bin/esp8266-esp-12x/tests_timer.elf
 278884	   5192	  28712	 312788	  4c5d4	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer_short_relative_set/bin/esp8266-esp-12x/tests_timer_short_relative_set.elf
 286756	   5248	  31920	 323924	  4f154	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart/bin/esp8266-esp-12x/tests_uart.elf
 275572	   5184	  28800	 309556	  4b934	/home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart_mode/bin/esp8266-esp-12x/tests_uart_mode.elf
hugues@p700:~/github/riot_small_fixes/RIOT$ git checkout master
Basculement sur la branche 'master'
Votre branche est à jour avec 'origin/master'.
hugues@p700:~/github/riot_small_fixes/RIOT$ for p in tests/periph/*; do BOARD=esp8266-esp-12x make -j64 -C $p clean all 2>&1 | grep Erreur; done
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/adc/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/adc/bin/esp8266-esp-12x/tests_adc.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/cpuid/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/cpuid/bin/esp8266-esp-12x/tests_cpuid.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio/bin/esp8266-esp-12x/tests_gpio.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio_arduino/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/gpio_arduino/bin/esp8266-esp-12x/tests_gpio_arduino.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/hwrng/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/hwrng/bin/esp8266-esp-12x/tests_hwrng.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/i2c/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/i2c/bin/esp8266-esp-12x/tests_i2c.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/pm/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/pm/bin/esp8266-esp-12x/tests_pm.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/pwm/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/pwm/bin/esp8266-esp-12x/tests_pwm.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtc/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtc/bin/esp8266-esp-12x/tests_rtc.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt/bin/esp8266-esp-12x/tests_rtt.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt_min/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/rtt_min/bin/esp8266-esp-12x/tests_rtt_min.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/spi/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/spi/bin/esp8266-esp-12x/tests_spi.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer/bin/esp8266-esp-12x/tests_timer.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer_short_relative_set/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/timer_short_relative_set/bin/esp8266-esp-12x/tests_timer_short_relative_set.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart/bin/esp8266-esp-12x/tests_uart.elf] Erreur 1
make: *** [/home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart_mode/../../../Makefile.include:761 : /home/hugues/github/riot_small_fixes/RIOT/tests/periph/uart_mode/bin/esp8266-esp-12x/tests_uart_mode.elf] Erreur 1
```

### Issues/PRs references
Highlighted in #16727, appeared whith project tree as a side effect from #19552 but pre-existing.


Co-authored-by: Hugues Larrive <hlarrive@pm.me>
2023-07-02 14:49:30 +00:00
.cargo rust: Update dependencies, use riot-wrappers from git 2023-01-24 20:12:58 +01:00
.github treewide: replace occurrences of tests/periph_ with new path 2023-05-06 15:33:03 +02:00
.vscode .vscode/settings.json: import initial RIOT-OS style 2022-11-21 21:31:12 +01:00
boards boards: Fix I2C Arduino mapping 2023-06-28 09:05:23 +02:00
bootloaders bootloaders/riotboot: fix path to cortexm ldscript test 2023-05-13 19:08:40 +02:00
core Merge #19712 2023-06-29 09:57:31 +00:00
cpu cpu/esp8266: fix region overflow with '*periph' directory in app path 2023-07-02 12:21:16 +02:00
dist dist/tools/doccheck: update exclude patterns 2023-06-26 17:24:07 +02:00
doc boards,sys/arduino: major clean up 2023-06-26 17:24:07 +02:00
drivers boards,sys/arduino: major clean up 2023-06-26 17:24:07 +02:00
examples all/gnrc: fix null pointer dereference 2023-06-22 19:43:30 -04:00
fuzzing fuzzing: Add uri_parser fuzzer setup 2022-12-19 13:03:45 +01:00
kconfigs Merge #19712 2023-06-29 09:57:31 +00:00
makefiles Merge #19712 2023-06-29 09:57:31 +00:00
pkg pkg/tinyusb: sys: fix stdio buffered inclusion in Kconfig 2023-06-17 15:12:31 +02:00
sys sys/arduino: move pseudo modules to makefiles 2023-06-28 09:09:31 +02:00
tests Merge #19712 2023-06-29 09:57:31 +00:00
.bandit codacy: disable complaining about python assert 2019-03-01 13:43:37 +01:00
.gitattributes rust: Treat Cargo.lock files as opaque 2021-12-14 13:27:42 +01:00
.gitignore .gitignore: ignore all files within .vscode/ except user's settings 2022-11-21 21:30:28 +01:00
.mailmap mailmap: deduplicate @benpicco 2020-04-28 11:58:44 +02:00
.murdock .murdock: Test rpi-pico with kconfig 2023-05-24 09:53:24 +02:00
.murdock.yml CI: use regex for branches in .murdock.yml 2022-12-07 12:53:40 +01:00
bors.toml bors.yaml: re-activate labels check + add block_labels 2023-02-23 15:49:46 +01:00
CITATION.cff CITATION.cff: Initial import 2021-10-22 10:21:57 +02:00
CODE_OF_CONDUCT.md github: add Code of Conduct 2017-12-08 09:10:01 +01:00
CODEOWNERS CODEOWNERS: fix path to test applications 2023-05-13 18:38:31 +02:00
CODING_CONVENTIONS_C++.md CODING_CONVENTIONS_C++.md: Change space after negation 2021-10-28 10:49:51 +02:00
CODING_CONVENTIONS.md Coding_Convention: clarify: none return is allowed 2021-03-08 14:46:34 +01:00
CONTRIBUTING.md CONTRIBUTING: Remove Freenode reference 2021-06-18 11:11:27 +02:00
doc.txt doc: Link concrete measures from DEVELHELP documentation 2022-01-27 13:49:25 +01:00
Kconfig Kconfig: load application configuration first 2022-04-27 10:31:23 +02:00
LICENSE LICENSE: Fix github badge 2022-08-23 09:46:56 +02:00
LOSTANDFOUND.md LOSTANDFOUND.md: Update with cpu/mips* 2022-09-27 13:43:03 +02:00
MAINTAINING.md MAINTAINING.md: add some notes on Bors 2023-02-27 17:28:16 +01:00
Makefile make: Remove mailing list advertisement 2021-05-12 11:41:25 +02:00
Makefile.base buildsystem/pkg: expand paths early 2022-01-30 19:58:52 +01:00
Makefile.dep cpu/riscv: Add PMP driver 2023-06-28 11:55:34 +02:00
Makefile.features Makefile.features: output board on error 2023-02-27 22:56:34 +01:00
Makefile.include Makefile.include: Generate lst file using objdump 2023-06-29 17:29:33 +02:00
README.md README.md: Remove HiL Badge 2023-04-05 11:28:52 +02:00
release-notes.txt release-notes.txt: add 2023.04 release notes 2023-04-27 15:25:47 +02:00
SECURITY.md SECURITY: Describe that declassification is an option 2023-01-15 16:22:32 +01:00
SUBSYSTEMS.md SUBSYSTEMS.md: add @maribu 2023-06-13 15:03:01 +02:00
uncrustify-riot.cfg uncrustify-riot.cfg: update to coding convention 2021-03-04 17:23:46 +01:00
Vagrantfile tools/packer: adapt for Ubuntu 18.04 2020-02-19 19:23:07 +01:00

Nightly CI status master GitHub release License API docs Wiki Stack Overflow questions Twitter Matrix

The friendly Operating System for IoT!

RIOT is a real-time multi-threading operating system that supports a range of devices that are typically found in the Internet of Things (IoT): 8-bit, 16-bit and 32-bit microcontrollers.

RIOT is based on the following design principles: energy-efficiency, real-time capabilities, small memory footprint, modularity, and uniform API access, independent of the underlying hardware (this API offers partial POSIX compliance).

RIOT is developed by an international open source community which is independent of specific vendors (e.g. similarly to the Linux community). RIOT is licensed with LGPLv2.1, a copyleft license which fosters indirect business models around the free open-source software platform provided by RIOT, e.g. it is possible to link closed-source code with the LGPL code.

FEATURES

RIOT provides features including, but not limited to:

  • a preemptive, tickless scheduler with priorities
  • flexible memory management
  • high resolution, long-term timers
  • MTD abstraction layer
  • File System integration
  • support 200+ boards based on AVR, MSP430, ESP8266, ESP32, RISC-V, ARM7 and ARM Cortex-M
  • the native port allows to run RIOT as-is on Linux and BSD. Multiple instances of RIOT running on a single machine can also be interconnected via a simple virtual Ethernet bridge or via a simulated IEEE 802.15.4 network (ZEP)
  • IPv6
  • 6LoWPAN (RFC4944, RFC6282, and RFC6775)
  • UDP
  • RPL (storing mode, P2P mode)
  • CoAP
  • OTA updates via SUIT
  • MQTT
  • USB (device mode)
  • Display / Touchscreen support
  • CCN-Lite
  • LoRaWAN
  • UWB
  • Bluetooth (BLE) via NimBLE

GETTING RIOT

The most convenient way to get RIOT is to clone it via Git

$ git clone https://github.com/RIOT-OS/RIOT

this will ensure that you get all the newest features and bug fixes with the caveat of an ever changing work environment.

If you prefer things more stable, you can download the source code of one of our quarter annual releases via Github as ZIP file or tarball. You can also checkout a release in a cloned Git repository using

$ git pull --tags
$ git checkout <YYYY.MM>

For more details on our release cycle, check our documentation.

GETTING STARTED

  • You want to start the RIOT? Just follow our quickstart guide or try this tutorial. For specific toolchain installation, follow instructions in the getting started page.
  • The RIOT API itself can be built from the code using doxygen. The latest version of the documentation is uploaded daily to doc.riot-os.org.

FORUM

Do you have a question, want to discuss a new feature, or just want to present your latest project using RIOT? Come over to our forum and post to your hearts content.

CONTRIBUTE

To contribute something to RIOT, please refer to our contributing document.

MAILING LISTS

LICENSE

  • Most of the code developed by the RIOT community is licensed under the GNU Lesser General Public License (LGPL) version 2.1 as published by the Free Software Foundation.
  • Some external sources, especially files developed by SICS are published under a separate license.

All code files contain licensing information.

For more information, see the RIOT website:

https://www.riot-os.org