Jump to content

Integration with Zephyr OS - Cmake based build system


Daniel Sullivan

Recommended Posts

Hi all,

Currently trying to set up uGFX on Zephyr OS (platform is nRF52840 SoC / UC8152 E-Paper display / ILI2102 touch controller) however am coming across an issue integrating into the Cmake based build system. Never having used Cmake before, somewhat at a loss where to get started. I've managed to find some fragments of Cmake schemas for uGFX here: https://github.com/ObKo/stm32-cmake/tree/master/cmake but am not having a lot of luck (issues with paths and actually compiling the source files)

Has anyone here implemented uGFX in Zephyr OS and if so would it be possible to get a copy of your CMakeLists and how you setup the build process? It would be greatly appreciated.

 

Devs: depending on pricing, I am also open to the option of purchasing a support pack to get this set up.

Link to comment
Share on other sites

Hi,

With my solution to use Zephyr RTOS with uGFX I created my project as it is defined for Zephyr project, One makefile in the project folder and one Makefile in the src folder.

ZephyrProject
	|_ Makefile
	|_ src
		|_ Makefile

Then, the Makefile in my ZephyrProject folder is the typical Zephyr Makefile where you indicate the CONF_FILE, BOARD, SOURCE_DIR and PROJECT_BASE. And the Makefile in the src folder indicates the object and the uGFX library.

The first trick is that uGFX uses .c files, saved in GFXSRC, in the Makefile but Zephyr RTOS needs .o files, saved in obj-y.

The second trick is that is this way, zephyr Makefile searches the .o from the directory src. Therefore, you need then to indicate each uGFX file with the path to the uGFX folder.

Finally, you need to add the defines and headers from uGFX to the variable KBUILD_CFLAGS and ZEPHYRINCLUDE of Zephyr RTOS

I join to the answer the project I used to test the integration of Zephyr RTOS with uGFX.

 

Zephyr_Interface.tar.gz

Link to comment
Share on other sites

Thank you very much for that Nathan! That is a good start. The problem is that as of the last Zephyr release they've moved entirely to a Cmake based build system which trashes the makefiles every time you change the environment config (https://github.com/zephyrproject-rtos/zephyr/issues/1488)

Going to give your Makefile a go in conjunction with https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/application_development/external_lib

(Using Cmake's external project function to include it)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...