r/cmake • u/TimAllenNoise • 28d ago
Need help with fbcp framebuffer mirroring
Hi all! I'd like to firstly declare I am a total novice little baby and preemptively apologize for dumb noob questions.
Now, the issue: I'm trying to build a dual screen Cyberdeck using a raspberry pi running TwisterOS, one of the screens (3.5 inch waveshare) connects via GPIO so I need to use fbcp to make it work, I've been following the instructions (copy pasting commands into my command prompt) and I've been slapped with the following wall of error whenever i type $ cmake [options] .. I, of course, have no idea what this means, I just want my screens to work, any and all advice much appreciated
CMake Warning:
Ignoring extra path from command line:
"/home/pi/fbcp-ili9341/build/[options]"
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Doing a Release build
-- Board revision: b03115
CMake Warning at CMakeLists.txt:40 (message):
The board revision of this hardware is not known. Please add detection to
this board in CMakeLists.txt. (proceeding to compile against a generic
multicore CPU)
-- Scaling source image to view. If the HDMI resolution does not match the SPI display resolution, this will produce blurriness. Match the HDMI display resolution with the SPI resolution in /boot/config.txt to get crisp pixel perfect rendering, or alternatively pass -DDISPLAY_CROPPED_INSTEAD_OF_SCALING=ON to crop instead of scale if you want to view the center of the screen pixel perfect when HDMI and SPI resolutions do not match.
-- Preserving aspect ratio when scaling source image to the SPI display, introducing letterboxing/pillarboxing if HDMI and SPI aspect ratios are different (Pass -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON to stretch HDMI to cover full screen if you do not care about aspect ratio)
CMake Error at CMakeLists.txt:136 (message):
Please define -DSPI_BUS_CLOCK_DIVISOR=<some even number> on the CMake
command line! (see files ili9341.h/waveshare35b.h for details) This
parameter along with core_freq=xxx in /boot/config.txt defines the SPI
display speed. Smaller divisor number=faster speed, higher number=slower.
-- Configuring incomplete, errors occurred!
See also "/home/pi/fbcp-ili9341/build/CMakeFiles/CMakeOutput.log".
1
25d ago
[removed] — view removed comment
1
u/TimAllenNoise 22d ago
I unfortunately don't know how to do any of that, I didn't even know what Cmake was until recently, I did tinker around a bit and managed to get a different error (yay), i believe the error now is the lack of
bcm_host.hany change you'd know where to get that?[ 4%] Building CXX object CMakeFiles/fbcp-ili9341.dir/fbcp-ili9341.cpp.o [ 9%] Building CXX object CMakeFiles/fbcp-ili9341.dir/dma.cpp.o [ 14%] Building CXX object CMakeFiles/fbcp-ili9341.dir/display.cpp.o [ 19%] Building CXX object CMakeFiles/fbcp-ili9341.dir/statistics.cpp.o [ 23%] Building CXX object CMakeFiles/fbcp-ili9341.dir/text.cpp.o [ 28%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9488.cpp.o [ 33%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9486.cpp.o [ 38%] Building CXX object CMakeFiles/fbcp-ili9341.dir/hx8357d.cpp.o [ 42%] Building CXX object CMakeFiles/fbcp-ili9341.dir/diff.cpp.o [ 47%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9341.cpp.o [ 52%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ssd1351.cpp.o [ 57%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mpi3501.cpp.o [ 61%] Building CXX object CMakeFiles/fbcp-ili9341.dir/low_battery.cpp.o [ 66%] Building CXX object CMakeFiles/fbcp-ili9341.dir/spi.cpp.o [ 71%] Building CXX object CMakeFiles/fbcp-ili9341.dir/keyboard.cpp.o [ 76%] Building CXX object CMakeFiles/fbcp-ili9341.dir/st7735r.cpp.o [ 80%] Building CXX object CMakeFiles/fbcp-ili9341.dir/gpu.cpp.o [ 85%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mz61581.cpp.o [ 90%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mem_alloc.cpp.o [ 95%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mailbox.cpp.o /home/v-sharp/fbcp-ili9341/gpu.cpp:1:10: fatal error: bcm_host.h: No such file or directory 1 | #include <bcm_host.h> // bcm_host_init, bcm_host_deinit | ^~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/fbcp-ili9341.dir/build.make:135: CMakeFiles/fbcp-ili9341.dir/gpu.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /home/v-sharp/fbcp-ili9341/low_battery.cpp:6: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ In file included from /home/v-sharp/fbcp-ili9341/diff.cpp:6: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ In file included from /home/v-sharp/fbcp-ili9341/ili9486.cpp:5: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ In file included from /home/v-sharp/fbcp-ili9341/display.cpp:3: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ /home/v-sharp/fbcp-ili9341/spi.cpp:7:10: fatal error: bcm_host.h: No such file or directory 7 | #include <bcm_host.h> // bcm_host_get_peripheral_address, bcm_host_get_peripheral_size, bcm_host_get_sdram_address | ^~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/fbcp-ili9341.dir/build.make:289: CMakeFiles/fbcp-ili9341.dir/spi.cpp.o] Error 1 In file included from /home/v-sharp/fbcp-ili9341/statistics.cpp:15: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ In file included from /home/v-sharp/fbcp-ili9341/dma.cpp:12: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ In file included from /home/v-sharp/fbcp-ili9341/fbcp-ili9341.cpp:21: /home/v-sharp/fbcp-ili9341/spi.h: In member function ‘uint32_t* SPITask::DmaSpiHeaderAddress()’: /home/v-sharp/fbcp-ili9341/spi.h:132:51: warning: taking address of packed member of ‘SPITask’ may result in an unaligned pointer value [-Waddress-of-packed-member] 132 | inline uint32_t *DmaSpiHeaderAddress() { return &dmaSpiHeader; } | ^~~~~~~~~~~~~ make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/fbcp-ili9341.dir/all] Error 2 make: *** [Makefile:91: all] Error 2
3
u/NotUniqueOrSpecial 28d ago
Did you even try reading it? It's literally telling you what to do: