Skip to content

Fix giga display config. #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: arduino
Choose a base branch
from

Conversation

iabdalkader
Copy link

The SMH will not be enabled for the shield by default, so we need to enable it here. There's also a new option to enable SMH for the display (and configure its attributes) which is used here. This should be merged when zephyrproject-rtos/zephyr#89246 is merged and after an update.

Note this dc22eb9 can probably be reverted. The whole SDRAM can be used for SMH, unless some other drivers use SDRAM outside of SMH (in this case they should also be converted to use SMH).

Probably a copy&paste error.
The LTDC will have its own SMH option, and the upstream shield
config will Not enable this by default.
@KurtE
Copy link

KurtE commented Apr 30, 2025

@iabdalkader - I tried bringing this into my current build and it fails to build the variant:

/home/kurte/git/ArduinoCore-zephyr/loader/../variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf:50: warning: attempt to assign the value '2' to the undefined symbol STM32_LTDC_FB_SMH_ATTRIBUTE
Parsing /home/kurte/git/zephyr/Kconfig

Now that I look at it, looks like it failed on the same line in the code checks. as well.

Is it maybe supposed to be: CONFIG_STM32_LTDC_FB_NUM ?
And allocating two frame buffers?

@iabdalkader
Copy link
Author

This should be merged when zephyrproject-rtos/zephyr#89246 is merged and after an update.

Also this PR may change.

@KurtE
Copy link

KurtE commented May 1, 2025

This should be merged when zephyrproject-rtos/zephyr#89246 is merged and after an update.

Also this PR may change.

Thanks.
Sorry slightly off topic. But do you know of any example zephyr sketch and/or ArduinoCore-zephyr sketch to experiment with the GIGA with the display shield, that does both display and touch?

I have tried to build a few different Zephyr ones like:

(.venv) D:\zephyrproject\zephyr>west build -p -b  arduino_giga_r1//m7 --shield giga_display_shield  samples\modules\lvgl\demos                                

But it fails to build.

D:/zephyrproject/zephyr/drivers/display/display_stm32_ltdc.c:422:25: error: 'CONFIG_VIDEO_BUFFER_SMH_ATTRIBUTE' undeclared (first use in this function)
  422 |                         CONFIG_VIDEO_BUFFER_SMH_ATTRIBUTE,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: My zephyr branch I am using is one that I have changes to add the Teensy Micromod board, which I rebased a few days ago.

Thanks!

@iabdalkader
Copy link
Author

I don't know of any samples that do that, but I haven't tried many samples.

But it fails to build.

Yes, that's what I'm fixing in zephyrproject-rtos/zephyr#89246

@iabdalkader
Copy link
Author

I have tried to build a few different Zephyr ones like:

@KurtE zephyrproject-rtos/zephyr#89246 has been merged, so you should be able to build the upstream samples.

@KurtE
Copy link

KurtE commented May 7, 2025

@KurtE zephyrproject-rtos/zephyr#89246 has been merged, so you should be able to build the upstream samples.

Thanks I will try it.

Note: On THIS pr I believe you will also need to update boards.txt in the root directory.
It currently has for GIGA:

giga.build.zephyr_target=arduino_giga_r1//m7
giga.build.zephyr_args=--shield giga_display_shield

And I believe that last line needs to change to:
giga.build.zephyr_args=--shield arduino_giga_display_shield

@KurtE
Copy link

KurtE commented May 7, 2025

@KurtE zephyrproject-rtos/zephyr#89246 has been merged, so you should be able to build the upstream samples.

Thanks I will try it.

I tried it and now the build fails with the code not fitting...
west build -p -b arduino_giga_r1//m7 --shield arduino_giga_display_shield samples\modules\lvgl\demos
Error message:

[522/527] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map D:/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map
C:\WINDOWS\system32\cmd.exe /C "cd . && ccache D:\Users\kurte\Downloads\zephyr-sdk-0.16.8\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./D_/Users/kurte/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=D:/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/lib..__..__Users__kurte__zephyrproject__zephyr__arch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/lib..__..__Users__kurte__zephyrproject__zephyr__arch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/lib..__..__Users__kurte__zephyrproject__zephyr__arch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/posix/options/liblib__posix__options.a  zephyr/subsys/input/libsubsys__input.a  zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/display/libdrivers__display.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/i2c/libdrivers__i2c.a  zephyr/drivers/input/libdrivers__input.a  zephyr/drivers/memc/libdrivers__memc.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/reset/libdrivers__reset.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_stm32/stm32cube/lib..__..__Users__kurte__zephyrproject__modules__hal__stm32__stm32cube.a  modules/lvgl/libmodules__lvgl.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LD:/zephyrproject/zephyr/build/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m7  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -L"d:/users/kurte/downloads/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -lc -lgcc && C:\WINDOWS\system32\cmd.exe /C "cd /D D:\zephyrproject\zephyr\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E true""
d:/users/kurte/downloads/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
d:/users/kurte/downloads/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 176920 bytes
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'D:\zephyrproject\zephyr\build'

@iabdalkader
Copy link
Author

Maybe there's not enough flash for that demo/sample, but this now builds:

west build -b arduino_giga_r1//m7 -p --shield arduino_giga_display_shield samples/subsys/display/lvgl

@iabdalkader
Copy link
Author

Note: On THIS pr I believe you will also need to update boards.txt in the root directory.

Fixed, thanks!

@KurtE
Copy link

KurtE commented May 7, 2025

Maybe there's not enough flash for that demo/sample, but this now builds:

west build -b arduino_giga_r1//m7 -p --shield arduino_giga_display_shield samples/subsys/display/lvgl

Thanks, that does build and run.

It shows hello world and a little text at bottom with what looks like loop count...
Will play more later. Hoping to see if it handle touch at all.

Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants