-
Notifications
You must be signed in to change notification settings - Fork 48
Compile error with esp32-C3 #303
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
Comments
I just pushed a commit that should fix the problem. |
also, your build command is incorrect it should be
with 4mb of flash space I really suggest not using |
Thanks for updates and tips. In addition A fatal error occurred. The crash dump printed below may be used to help To learn more about how to debug and/or report this crash visit the wiki LVGL MicroPython Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled. Core 1 register dump: Backtrace: 0xfffffffd:0x3fcbe090 0x42003047:0x3fcbe0b0 0x42002d9d:0x3fcbe0f0 0x420d1427:0x3fcbe130 ELF file SHA256: 8192802af Rebooting... My code is as follows display settings_WIDTH = const(240) _MOSI = const(17) _LCD_CS = const(-1) _TOUCH_CS = const(18)_TOUCH_FREQ = const(10000000)spi_bus = machine.SPI.Bus( display_bus = lcd_bus.SPIBus( we are going to let the display driver sort out the best freame buffer size and where to allocate it to.fb1 = display_bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_INTERNAL | lcd_bus.MEMORY_DMA)fb2 = display_bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_INTERNAL | lcd_bus.MEMORY_DMA)import st7789 # NOQA display = st7789.ST7789( display.set_power(True) scrn = lv.screen_active() label = lv.label(scrn) import task_handler # NOQA ` |
you don't have a _BUFFER_SIZE constant |
it would also be helpful if you would decode the backtrace from the error. You can look up how to do it by doing a good search for "ESP32 decode backtrace" The firmware you are running is also for an ESP32 S3 and not an ESP32 C3. |
OK sorry about the S3 comment. I didn't realize that was a different MCU. I am going to need to know more information, if you can provide me a link to the data sheet for the board that would be very helpful. I also need to know the exact build command you are using. |
This is my data sheet using the MCU ESP32 S3 N16R8 esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf My build command |
are you sure that you have the WROOM-1 and not the WROOM-2? The WROOM-2 has octal SPIRAM and also octal FLASH.. You can try adding |
give this a try for your script.. import lcd_bus
from micropython import const
import machine
_WIDTH = const(240)
_HEIGHT = const(240)
_BL = const(4)
_RST = const(21)
_DC = const(16)
_MOSI = const(17)
_MISO = const(-1)
_SCK = const(18)
_HOST = const(1) # SPI2
_LCD_CS = const(-1)
_LCD_FREQ = const(40000000)
spi_bus = machine.SPI.Bus(
host=_HOST,
mosi=_MOSI,
miso=_MISO,
sck=_SCK
)
display_bus = lcd_bus.SPIBus(
spi_bus=spi_bus,
freq=_LCD_FREQ,
dc=_DC,
cs=_LCD_CS,
)
import st7789 # NOQA
import lvgl as lv # NOQA
display = st7789.ST7789(
data_bus=display_bus,
display_width=_WIDTH,
display_height=_HEIGHT,
backlight_pin=_BL,
reset_pin=_RST,
reset_state=st7789.STATE_LOW,
color_space=lv.COLOR_FORMAT.RGB565,
color_byte_order=st7789.BYTE_ORDER_BGR,
rgb565_byte_swap=True,
)
display.set_power(True)
display.init()
display.set_backlight(100)
scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)
label = lv.label(scrn)
label.set_text('HELLO WORLD!')
label.align(lv.ALIGN.CENTER, 0, -50)
import task_handler # NOQA
task_handler.TaskHandler() |
I think you have gotten a counterfeit ESP32. Espressif has their name etched into the chip with their logo. I am not seeing that on yours. This has happened to me with ones I bought from Amazon. |
and there is the answer. use |
Thanks for the tip. |
I used the following command to compile the firmware for ESP32 - C3, but after an error was prompted, the compilation could no longer proceed.
python3 make.py --optimize-size --flash-size=4 esp32 BOARD=ESP32_GENERIC_C3 DISPLAY=st7789
Error:
[1240/1935] Building C object esp-idf/main_esp32c3/CMakeFiles/idf_main_esp32c3.dir//usb.c.obj
[1242/1935] Building C object esp-idf/main_esp32c3/CMakeFiles/idf_main_esp32c3.dir//usb_serial_jtag.c.obj
FAILED: esp-idf/main_esp32c3/CMakeFiles/idf_main_esp32c3.dir//usb_serial_jtag.c.obj
The text was updated successfully, but these errors were encountered: