Skip to content
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

Compiling cale-idf in target esp32c3 #39

Closed
martinberlin opened this issue Apr 12, 2021 · 3 comments · Fixed by #41
Closed

Compiling cale-idf in target esp32c3 #39

martinberlin opened this issue Apr 12, 2021 · 3 comments · Fixed by #41
Assignees
Labels
enhancement New feature or request

Comments

@martinberlin
Copy link
Owner

martinberlin commented Apr 12, 2021

Implementation branch: 39-c3

We need to exclude epd_driver from build since it's ESP32's only:
idf.py set-target esp32c3

#include "xtensa/core-macros.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[954/1012] Building C object esp-idf/epd_driver/CMakeFiles/__idf_epd_driver.dir/font.c.obj
../components/epd_driver/font.c: In function 'uncompress':
../components/epd_driver/font.c:103:68: warning: passing argument 3 of 'tinfl_decompress' from incompatible pointer type [-Wincompatible-pointer-types]
     tinfl_status decomp_status = tinfl_decompress(&decomp, source, &source_size, dest, dest, &uncompressed_size, TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);

It seems EPDiy is using some includes that are not meant to work in C3. But of course using parallel is excluded from testing this since it does not even has enough PINs for something like this.

Building this with target esp32c3 gives issues with SPI:```

../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:28: error: 'EPD_HOST' was not declared in this scope
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:28: note: suggested alternative: 'SPI_HOST'
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
SPI_HOST
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:47: error: 'DMA_CHAN' was not declared in this scope
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:47: note: suggested alternative: 'DMA_ATTR'
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
DMA_ATTR

@martinberlin martinberlin added the enhancement New feature or request label Apr 12, 2021
@martinberlin martinberlin self-assigned this Apr 12, 2021
martinberlin added a commit that referenced this issue Apr 12, 2021
@martinberlin
Copy link
Owner Author

martinberlin commented Apr 12, 2021

Next blocker:
display.update() called
E (818) spi_master: check_trans_valid(694): txdata transfer > host maximum
assertion "ret==ESP_OK" failed: file "../components/CalEPD/epdspi.cpp", line 158, function: virtual void EpdSpi::data(const uint8_t*, int)

Is transferring too much for the C3.
SPI Blocker post in esp32.com

Using display.spi_optimized = false; will not sent all X lines together.

Status: I still could not see the epaper refresh. Todo: hook analyzer with SPI and check what comes out

martinberlin added a commit that referenced this issue Apr 19, 2021
martinberlin added a commit that referenced this issue Apr 24, 2021
martinberlin added a commit that referenced this issue Apr 24, 2021
@martinberlin martinberlin pinned this issue Apr 25, 2021
@martinberlin
Copy link
Owner Author

Build and working. SPI speed does not seem to be lower. Pending to review consumption from C3 vs ESP32
Implementation and test branch: 39-c3

Not sure when this is going to be merged in master since initially was though as an experimental test. The good thing is that works correctly. Working pins are in this file:
https://github.com/martinberlin/cale-idf/blob/39-c3/config-examples/C3-riscv-spi
Just copy it to sdkconfig. GPIOS:

CONFIG_EINK_SPI_MOSI=9
CONFIG_EINK_SPI_CLK=6
CONFIG_EINK_SPI_CS=19
CONFIG_EINK_DC=18
CONFIG_EINK_RST=10
CONFIG_EINK_BUSY=7

@martinberlin martinberlin linked a pull request Jul 5, 2021 that will close this issue
martinberlin added a commit that referenced this issue Jul 5, 2021
@martinberlin
Copy link
Owner Author

Merged on 3bee8a9..61a9f4c refactor/oop branch

@martinberlin martinberlin unpinned this issue Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant