Bodmer/TJpg_Decoder

Error compiling for board AI Thinker ESP32-CAM

jokikill opened this issue · 13 comments

Hello,

I have an issue with the TJpg_Decoder on my esp32-cam code.

I tryed to create an IR vision on a tft screen, the ir is op but for the tft I have an error "...\Arduino\libraries\TJpg_Decoder-master\src/TJpg_Decoder.h:31:30: fatal error: LITTLEFS.h: No such file or directory for board AI Thinker ESP32-CAM".

For add a tft screen on my esp32-cam I followed this webpage : https://www.survivingwithandroid.com/esp32-cam-tft-display-picture-st7735/

Can you help me?

Hi Jokikill,
Im on the same Project like you. Try adding the fs.h library at the beginning (#include <fs.h>) or/and littlefs.h.

But i cant compile because Bodmers TJpg_Decoder references BYTECLIP in some files and I cant get it to work...
"undefined reference to `BYTECLIP'"

@jokikill Which version of the Arduino ESP32 board package are you using? The latest is 2.0.1.

@jokikill BYTECLIP issue has been resolved.

@jokikill Which version of the Arduino ESP32 board package are you using? The latest is 2.0.1.

@jokikill BYTECLIP issue has been resolved.

Ill will try it now if it works.
Anyways thank you very much for your work!!!

Looks like there was a change in 2.0.0 "Rename LITTLEFS to LittleFS to match ESP8266"....

espressif/arduino-esp32@c8a4010f

I have renamed header file reference so the library will now only work on ESP32 with board package 2.0.0 or later.

When compiling for board ESP32S2 Dev Module I get the error undefined reference to `BYTECLIP' in tjpgd.c. Arduino ESP32 version 2.0.1. Board is sparkfun ESP32-S2 Thing Plus and display is Adafruit 2.8" TFT LCD shield with cap touch and micro SD

@ajacobs-github This has been fixed in version 1.0.2 and should be available in the Arduino Libary manager soon.

Hi Jokikill, Im on the same Project like you. Try adding the fs.h library at the beginning (#include <fs.h>) or/and littlefs.h.

But i cant compile because Bodmers TJpg_Decoder references BYTECLIP in some files and I cant get it to work... "undefined reference to `BYTECLIP'"

I'm on the last update for it.

With the last update of Jpg_Decoder, I have always this error :

In file included from ...\CamToIli9341\CamToIli9341.ino:21:0:
...\Arduino\libraries\TJpg_Decoder-master\src/TJpg_Decoder.h:23:26: fatal error: LittleFS.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board AI Thinker ESP32-CAM.

I've switched on this tutorial for an ILI9341 https://blog.xuite.net/iamleon/blog/589421027

Hi, I am compiling the same project described by Jokikill at the beginning of this issue trail.
I am using Platformio, with the latest Espressif 32 platform 4.4.0 and I get the very same error "undefined reference to `BYTECLIP'" at the end of the linking process.
The board is the AI Thinker ESP32-CAM.
Any suggestion on how to solve the problem?
Thanks!

/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32cam/libd91/libTJpg_Decoder.a(tjpgd.c.o):(.literal.jd_decomp+0x18): undefined reference to `BYTECLIP'
/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32cam/libd91/libTJpg_Decoder.a(tjpgd.c.o): in function `block_idct':
/Users/gabriele/Documents/PlatformIO/Projects/esp32cam TFT/.pio/libdeps/esp32cam/TJpg_Decoder/src/tjpgd.c:1435: undefined reference to `BYTECLIP'
/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/gabriele/Documents/PlatformIO/Projects/esp32cam TFT/.pio/libdeps/esp32cam/TJpg_Decoder/src/tjpgd.c:1436: undefined reference to `BYTECLIP'
/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/gabriele/Documents/PlatformIO/Projects/esp32cam TFT/.pio/libdeps/esp32cam/TJpg_Decoder/src/tjpgd.c:1437: undefined reference to `BYTECLIP'
/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/gabriele/Documents/PlatformIO/Projects/esp32cam TFT/.pio/libdeps/esp32cam/TJpg_Decoder/src/tjpgd.c:1438: undefined reference to `BYTECLIP'
/Users/gabriele/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32cam/libd91/libTJpg_Decoder.a(tjpgd.c.o):/Users/gabriele/Documents/PlatformIO/Projects/esp32cam TFT/.pio/libdeps/esp32cam/TJpg_Decoder/src/tjpgd.c:1439: more undefined references to `BYTECLIP' follow
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32cam/firmware.elf] Error 1

try change
static uint8_t BYTECLIP (int val)
to
uint8_t BYTECLIP (int val)
in tjpgd.c

Interestingly the this simple change degrades rendering performance from 84ms to 99ms on the ESP32 for the Flash_Jpg example! So it is not an ideal change from that perspective for users that do not get the error (which seems to be specific to PlatformIO compilations, not the Arduino IDE ones).

image

When compiling for board ESP32S2 Dev Module I get the error undefined reference to `BYTECLIP' in tjpgd.c. Arduino ESP32 version 2.0.1. Board is sparkfun ESP32-S2 Thing Plus and display is Adafruit 2.8" TFT LCD shield with cap touch and micro SD

try to add link like this it solve the issue in platform.io
image