smuehlst / circle-stdlib

Standard C and C++ Library Support for Circle
GNU General Public License v3.0
90 stars 17 forks source link

How to build LVGL without samples? #32

Closed dolence closed 7 months ago

dolence commented 8 months ago

I'm trying to add to LVGL to Minidexed but I couldn't finish the buiding proccess:

echo "  CC    ../CMSIS_5/CMSIS/DSP/Source/CommonTables/CommonTables.o"
make[1]: *** No rule to make target 'lvgl.h', needed by 'kernel.o'.
aarch64-none-elf-gcc -Wno-parentheses  -DAARCH=64 -mcpu=cortex-a53 -mlittle-endian -DAARCH=64 -mcpu=cortex-a53 -mlittle-endian -Wall -fsigned-char -ffreestanding -g -DUSE_FX -DUSE_PWM_AUDIO_ON_ZERO -DSAVE_VFP_REGS_ON_IRQ -DREALTIME -DSCREEN_DMA_BURST_LENGTH=1 -DARM_ALLOW_MULTI_CORE -DKERNEL_MAX_SIZE=0x400000 -D__circle__=450301 -DRASPPI=3 -DSTDLIB_SUPPORT=3 -D__VCCOREVER__=0x04000000 -U__unix__ -U__linux__  -I ../Synth_Dexed/src -I ../CMSIS_5/CMSIS/Core/Include -I ../CMSIS_5/CMSIS/DSP/Include -I ../CMSIS_5/CMSIS/DSP/PrivateInclude -I ../CMSIS_5/CMSIS/DSP/ComputeLibrary/Include -I ../circle-stdlib/libs/circle/include -I ../circle-stdlib/libs/circle/addon -I ../circle-stdlib/libs/circle/app/lib -I ../circle-stdlib/libs/circle/addon/vc4 -I ../circle-stdlib/libs/circle/addon/vc4/interface/khronos/include -I ../circle-stdlib/include -I ../circle-stdlib/install/aarch64-none-circle/include  -O3 -std=gnu99 -c -o ../CMSIS_5/CMSIS/DSP/Source/CommonTables/CommonTables.o ../CMSIS_5/CMSIS/DSP/Source/CommonTables/CommonTables.c
make: *** [Makefile:11: minidexed] Error 2

I have made a copy of _lvconf.h to Minidexed src dir but I'm not sure if it is being used isntead of the one on circle-stdlib LVGL directory. Any toughts?

rsta2 commented 8 months ago

To add LVGL support, you must checkout the submodule in circle-stdlib/libs/circle/addon/lvgl, make it, add the CLVGL class to your project and initialize it properly by calling CLVGL::Initialize(). Then you must call CLVGL::Update() in the main loop of your application. If you want to modify lv_conf.h, you must do this in the directory mentioned above.

This is a sample program, which adds LVGL support to a circle-stdlib application:

lvgltest.zip

dolence commented 8 months ago

Thank you for taking your time to help me through this. It still throwing errors, tho. Funny thing is that I managed to run LVGL on circle without the MiniDexed files before. I may be missing something.

ake[1]: Entering directory '/home/dolence/MiniDexed/circle-stdlib/libs/circle/addon/lvgl'
make[1]: 'liblvgl.a' is up to date.
make[1]: Leaving directory '/home/dolence/MiniDexed/circle-stdlib/libs/circle/addon/lvgl'
make -C src -j
make[1]: Entering directory '/home/dolence/MiniDexed/src'
  CPP   main.o
  CPP   kernel.o
kernel.cpp: In constructor 'CKernel::CKernel()':
kernel.cpp:38:29: error: no matching function for call to 'CScreenDevice::CScreenDevice()'
   38 |  m_GUI(&mScreen, &mInterrupt)
      |                             ^
In file included from circle_stdlib_app.h:23,
                 from kernel.h:23,
                 from kernel.cpp:20:
../circle-stdlib/libs/circle/include/circle/screen.h:158:2: note: candidate: 'CScreenDevice::CScreenDevice(unsigned int, unsigned int, boolean, unsigned int)'
  158 |  CScreenDevice (unsigned nWidth, unsigned nHeight, boolean bVirtual = FALSE,
      |  ^~~~~~~~~~~~~
../circle-stdlib/libs/circle/include/circle/screen.h:158:2: note:   candidate expects 4 arguments, 0 provided
../circle-stdlib/libs/circle/include/circle/screen.h:151:7: note: candidate: 'constexpr CScreenDevice::CScreenDevice(const CScreenDevice&)'
  151 | class CScreenDevice : public CDevice /// Writing characters to screen
      |       ^~~~~~~~~~~~~
../circle-stdlib/libs/circle/include/circle/screen.h:151:7: note:   candidate expects 1 argument, 0 provided
kernel.cpp:38:29: error: no matching function for call to 'CLVGL::CLVGL(CWriteBufferDevice*, CInterruptSystem*)'
   38 |  m_GUI(&mScreen, &mInterrupt)
      |                             ^
In file included from kernel.h:29,
                 from kernel.cpp:20:
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:39:2: note: candidate: 'CLVGL::CLVGL(CBcmFrameBuffer*, CInterruptSystem*)'
   39 |  CLVGL (CBcmFrameBuffer *pFrameBuffer, CInterruptSystem *pInterrupt);
      |  ^~~~~
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:39:26: note:   no known conversion for argument 1 from 'CWriteBufferDevice*' to 'CBcmFrameBuffer*'
   39 |  CLVGL (CBcmFrameBuffer *pFrameBuffer, CInterruptSystem *pInterrupt);
      |         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:38:2: note: candidate: 'CLVGL::CLVGL(CScreenDevice*, CInterruptSystem*)'
   38 |  CLVGL (CScreenDevice *pScreen, CInterruptSystem *pInterrupt);
      |  ^~~~~
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:38:24: note:   no known conversion for argument 1 from 'CWriteBufferDevice*' to 'CScreenDevice*'
   38 |  CLVGL (CScreenDevice *pScreen, CInterruptSystem *pInterrupt);
      |         ~~~~~~~~~~~~~~~^~~~~~~
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:35:7: note: candidate: 'constexpr CLVGL::CLVGL(const CLVGL&)'
   35 | class CLVGL
      |       ^~~~~
../circle-stdlib/libs/circle/addon/lvgl/lvgl.h:35:7: note:   candidate expects 1 argument, 2 provided
make[1]: *** [../circle-stdlib/libs/circle/Rules.mk:196: kernel.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dolence/MiniDexed/src'
make: *** [Makefile:11: minidexed] Error 2
rsta2 commented 8 months ago

In MiniDexed the instance of CScreenDevice has the name mScreenUnbuffered. Thus it must be m_GUI(&mScreenUnbuffered, &mInterrupt) in the initializer list.

dolence commented 8 months ago

This worked! I didn't realize that there was a circle_stdlib_app.h file already initializing screen. I'm goinf to test on hardware, thank you!

smuehlst commented 7 months ago

Looks like this was resolved, therefore I close this issue.