GithubHelp home page GithubHelp logo

Comments (17)

FantasyFactory avatar FantasyFactory commented on August 22, 2024 1

Hi to all !
I've simply added a line into platformio.ini:
lib_archive = false

It worked for me

from my-ttgo-watch.

 avatar commented on August 22, 2024 1

@sharandac Tried uploading the .bin provided but the watch is unresponsive...

C:\Users\User1>C:\Users\User1\Documents\Arduino\hardware\espressif\esp32/tools/esptool/esptool.exe --chip esp32 --port COM9 --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:\Users\User1\Downloads\ttgo-t-watch2020_v1.ino.bin

I believe there should be a file like ttgo-t-watch2020_v1.ino.partitions.bin to go with it.

The bin only contains the app, you can flash it with esptool, but only if you send it to the right place.
What you've done now is overwrite the bootloader and other data partitions
You'll have to reflash the watch with pio (use an older version of the project, or use the fix above if it works), to restore the bootloader.

The partitions currently used are (bootloader is not in the list, but I expect that's at 0x0):

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x640000,
app1,     app,  ota_1,   0x650000,0x640000,
spiffs,   data, spiffs,  0xc90000,0x370000,

So to flash the bin with esptool you'd have to flash it to 0x10000 (app0) or 0x650000 (app1), depending on which is the current active one.

from my-ttgo-watch.

 avatar commented on August 22, 2024 1

@cranphin Yeah, you're right. The .bin file contains the pure app and must be written to the right place.

Can someone confirm that the fix works?

The option lib_archive = false also works for me as a workaround.
Looks like whatever it does, it also results in a much shorter linker command.
It's documented here: https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-archive
Reading it I'm not entirely sure what it does, but it doesn't sound overly dangerous :)

from my-ttgo-watch.

alexkoppelman avatar alexkoppelman commented on August 22, 2024 1

did a new pull this morning and managed to build fine. Looks resolved

from my-ttgo-watch.

sharandac avatar sharandac commented on August 22, 2024 1

tkanks for your feedback!

from my-ttgo-watch.

tonhuisman avatar tonhuisman commented on August 22, 2024

Small update: After a quite long wait, and with no information whatsoever on the display (start update... isn't very informative, imho...), the phone rebooted and the update was successfully installed.
But that doesn't fix the build error.

from my-ttgo-watch.

alexkoppelman avatar alexkoppelman commented on August 22, 2024

Have the same here. Moved the folder to the root of C:\ with no success.
Environment: Windows 10, VSCode & platformio (all with latest updates)

from my-ttgo-watch.

 avatar commented on August 22, 2024

Same for me, seems the linking command is too long
Might be related to: https://community.platformio.org/t/linker-the-command-line-is-too-long-esp32/8792/2 ?

pio run -v gives:

xtensa-esp32-elf-g++ -o .pio\build\ttgo-t-watch\firmware.elf -T esp32_out.ld -nostdlib -Wl,-static -u call_user_start_cpu0 -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -Wl,-EL -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u __cxa_guard_dummy -u __cxx_fatal_exception .pio\build\ttgo-t-watch\src\app\example_app\example_app.cpp.o .pio\build\ttgo-t-watch\src\app\example_app\example_app_main.cpp.o .pio\build\ttgo-t-watch\src\app\example_app\example_app_setup.cpp.o .pio\build\ttgo-t-watch\src\app\example_app\images\example_app_48px.c.o .pio\build\ttgo-t-watch\src\app\example_app\images\example_app_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_01d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_01n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_02d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_02n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_03d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_03n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_04d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_04n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_09d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_09n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_10d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_10n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_11d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_11n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_13d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_13n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_50d_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\owm_50n_64px.c.o .pio\build\ttgo-t-watch\src\app\weather\images\resolve_owm_icon.cpp.o .pio\build\ttgo-t-watch\src\app\weather\weather.cpp.o .pio\build\ttgo-t-watch\src\app\weather\weather_fetch.cpp.o .pio\build\ttgo-t-watch\src\app\weather\weather_forecast.cpp.o .pio\build\ttgo-t-watch\src\app\weather\weather_setup.cpp.o .pio\build\ttgo-t-watch\src\gui\font\Ubuntu_16px.c.o .pio\build\ttgo-t-watch\src\gui\font\Ubuntu_72px.c.o .pio\build\ttgo-t-watch\src\gui\gui.cpp.o .pio\build\ttgo-t-watch\src\gui\images\battery_icon_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\bluetooth_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\brightness_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\brightness_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\check_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\down_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\exit_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\foot_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_1_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_1_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_2_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_2_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_3_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_3_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_fail_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_fail_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_n_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_n_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_ok_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_ok_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_update_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\info_update_8px.c.o .pio\build\ttgo-t-watch\src\gui\images\lock_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\move_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\move_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\refresh_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\setup_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\setup_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\time_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\time_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\trash_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\unlock_16px.c.o .pio\build\ttgo-t-watch\src\gui\images\up_32px.c.o .pio\build\ttgo-t-watch\src\gui\images\update_64px.c.o .pio\build\ttgo-t-watch\src\gui\images\wifi_64px.c.o .pio\build\ttgo-t-watch\src\gui\keyboard.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\app_tile\app_tile.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\main_tile\main_tile.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\mainbar.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\note_tile\note_tile.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\battery_settings\battery_settings.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\battery_settings\battery_view.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\display_settings\display_setting.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\move_settings\move_settings.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\setup.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\time_settings\time_settings.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\update\update.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\update\update_check_version.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\update\update_setup.cpp.o .pio\build\ttgo-t-watch\src\gui\mainbar\setup_tile\wlan_settings\wlan_settings.cpp.o .pio\build\ttgo-t-watch\src\gui\screenshot.cpp.o .pio\build\ttgo-t-watch\src\gui\splashscreen.cpp.o .pio\build\ttgo-t-watch\src\gui\statusbar.cpp.o .pio\build\ttgo-t-watch\src\hardware\bma.cpp.o .pio\build\ttgo-t-watch\src\hardware\display.cpp.o .pio\build\ttgo-t-watch\src\hardware\motor.cpp.o .pio\build\ttgo-t-watch\src\hardware\pmu.cpp.o .pio\build\ttgo-t-watch\src\hardware\powermgm.cpp.o .pio\build\ttgo-t-watch\src\hardware\sound.cpp.o .pio\build\ttgo-t-watch\src\hardware\timesync.cpp.o .pio\build\ttgo-t-watch\src\hardware\touch.cpp.o .pio\build\ttgo-t-watch\src\hardware\wifictl.cpp.o .pio\build\ttgo-t-watch\src\my-ttgo-watch.ino.cpp.o .pio\build\ttgo-t-watch\src\webserver\webserver.cpp.o -L.pio\build\ttgo-t-watch -LC:\Users\Jeroen\.platformio\packages\framework-arduinoespressif32\tools\sdk\lib -LC:\Users\Jeroen\.platformio\packages\framework-arduinoespressif32\tools\sdk\ld -Wl,--start-group .pio\build\ttgo-t-watch\lib55e\libWire.a .pio\build\ttgo-t-watch\libf9d\libTicker.a .pio\build\ttgo-t-watch\lib58f\libSPI.a .pio\build\ttgo-t-watch\libf7b\libFS.a .pio\build\ttgo-t-watch\lib86e\libSPIFFS.a .pio\build\ttgo-t-watch\lib40f\libSD.a ".pio\build\ttgo-t-watch\lib98d\libTTGO TWatch Library.a" .pio\build\ttgo-t-watch\lib68e\libAsyncTCP.a .pio\build\ttgo-t-watch\lib031\libWiFi.a .pio\build\ttgo-t-watch\lib0c7\libArduinoJson.a ".pio\build\ttgo-t-watch\libae0\libESP Async WebServer.a" .pio\build\ttgo-t-watch\lib3e4\libESP32SSPD.a .pio\build\ttgo-t-watch\lib779\libWiFiClientSecure.a .pio\build\ttgo-t-watch\libd4f\libHTTPClient.a .pio\build\ttgo-t-watch\libd79\libUpdate.a .pio\build\ttgo-t-watch\libb5f\libHTTPUpdate.a .pio\build\ttgo-t-watch\libFrameworkArduinoVariant.a .pio\build\ttgo-t-watch\libFrameworkArduino.a -lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lprotocomm -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lfr -lstdc++ -Wl,--end-group
The command line is too long.

from my-ttgo-watch.

sharandac avatar sharandac commented on August 22, 2024

Thanks for the information! Unfortunately I can't confirm this, I don't have Windows to test it. I think this is a problem which only exists under Windows. Any ideas?

from my-ttgo-watch.

 avatar commented on August 22, 2024

Thanks for the information! Unfortunately I can't confirm this, I don't have Windows to test it. I think this is a problem which only exists under Windows. Any ideas?

@sharandac ,
This is a Windows issue yes.
The 'root' cause is that windows is more limited to command line length then unix alike systems.

That said, if you read the platformio issue I linked, you'll see that platformio is supposed to automatically apply a workaround for this issue on windows, by using a text file to provide arguments instead of directly via the command line.

Maybe that fix doesn't work (well), for example maybe there's a corner case where the workaround isn't triggered yet, but the line is already too long.
I've added a comment/link there back to here, maybe someone will pick it up there if we're lucky.

Alternatively, from your project there might be some fixes possible also.
If you look at my output, you'll see that it's the linker command line which becomes too long (~8k characters).
Anything that would shorten that line would fix the issue, maybe:

  • Change paths to shorter or less deep ones (from the project root, the project location doesn't matter if you look at the line created).
  • Have less files to link in the project (less c/source files).
  • Somehow change parts to be linked together in one file that's linked in the final linking stage, in esp-idf I would use components for that, I'm not sure what options arduino/platformio has for that, other then making part a library.

from my-ttgo-watch.

tonhuisman avatar tonhuisman commented on August 22, 2024

As the information in the link @cranphin provides suggests, this is most likely a bug in platformio, as, how I read it there, pio is supposed to use a command-file if the command-line grows too long. Don't know if this is configurable from platformio.ini.

from my-ttgo-watch.

ondragu avatar ondragu commented on August 22, 2024

I´m having the same problem since a few days. Must be an platformio update issue. Before everything was fine.
Is there a different way to compile perhaps in arduino ?
Or can you upload a .bin file ?

from my-ttgo-watch.

 avatar commented on August 22, 2024

I´m having the same problem since a few days. Must be an platformio update issue. Before everything was fine.
Just to be clear, I don't think it's a platformio update issue, but a longer existing issue which is triggered once a project has a lot of files to compile and link :)

from my-ttgo-watch.

sharandac avatar sharandac commented on August 22, 2024

@ondragu take a look in the repository, here you can find an actual ttgo-t-watch2020_v1.ino.bin file to upload to your device via webserver or directly with the build-in t-watch update ( setup/update )

from my-ttgo-watch.

grasshopper122 avatar grasshopper122 commented on August 22, 2024

@sharandac Tried uploading the .bin provided but the watch is unresponsive...

C:\Users\User1>C:\Users\User1\Documents\Arduino\hardware\espressif\esp32/tools/esptool/esptool.exe --chip esp32 --port COM9 --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:\Users\User1\Downloads\ttgo-t-watch2020_v1.ino.bin

I believe there should be a file like ttgo-t-watch2020_v1.ino.partitions.bin to go with it.

from my-ttgo-watch.

sharandac avatar sharandac commented on August 22, 2024

@cranphin Yeah, you're right. The .bin file contains the pure app and must be written to the right place.

Can someone confirm that the fix works?

from my-ttgo-watch.

tonhuisman avatar tonhuisman commented on August 22, 2024

Thanks guys!

from my-ttgo-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.