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
#21
(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 :


Code:
/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 
make USER_C_MODULES=../../../modules CFLAGS_EXTRA="-DMODULE_UGFX_ENABLED=1" all 
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
Reply
#22
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.

https://forum.micropython.org/viewtopic.php?f=18&t=9820

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
Reply
#23
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. 

Code:
#organize everything
cd
cd Desktop
mkdir PypilotEsp32
cd PypilotEsp32

#Esp-Idf
git clone https://github.com/espressif/esp-idf.git
cd esp-idf
git fetch
git checkout 4c81978a3e2220674a432a588292a4c860eef27b
git pull
git submodule update --init --recursive
./install.sh
source export.sh
cd ..

#micropython
git clone https://github.com/micropython/micropython.git
cd micropython
git checkout 78b23c3
make -C mpy-cross
cd ports/esp32
make submodules

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

cd ../../
mkdir modules
cd modules
git clone https://github.com/pypilot/micropython_ugfx.git
cd ../ports/esp32
nano Makefile

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

OBJ_MP =
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))

to

OBJ_MP =
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.

Giorgos

References:
https://docs.espressif.com/projects/esp-...sions.html
https://github.com/micropython/micropyth...orts/esp32

EDIT: some typos
Reply
#24
Loaded the files from the hat directory from pypilot and of course there is an error. Any help ?

Code:
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 "boot.py", line 14, in <module>
 File "lcd_esp32.py", line 39, in <module>
 File "lcd.py", line 101, in __init__
NameError: local variable referenced before assignment
Reply
#25
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

Giorgos
Reply
#26
I tried to fix the error
Reply
#27
Hello once again.

I ordered the same TTGO display 4mb you suggested. I compiled micropython with the ugfx module and uploaded the files from the hat directory with make upload.

now the esp keeps restarting and nothing happens.

here is my serial output:

Code:
wifi timeout, reconnecting wifi 0.0
wifi connecting to kagourakiLab
connect to kagourakiLab myPassword
lcd driver default True False
abort() was called at PC 0x4016c7eb on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x40099254:0x3ffcea70 0x4009963d:0x3ffcea90 0x4016c7eb:0x3ffceab0 0x4016c832:0x3ffcead0 0x4016c737:0x3ffceaf0 0x4016c276:0x3ffceb10 0x4016c791:0x3ffceb30 0x400fb621:0x3ffceb50 0x400fb4e1:0x3ffceb80 0x400faf26:0x3ffceba0 0x400e89f9:0x3ffcebc0 0x400df911:0x3ffcebe0 0x400dfa3e:0x3ffcec00 0x400ed5b1:0x3ffcec20 0x400e3a80:0x3ffcecc0 0x400df911:0x3ffcecf0 0x400dfa3e:0x3ffced10 0x400e9501:0x3ffced30 0x400e89f9:0x3ffced80 0x400df911:0x3ffceda0 0x400ed525:0x3ffcedc0 0x400e3a80:0x3ffcee60 0x400df911:0x3ffceed0 0x400df93a:0x3ffceef0 0x40105b28:0x3ffcef10 0x40105cc5:0x3ffcefa0 0x400f65d5:0x3ffceff0 0x4009a2ad:0x3ffcf020

the backtrace decodes to this : 

Code:
0x40099254: invoke_abort at panic.c:?
0x4009963d: abort at ??:?
0x4016c7eb: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
0x4016c832: std::terminate() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
0x4016c737: __cxa_throw at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
0x4016c276: operator new(unsigned int) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/new_op.cc:54
0x4016c791: operator new[](unsigned int) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/new_opv.cc:32
0x400fb621: surface::surface(int, int, int, char const*) at ??:?
0x400fb4e1: ugfx_surface_from_data_c at ??:?
0x400faf26: ugfx_surface_make_new at modugfx.c:?
0x400e89f9: type_call at objtype.c:?
0x400df911: mp_call_function_n_kw at ??:?
0x400dfa3e: mp_call_method_n_kw at ??:?
0x400ed5b1: mp_execute_bytecode at ??:?
0x400e3a80: fun_bc_call at objfun.c:?
0x400df911: mp_call_function_n_kw at ??:?
0x400dfa3e: mp_call_method_n_kw at ??:?
0x400e9501: mp_obj_instance_make_new at ??:?
0x400e89f9: type_call at objtype.c:?
0x400df911: mp_call_function_n_kw at ??:?
0x400ed525: mp_execute_bytecode at ??:?
0x400e3a80: fun_bc_call at objfun.c:?
0x400df911: mp_call_function_n_kw at ??:?
0x400df93a: mp_call_function_0 at ??:?
0x40105b28: parse_compile_execute at pyexec.c:?
0x40105cc5: pyexec_raw_repl at ??:?
0x400f65d5: mp_task at ??:?
0x4009a2ad: vPortTaskWrapper at port.c:?


i understand there is something wrong with the ugfx module. 

do you have some thoughts Sean?

Thank you, 
Giorgos
Reply
#28
I have hacked micropython in a few ways to make more memory available as well, so it's hard to say what exactly you are running. Can you specify exactly what micropython?

Your message does not give much useful debugging info which is not your fault, but unfortunate.
Reply
#29
(2022-05-13, 11:04 PM)seandepagnier Wrote: I have hacked micropython in a few ways to make more memory available as well, so it's hard to say what exactly you are running.  Can you specify exactly what micropython?

Your message does not give much useful debugging info which is not  your fault, but unfortunate.

Sorry. Been away these days. 

So my micropython is MicroPython v1.14-dirty compiled and uploaded with esp-idf v4.0

It's been so many versions and there is no reference on what version you are using. Maybe it would be more useful if you just upload your .bin file for micropython so we can upload it to the esp and then just "make upload" from the hat directory and everything will work. 

The micropython repo on your profile on github(who probably has the hacks you mention) has the new micropython and you can not make the changes (for the ugfx module you mention in the diff file) to the makefile because it is using cmake and not make so the makefile is different.

I hope you understand where is the problem. So a .bin file would be greatly apreciated. 

Giorgos
Reply
#30
(2022-05-18, 09:49 PM)kagouraki Wrote:
(2022-05-13, 11:04 PM)seandepagnier Wrote: I have hacked micropython in a few ways to make more memory available as well, so it's hard to say what exactly you are running.  Can you specify exactly what micropython?

Your message does not give much useful debugging info which is not  your fault, but unfortunate.

Sorry. Been away these days. 

So my micropython is MicroPython v1.14-dirty compiled and uploaded with esp-idf v4.0

It's been so many versions and there is no reference on what version you are using. Maybe it would be more useful if you just upload your .bin file for micropython so we can upload it to the esp and then just "make upload" from the hat directory and everything will work. 

The micropython repo on your profile on github(who probably has the hacks you mention) has the new micropython and you can not make the changes (for the ugfx module you mention in the diff file) to the makefile because it is using cmake and not make so the makefile is different.

I hope you understand where is the problem. So a .bin file would be greatly apreciated. 

Giorgos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)