devbis / st7789_mpy

Fast pure-C driver for MicroPython that can handle display modules on ST7789 chip
MIT License
195 stars 43 forks source link

compilation error #9

Closed LDS79 closed 4 years ago

LDS79 commented 4 years ago

Hi, after I performed: make USER_C_MODULES=../../../st7789_mpy/ all The building start to work but in the middle of process I get that error:

build-GENERIC/frozen_content.c:71:5: error: redeclaration of enumerator 'MP_QSTR_color' MP_QSTR_color, ^ In file included from ../../py/obj.h:31:0, from ../../py/objint.h:30, from build-GENERIC/frozen_content.c:15: build-GENERIC/genhdr/qstrdefs.generated.h:512:6: note: previous definition of 'MP_QSTR_color' was here QDEF(MP_QSTR_color, (const byte*)"\xd8\x06\x05" "color") ^ ../../py/qstr.h:41:23: note: in definition of macro 'QDEF'

define QDEF(id, str) id,

                   ^

make: *** [build-GENERIC/build-GENERIC/frozen_content.o] Error 1

Thanks

LDS79 commented 4 years ago

after removed the folder build-GENERIC and repeated the command: make USER_C_MODULES=../../../st7789_mpy/ all

I got this error message: CC ../../../st7789_mpy/st7789/st7789.c ../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_make_new': ../../../st7789_mpy/st7789/st7789.c:717:29: error: passing argument 1 of 'mp_raise_ValueError' from incompatible pointer type [-Werror=incompatible-pointer-types] mp_raise_ValueError("Unsupported display. Only 240x240 and 135x240 are supported"); ^ In file included from ../../../st7789_mpy/st7789/st7789.c:29:0: ../../py/runtime.h:167:15: note: expected 'mp_rom_error_text_t {aka struct }' but argument is of type 'char ' NORETURN void mp_raise_ValueError(mp_rom_error_text_t msg); ^ ../../../st7789_mpy/st7789/st7789.c:722:29: error: passing argument 1 of 'mp_raise_ValueError' from incompatible pointer type [-Werror=incompatible-pointer-types] mp_raise_ValueError("must specify all of reset/dc pins"); ^ In file included from ../../../st7789_mpy/st7789/st7789.c:29:0: ../../py/runtime.h:167:15: note: expected 'mp_rom_error_text_t {aka struct }' but argument is of type 'char ' NORETURN void mp_raise_ValueError(mp_rom_error_text_t msg); ^ cc1: all warnings being treated as errors make: *** [build-GENERIC/st7789/st7789.o] Error 1

devbis commented 4 years ago

Could you please try the latest version?

dvarrel commented 4 years ago

have problem with compil : CC ../../../st7789_mpy/st7789/st7789.c ../../../st7789_mpy/st7789/st7789.c: In function 'st7789_ST7789_make_new': ../../../st7789_mpy/st7789/st7789.c:552:30: error: 'mp_rom_error_text_t' undeclared (first use in this function) mp_raise_ValueError((mp_rom_error_text_t)"Unsupported display. Only 240 ^ ../../../st7789_mpy/st7789/st7789.c:552:30: note: each undeclared identifier is reported only once for each function it appears in ../../../st7789_mpy/st7789/st7789.c:552:50: error: expected ')' before string constant mp_raise_ValueError((mp_rom_error_text_t)"Unsupported display. Only 240 ^ ../../../st7789_mpy/st7789/st7789.c:557:50: error: expected ')' before string constant mp_raise_ValueError((mp_rom_error_text_t)"must specify all of reset/dc ^ ../../py/mkrules.mk:47: recipe for target 'build-GENERIC/st7789/st7789.o' failed make: *** [build-GENERIC/st7789/st7789.o] Error 1

Garanti sans virus, je travaille sous Linux !

Le lun. 20 avr. 2020 à 10:11, Ivan Belokobylskiy notifications@github.com a écrit :

Could you please try the latest version?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/devbis/st7789_mpy/issues/9#issuecomment-616384891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBMTPE5JZXQ6HOVZZZDDDRNP7T7ANCNFSM4MFQ7Q6Q .

devbis commented 4 years ago

Did you clean the build directory?

make clean
make USER_C_MODULES=../../../st7789_mpy/ all

Do you use the latest micropython sources? What microcontroller do you compile for?

dvarrel commented 4 years ago

yes, it's been a long a time i've not compile that module. lot of errors...

Garanti sans virus, je travaille sous Linux !

Le lun. 20 avr. 2020 à 15:57, Ivan Belokobylskiy notifications@github.com a écrit :

Did you clean the build directory?

make clean make USER_C_MODULES=../../../st7789_mpy/ all

Do you use the latest micropython sources? What microcontroller do you compile for?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/devbis/st7789_mpy/issues/9#issuecomment-616571542, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBMTLPQJ7N6N5XKENRDZDRNRIGLANCNFSM4MFQ7Q6Q .

LDS79 commented 4 years ago

it works but only with display without CS and this is a real shame. I have Adafruit 240x240 Wide Angle (PRODUCT ID: 3787) and it's a pity that your library doesn't support it.

Anyway thanks again.

dvarrel commented 4 years ago

it's all okay for me. thanks [image: IMG_20200422_094701.jpg]

Garanti sans virus, je travaille sous Linux !

Le lun. 20 avr. 2020 à 10:11, Ivan Belokobylskiy notifications@github.com a écrit :

Could you please try the latest version?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/devbis/st7789_mpy/issues/9#issuecomment-616384891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBMTPE5JZXQ6HOVZZZDDDRNP7T7ANCNFSM4MFQ7Q6Q .

dvarrel commented 4 years ago

but it compile with esp-idf v3.3, not actual v4.x

Garanti sans virus, je travaille sous Linux !

Le mer. 22 avr. 2020 à 10:04, Damien Varrel damien.varrel@gmail.com a écrit :

it's all okay for me. thanks [image: IMG_20200422_094701.jpg]

Garanti sans virus, je travaille sous Linux !

Le lun. 20 avr. 2020 à 10:11, Ivan Belokobylskiy notifications@github.com a écrit :

Could you please try the latest version?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/devbis/st7789_mpy/issues/9#issuecomment-616384891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBMTPE5JZXQ6HOVZZZDDDRNP7T7ANCNFSM4MFQ7Q6Q .

remisarrailh commented 4 years ago

I tried to build it for ESP8266 but had an error for MP_ERROR_TEXT() so I removed it and now it compiles fines.

Using Micropython 1.12 and esp-open-sdk last version (commit c70543e57fb18e5be0315aa217bca27d0e26d23d)

Unfortunately I have a ram overflowed error

xtensa_lx106-elf-ld: region 'iram1_0_seg' overflowed by 1640 bytes

I will investigated how to remove modules I don't use, but if anyone have a solution, please feel free to tell me (a previous version of the open-sdk or micropython ?)

I'll probably fork this repo with updated information on how to compiled it on esp8266 with the compiled firmware if I manage to do it.

EDIT: Sorry didn't read the readme correctly, trying the fix Note esp8266_common.ld is in boards directory Edit esp8266_common.ld file in the ports/esp8266 dir Edit esp8266_common.ld file in the ports/esp8266/boards dir

I also had to modify Makefile

$(Q)$(PYTHON) makeimg.py $(BUILD)/firmware.elf-0x00000.bin $(BUILD)/firmware.elf-0x[0-5][1-f][1-f][1-f][1-f].bin $@

Firmware seems to works, will report back if I manage to use it. firmware-combined.zip

remisarrailh commented 4 years ago

Firmware works!

import machine
import st7789
spi = machine.SPI(1, baudrate=40000000, polarity=1)
display = st7789.ST7789(spi, 240,240, reset = machine.Pin(16, machine.Pin.OUT), dc=machine.Pin(5, machine.Pin.OUT))
display.init()
display.fill(0xF800)

20200425_144627

devbis commented 4 years ago

it works but only with display without CS and this is a real shame. I have Adafruit 240x240 Wide Angle (PRODUCT ID: 3787) and it's a pity that your library doesn't support it.

Internally it has the support for the CS pin but it was never tested because I don't have any of those displays. You can try to define the CS pin in the constructor and check the result. If it won't work, you may want to connect the CS pin on the display with the ground pin to force it to work in "no CS mode"