WallaceWilliam / framework-esp8266-rtos-sdk-idf-platformio

Apache License 2.0
13 stars 18 forks source link

Can't compile #7

Open boriss2oo6 opened 4 years ago

boriss2oo6 commented 4 years ago

Hi @WallaceWilliam ,

Can't compile anymore after updating platform, currently i am using: Platform custom Espressif 8266

Updating custom8266 @ a31a2c4 [Up-to-date] Updating toolchain-xtensa-lx106-elf @ 5.2.0+100 [Up-to-date] Updating framework-esp8266-rtos-sdk @ d6ec931 [Up-to-date] Updating tool-curl-for-win @ 7.66.0 [Up-to-date]

And the error is:

Executing task in folder Esp8266: C:\Users\Boriss.platformio\penv\Scripts\platformio.exe run <

Processing stable (platform: custom8266; board: d1_mini; framework: esp8266-rtos-sdk)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/custom8266/d1_mini.html PLATFORM: custom Espressif 8266 1.0.0 #a31a2c4 > WeMos D1 R2 & mini HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash PACKAGES: toolchain-xtensa-lx106-elf 5.2.0+100, framework-esp8266-rtos-sdk d6ec931 Embed file $PROJECT_DIR\src/html/details.html Embed file $PROJECT_DIR\src/html/header.html Embed file $PROJECT_DIR\src/html/input.html Embed file $PROJECT_DIR\src/html/output.html Embed file $PROJECT_DIR\src/html/console.html Embed file $PROJECT_DIR\src/html/favicon.ico Embed file $PROJECT_DIR\src/html/admin.html Embed file $PROJECT_DIR\src/html/server.pem Error parse var ('$(call dequote,$(if $(CONFIG_PARTITION_TABLE_CUSTOM),$(PROJECT_PATH),$(IDF_PATH)/components/partition_table))', '$', [{'node_cur': 0, 'node_next': 1}, {'node_cur': 5, 'node_next': 1}], 2) Error parse var ('$(call dequote,$(abspath $(PARTITION_TABLE_ROOT)/$(call dequote,$(CONFIG_PARTITION_TABLE_FILENAME))))', '$', [{'node_cur': 0, 'node_next': 1}, {'node_cur': 5, 'node_next': 1}], 2) Error parse var ('fi; )', ')', [{'node_cur': 2, 'end': 1, 'node_next': 0}], 0) Error parse var ('$(shell if [ "$(OTA_DATA_OFFSET)" != "" ] && [ "$(OTA_DATA_SIZE)" != "" ]; then', '$', [{'node_cur': 0, 'node_next': 1}, {'node_cur': 5, 'node_next': 1}], 2) Error parse var ('echo $(BLANK_OTA_DATA_FILE); else echo " "; fi) )', ')', [{'node_cur': 2, 'end': 1, 'node_next': 0}], 0) Error parse var ('$(filter-out -fstack-protector%, $(CFLAGS))', '$', [{'node_cur': 0, 'node_next': 1}, {'node_cur': 5, 'node_next': 1}], 2) LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft Found 0 compatible libraries Scanning dependencies... No dependencies Evaluated 1 nodes Evaluated 2 nodes *** [.pio\build\stable\esp8266_common_out.ld] Source C:\users\boriss\.platformio\packages\framework-esp8266-rtos-sdk\components\esp8266\ld\esp8266.common.ld' not found, needed by target.pio\build\stable\esp8266_common_out.ld'. ===================================================================================================== [FAILED] Took 2.02 seconds ===================================================================================================== The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

WallaceWilliam commented 4 years ago

Hi in the current version on ESP8266_RTOS_SDK from https://github.com/espressif/ESP8266_RTOS_SDK the way of generating the LD file has been changed I will correct the error in the near future

jhubbardsf commented 4 years ago

Is there a way to downgrade and get this working or no? If not, are there any resources you used to help you make this custom framework? I was looking but I can't find any good ones.

WallaceWilliam commented 4 years ago

I cannot downgrade https://github.com/espressif/ESP8266_RTOS_SDK because I do not own this repository I just created a script that adapts ESP8266_RTOS_SDK for platformio you can try one of the old versions from https://github.com/espressif/ESP8266_RTOS_SDK. and install it in .platformio \ packages \ framework-esp8266-rtos-sdk \

boriss2oo6 commented 4 years ago

If you want to downgrade you could use a certain commit from ESP8266_RTOS_SDK to downgrade to a specific version. You should have a file at a location similar to: C:\Users\Boriss\.platformio\platforms\custom8266\platform.json

At line 34: "version": "https://github.com/espressif/ESP8266_RTOS_SDK.git" replace with something like: "version": "https://github.com/espressif/ESP8266_RTOS_SDK.git#9c19b1eedb1151828f2ddd98ff9ce1da022cd57d" and replace the commit with the one that you desire. i personally prefer to wait for @WallaceWilliam to correct the error.

WallaceWilliam commented 4 years ago

I tried to do ("version": "https://github.com/espressif/ESP8266_RTOS_SDK.git#9c19b1eedb1151828f2ddd98ff9ce1da022cd57d"), but got multiple errors. I still try to adapt the current version of ESP8266_RTOS_SDK

jhubbardsf commented 4 years ago

I tried that, I even created a public repo with version 3.1 but I was still getting errors with that as well. I didn't know enough about it to debug it properly.

WallaceWilliam commented 4 years ago

please see README.md to compile latest rtos release

PJVervoorn commented 4 years ago

Not sure if I should open a new issue, or amend this, but it seems to be the same error. The ldscript node in the json files in the boards directory point to non-existing files. examples: "eagle.flash.4m1m.ld" "eagle.flash.1m256.ld"

Executing task in folder GG: C:\Users\Peter.platformio\penv\Scripts\platformio.exe run <

Processing esp01_1m (platform: custom8266; board: esp01_1m; framework: esp8266-rtos-sdk)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/custom8266/esp01_1m.html PLATFORM: custom Espressif 8266 1.1.0 > Espressif Generic ESP8266 ESP-01 1M HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash PACKAGES:

WallaceWilliam commented 4 years ago

please specify in platformio.ini [env: esp01_1m] board_build.ldscript = but I did not test configurations other than d1_mini with 4M memory

PJVervoorn commented 4 years ago

Looks like I can test now... BTW, I also had to add: upload_protocol = esptool to the ini. Thanks so far! (I am not closing this issue, not sure if the original is solved too.)

> Executing task in folder GG: C:\Users\Peter\.platformio\penv\Scripts\platformio.exe run --target upload <

`Processing esp01_1m (platform: custom8266; board: esp01_1m; framework: esp8266-rtos-sdk)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/custom8266/esp01_1m.html PLATFORM: custom Espressif 8266 1.1.0 > Espressif Generic ESP8266 ESP-01 1M HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash PACKAGES:

Writing at 0x00001000... (100 %) Wrote 10368 bytes (6865 compressed) at 0x00001000 in 0.6 seconds (effective 135.8 kbit/s)... Hash of data verified. Compressed 3072 bytes to 105...

Writing at 0x00008000... (100 %) Wrote 3072 bytes (105 compressed) at 0x00008000 in 0.0 seconds (effective 1587.2 kbit/s)... Hash of data verified. Compressed 133472 bytes to 88727...

Writing at 0x00010000... (16 %) Writing at 0x00014000... (33 %) Writing at 0x00018000... (50 %) Writing at 0x0001c000... (66 %) Writing at 0x00020000... (83 %) Writing at 0x00024000... (100 %) Wrote 133472 bytes (88727 compressed) at 0x00010000 in 9.9 seconds (effective 108.4 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin... =============================================================================================================================================== [SUCCESS] Took 174.78 seconds ===============================================================================================================================================

WallaceWilliam commented 4 years ago

great job

PJVervoorn commented 4 years ago

Not good enough, I can't get any of the examples to work. Neither a simple blinking led, printf or start an AP works, with both the v3.2 and master branch of freertos-idf.

WallaceWilliam commented 4 years ago

I compile and upload example from framework-esp8266-rtos-sdk\examples\wifi\getting_started\station\

Building .pio\build\esp01_1m\bootloader.bin
esptool.py v2.4.0
Linking .pio\build\esp01_1m\firmware.elf
Retrieving maximum program size .pio\build\esp01_1m\firmware.elf
Checking size .pio\build\esp01_1m\firmware.elf
Building .pio\build\esp01_1m\firmware.bin
esptool.py v2.4.0
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  14.4% (used 11820 bytes from 81920 bytes)
Flash: [====      ]  42.3% (used 415862 bytes from 983040 bytes)
Configuring upload protocol...
AVAILABLE: esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM25
Uploading .pio\build\esp01_1m\firmware.bin
esptool.py v2.4.0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 11:11:11:11:11:11
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 10384 bytes to 6876...
Wrote 10384 bytes (6876 compressed) at 0x00001000 in 0.6 seconds (effective 136.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 105...
Wrote 3072 bytes (105 compressed) at 0x00008000 in 0.0 seconds (effective 1638.4 kbit/s)...
Hash of data verified.
Compressed 415952 bytes to 270760...
Wrote 415952 bytes (270760 compressed) at 0x00010000 in 23.9 seconds (effective 139.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

it works

␛[0;32mI (58) boot: Partition Table:␛[0m
␛[0;32mI (63) boot: ## Label            Usage          Type ST Offset   Length␛[0m
␛[0;32mI (74) boot:  0 nvs              WiFi data        01 02 00009000 00006000␛[0m
␛[0;32mI (86) boot:  1 phy_init         RF data          01 01 0000f000 00001000␛[0m
␛[0;32mI (97) boot:  2 factory          factory app      00 00 00010000 000f0000␛[0m
␛[0;32mI (109) boot:  3 ������k���Lk�␂^�*���P��?␄ unknown          ff ff ffffffff ffffffff␛[0m
␛[0;32mI (122) boot: End of partition table␛[0m
␛[0;32mI (128) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x50b5c (330588) map␛[0m
␛[0;32mI (142) esp_image: segment 1: paddr=0x00060b74 vaddr=0x40260b6c size=0x0e27c ( 57980) map␛[0m
␛[0;32mI (155) esp_image: segment 2: paddr=0x0006edf8 vaddr=0x3ffe8000 size=0x0067c (  1660) load␛[0m
␛[0;32mI (169) esp_image: segment 3: paddr=0x0006f47c vaddr=0x40100000 size=0x00bd0 (  3024) load␛[0m
␛[0;32mI (183) esp_image: segment 4: paddr=0x00070054 vaddr=0x40100bd0 size=0x0584c ( 22604) load␛[0m
␛[0;32mI (197) boot: Loaded app from partition at offset 0x10000␛[0m
␛[0;32mI (221) system_api: Base MAC address is not set, read default base MAC address from EFUSE␛[0m
␛[0;32mI (226) system_api: Base MAC address is not set, read default base MAC address from EFUSE␛[0m
phy_version: 1159.0, 85b471e, Apr 21 2020, 17:03:08, RTOS new
␛[0;32mI (293) phy_init: phy ver: 1159_0␛[0m
␛[0;32mI (296) reset_reason: RTC reset 2 wakeup 0 store 0, reason is 2␛[0m
␛[0;32mI (300) wifi station: ESP_WIFI_MODE_STA␛[0m
␛[0;32mI (346) wifi station: wifi_init_sta finished.␛[0m
␛[0;32mI (2775) wifi station: retry to connect to the AP␛[0m
␛[0;32mI (2778) wifi station: connect to the AP fail␛[0m

tell us more about the problem

PJVervoorn commented 4 years ago

Hi,

I tried the station example too, it compiles and uploads without issues, but doesn't do anything. This is the output of a verbose build:

> Executing task in folder mystatiom: C:\Users\Peter\.platformio\penv\Scripts\platformio.exe run --verbose --target upload <

Processing esp01_1m (platform: custom8266; board: esp01_1m; framework: esp8266-rtos-sdk; upload_protocol: esptool; monitor_speed: 115200; board_build.ldscript: )
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/custom8266/esp01_1m.html
PLATFORM: custom Espressif 8266 1.1.0 > Espressif Generic ESP8266 ESP-01 1M
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES:
 - framework-esp8266-rtos-sdk 1f5bed1 (git+https://github.com/espressif/ESP8266_RTOS_SDK.git)
 - tool-cmake 3.16.4
 - tool-curl-for-win 7.66.0
 - tool-mconf 1.4060000.20190628 (406.0.0)
 - tool-ninja 1.9.0
 - toolchain-xtensa-lx106-elf 5.2.0+100
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
<lambda>(["checkprogsize"], [".pio\build\esp01_1m\firmware.elf"])
MethodWrapper(["checkprogsize"], [".pio\build\esp01_1m\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  14.4% (used 11828 bytes from 81920 bytes)
Flash: [====      ]  42.4% (used 416379 bytes from 983040 bytes)
.pio\build\esp01_1m\firmware.elf  :

section                                         size         addr

.rtc_noinit                                        0   1610617344

.iram0.vectors                                  3024   1074790400

.iram0.text                                    22603   1074793424

.iram0.bss                                      3260   1074816028

.dram0.data                                     1668   1073643520

.noinit                                            0   1073645188

.dram0.bss                                     10160   1073645200

.flash.text                                   330576   1075904528

.flash.rodata                                  58508   1076235104

.debug_frame                                  111440            0

.debug_info                                  1289812            0

.debug_abbrev                                 163721            0

.debug_loc                                    759820            0

.debug_aranges                                 33552            0

.debug_ranges                                  33600            0

.debug_line                                   627598            0

.debug_str                                    206923            0

.comment                                         209            0

.xtensa.info                                      56            0

.xt.lit._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKc          0            0

.xt.prop._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKc         0            0

.xt.prop._ZN3nvs4ItemC2EhNS_8ItemTypeEhPKc       108            0

Total                                        3656638
<lambda>(["upload"], [".pio\build\esp01_1m\firmware.bin"])
AVAILABLE: esptool
CURRENT: upload_protocol = esptool
MethodWrapper(["upload"], [".pio\build\esp01_1m\firmware.bin"])
Auto-detected: COM4
"c:\users\peter\.platformio\penv\scripts\python.exe" "C:\Users\Peter\.platformio\packages\framework-esp8266-rtos-sdk_current\components\esptool_py\esptool\esptool.py" --chip esp8266 --port "COM4" --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 P:\PjV\VSCode\mystatiom\.pio\build\esp01_1m\bootloader.bin 0x8000 P:\PjV\VSCode\mystatiom\.pio\build\esp01_1m\partitions.bin 0x10000 .pio\build\esp01_1m\firmware.bin
esptool.py v2.4.0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: cc:50:e3:2b:65:e4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 10368 bytes to 6862...

Writing at 0x00001000... (100 %)
Wrote 10368 bytes (6862 compressed) at 0x00001000 in 0.6 seconds (effective 136.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 105...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (105 compressed) at 0x00008000 in 0.0 seconds (effective 5449.0 kbit/s)...
Hash of data verified.
Compressed 416464 bytes to 270645...

Writing at 0x00010000... (5 %)
Writing at 0x00014000... (11 %)
Writing at 0x00018000... (17 %)
Writing at 0x0001c000... (23 %)
Writing at 0x00020000... (29 %)
Writing at 0x00024000... (35 %)
Writing at 0x00028000... (41 %)
Writing at 0x0002c000... (47 %)
Writing at 0x00030000... (52 %)
Writing at 0x00034000... (58 %)
Writing at 0x00038000... (64 %)
Writing at 0x0003c000... (70 %)
Writing at 0x00040000... (76 %)
Writing at 0x00044000... (82 %)
Writing at 0x00048000... (88 %)
Writing at 0x0004c000... (94 %)
Writing at 0x00050000... (100 %)
Wrote 416464 bytes (270645 compressed) at 0x00010000 in 28.1 seconds (effective 118.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
=============================================================================================================================================== [SUCCESS] Took 53.32 seconds ===============================================================================================================================================

There are no errors and nothing is written to the serial port, makes debugging a bit difficult. What I find strange is the sections that all have 0 as address

WallaceWilliam commented 4 years ago

throw me files partitions.bin bootloader.bin firmware.bin

PJVervoorn commented 4 years ago

partitions.zip

WallaceWilliam commented 4 years ago

it work fine


load 0x3ffe8008, len 24, room 16
tail 8
chksum 0x66
load 0x3ffe8020, len 3392, room 0
tail 0
chksum 0x31
load 0x40100000, len 6880, room 8
tail 8
chksum 0x6c
␛[0;32mI (46) boot: ESP-IDF 1f5bed1 2nd stage bootloader␛[0m
␛[0;32mI (46) boot: compile time 17:34:25␛[0m```

first
in order to see readable text in the terminal you need to set the speed of 76800

second
you need to clear the memory the right amount of MB (in example 4Mb)
esptool.py --port COM4 -b 115200 write_flash 0x000000 blank_1MB.bin 0x100000 blank_1MB.bin 0x200000 blank_1MB.bin 0x300000 blank_1MB.bin

esptool.py from framework-esp8266-rtos-sdk\components\esptool_py\esptool\esptool.py 
blank_1MB.bin from framework-esp8266-rtos-sdk\components\esptool_py\esptool\test\images\one_mb_zeroes.bin 
PJVervoorn commented 4 years ago

It took quite some time, but I think I found the cause... The bootloader.bin was written to 0x1000, not to 0x00. If I manually execute esp-toolpy and specify 0X00 for the bootloader it works correct:

python C:\Users\Peter\.platformio\packages\tool-esptoolpy\esptool.py --chip esp8266 --port COM4 --baud 115200 --before no_reset --after soft_reset write_flash 0x00 .\.pio\build\esp01_1m\bootloader.bin 0x010000 .\.pio\build\esp01_1m\firmware.bin 0x8000 .\.pio\build\esp01_1m\partitions.bin
esptool.py v2.8
Serial port COM4
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: cc:50:e3:2b:32:b5
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 10368 bytes to 6861...
Wrote 10368 bytes (6861 compressed) at 0x00000000 in 0.6 seconds (effective 135.1 kbit/s)...
Hash of data verified.
Compressed 415920 bytes to 270664...
Wrote 415920 bytes (270664 compressed) at 0x00010000 in 29.7 seconds (effective 112.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 105...
Wrote 3072 bytes (105 compressed) at 0x00008000 in 0.0 seconds (effective 1003.6 kbit/s)...
Hash of data verified.

Leaving...
Soft resetting...

After a build I have run these two lines to upload:

python C:\Users\Peter\.platformio\packages\tool-esptoolpy\esptool.py --chip esp8266 --port COM4 --baud 115200 --before no_reset --after no_reset erase_flash
python C:\Users\Peter\.platformio\packages\tool-esptoolpy\esptool.py --chip esp8266 --port COM4 --baud 115200 --before no_reset --after soft_reset write_flash 0x00 .\.pio\build\esp01_1m\bootloader.bin 0x010000 .\.pio\build\esp01_1m\firmware.bin 0x8000 .\.pio\build\esp01_1m\partitions.bin
WallaceWilliam commented 4 years ago

you're right The build script was copied from espressif32. there bootloader addr is set as 0x1000. and with such settings my projects work fine. but bootloader esp8266 is set to address 0x0000 framework-esp8266-rtos-sdk \ components \ bootloader \ CMakeLists.txt

# Set values used in flash_bootloader_args.in and generate flash file
# for bootloader
esptool_py_flash_project_args (bootloader 0x0

I fixed the build script