This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remote LCD Nokia5510/JLX12864 with ESP32
(2022-01-13, 08:29 PM)seandepagnier Wrote: and your only error is because of a warning being treated as an error?

Initially yes. Then i added this compiler flags -Wno-error=unused-const-variable -Wno-unused-const-variable and it got pass that and now it stucked here :

/home/labcnc/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: CMakeFiles/micropython.elf.dir/home/labcnc/Desktop/micropython/modules/micropython_ugfx/modugfx.c.obj:(.literal+0x14): undefined reference to `ugfx_surface_c_free'
/home/labcnc/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: CMakeFiles/micropython.elf.dir/home/labcnc/Desktop/micropython/modules/micropython_ugfx/modugfx.c.obj: in function `ugfx_display_surface_refresh':
modugfx.c:(.text+0x39b): undefined reference to `ugfx_surface_c_free'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Makefile:34: recipe for target 'all' failed
make: *** [all] Error 2

It is strange that i cant make the command 
work. it says that this is a directory and i need to point to the .cmake file i created in the micropython_ugfx folder in order to execute the command and proceed
Ok. Now i know whats going on. 

From version 1.15 and After the micropython port for esp32 changed to Cmake. Esp-idf after version 4 also.

You have made this project in the previous versions. Therefore you have a huge ports/esp32/Makefile. The nowadays cmake version Makefile is no more than 50 lines. Try to Download the latest micropython and compile your module. You will see my errors. 

The fork of micropython you have on your account on github is MicroPython v1.15-140-g3b950ed29. Exactly after the changes  Big Grin

I will try the micropython 1.14 with the corespondig esp-idf and report back. 

We are getting there....We are getting there....

Greetings from Greece
I am sorry for the delay. I had a tight schedule.

So in order to compile, this is the steps i followed if someone needs it. 
The Hash lines are comments. You should run the commands one by one in the same terminal session. 

#organize everything
cd Desktop
mkdir PypilotEsp32
cd PypilotEsp32

git clone
cd esp-idf
git fetch
git checkout 4c81978a3e2220674a432a588292a4c860eef27b
git pull
git submodule update --init --recursive
cd ..

git clone
cd micropython
git checkout 78b23c3
make -C mpy-cross
cd ports/esp32
make submodules

#now test if everything is compiling
#if it finishes without errors continue

cd ../../
mkdir modules
cd modules
git clone
cd ../ports/esp32
nano Makefile

#Now search for DRIVERS_SRC_C = $(addprefix drivers/
and change the following lines from

OBJ_MP += $(PY_O)
OBJ_MP += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o))


OBJ_MP += $(PY_O)
OBJ_SRC_C = $(SRC_C:.c=.o)
OBJ_MP += $(addprefix $(BUILD)/, $(OBJ_SRC_C:.cpp=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o))

#Save the Makefile and continue with compiling
make BOARD=GENERIC USER_C_MODULES=../../modules CFLAGS_EXTRA="-DMODULE_UGFX_ENABLED=1 -Wno-error=unused-const-variable" all
make erase
make deploy

#now when you connect to your esp32 with picocom -b 115200 /dev/ttyUSB0 you will find out that there is an error

E (767) esp_image: Image length 2008704 doesn't fit in partition length 1572864
E (767) boot: Factory app partition is not bootable
E (769) boot: No bootable app partitions in the partition table

#so we need to change the partition table because there is not enough space

nano partitions.csv

#erase everything and paste this:

# Notes: the offset of the partition table itself is set in
# $IDF_PATH/components/partition_table/Kconfig.projbuild.
# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 0x300000,
vfs,      data, fat,     0x310000, 0xF0000,

#save and continue
make clean
make BOARD=GENERIC USER_C_MODULES=../../modules CFLAGS_EXTRA="-DMODULE_UGFX_ENABLED=1 -Wno-error=unused-const-variable" all
make erase
make deploy

#now if you connect with picocom -b 115200 /dev/ttyUSB0 to your esp32 you should not have any errors
#check with import ugfx if the module is there

I have a esp32 LOLIN32 board. It doesnt have SPIRAM so i needed to change the partition table.
If you have a board with SPIRAM then you can compile with 

make BOARD=GENERIC-SPIRAM USER_C_MODULES=../../modules CFLAGS_EXTRA="-DMODULE_UGFX_ENABLED=1 -Wno-error=unused-const-variable" all

and you probably dont need to change the partition table. I dont know because i dont have such a board handy.

Hope this will help someone. I will now upload the files from pypilot and go Forward. I will write the steps for reference.


Loaded the files from the hat directory from pypilot and of course there is an error. Any help ?

wifi timeout, reconnecting wifi 0.001000047
failed to load config [Errno 2] ENOENT
wifi connecting to kagourakiLab
connect to kagourakiLab 12345678
Traceback (most recent call last):
 File "", line 14, in <module>
 File "", line 39, in <module>
 File "", line 101, in __init__
NameError: local variable referenced before assignment
Ok. I have a summary.
Sean's code for the esp32 solution is broken and need so much changes.
It doesnt load config files and has many errors.
I will fork it and make my changes.
Seems that Sean has no time to support this feauture yet.
Good luck to ya all guys

I tried to fix the error

Forum Jump:

Users browsing this thread: 1 Guest(s)