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
#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


Messages In This Thread
RE: Remote LCD Nokia5510/JLX12864 with ESP32 - by kagouraki - 2022-01-17, 05:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)