Skip to content

Compile errors for ESP32-C3 #5071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jason2866 opened this issue Apr 17, 2021 · 5 comments
Closed

Compile errors for ESP32-C3 #5071

Jason2866 opened this issue Apr 17, 2021 · 5 comments

Comments

@Jason2866
Copy link
Collaborator

Hi great work for supporting the C3!!

I encountered two errors from core when trying to compile project Tasmota for the C3
1st:
https://github.com/espressif/arduino-esp32/blob/master/tools/platformio-build-esp32c3.py#L74
it seems not supported from riscv32 gcc. Removing did solve
2nd:
https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/Esp.h#L114
not working for C3

@me-no-dev can you take a look?

Thx Jason

@me-no-dev
Copy link
Member

@Jason2866 I did not encounter any build errors. Flags are extracted from ESP-IDF's build. As for some things not working... yeah :) still in early alpha

@Jason2866
Copy link
Collaborator Author

Changing too

{
    uint32_t ccount;
    //__asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount));
    asm volatile ("rdcycle x1" : "=r" (ccount) );
    return ccount;
}

in Esp.h solved

@Jason2866
Copy link
Collaborator Author

Jason2866 commented Apr 17, 2021

First error is corrected with commit 5d9b98c

@lbernstone
Copy link
Contributor

lbernstone commented Apr 17, 2021

That change crashes my C3. Does systimer_hal_get_counter_value(SYSTIMER_COUNTER_0); from hal/systimer_hal.h give you the correct value? This should ultimately work for all the devices once the hal is functional.

@Jason2866
Copy link
Collaborator Author

Jason2866 commented Apr 17, 2021

Yes, you are right. Thx for your suggestion. Looks better now. Now crashes later ;-)
Btw. got it going to compile the ESP-C3 with Platformio. Did a homebrew setup to support the riscv toolchain.

[env:tasmota32c3]
extends                     = env:tasmota32_base
board                       = esp32c3
platform                    = https://github.com/Jason2866/platform-espressif32.git#feature/arduino-c3
platform_packages           = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/v.2.0.0.pre/framework-arduinoespressif32-master-cf457d412.tar.gz
                              ; needed toolchain for Windows
                              toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-win32.zip
                              ; needed toolchain for Linux
                              ;toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-linux-amd64.tar.gz
                              ; needed toolchain for MacOS
                              ;toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-macos.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants