I need to backport a fix that’s present on Zephyr RTOS 3.x to Zephyr 2.x, since that’s the version PlatformIO supports. If you’re curious, this is the fix. I’m having trouble figuring out how best to accomplish this.
I first tried forking PlatformIO’s fork of Zephyr and using platform_packages
to install my fork instead of the normal fork:
platform_packages = framework-zephyr @ https://github.com/UrbanMachine/zephyr.git#v2.7.0-1um1
To make this install, I had to add a package.json to the repository, but after doing that it installed fine. However, when building I get this error:
#include <fsl_common.h>
^~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/big_bird_top/lib617/SmartSteppers/SmartStepper.o] Error 1
In file included from /home/tyler/.platformio/packages/framework-zephyr/include/arch/arm/aarch32/cortex_m/cmsis.h:17,
from /home/tyler/.platformio/packages/framework-zephyr/include/arch/arm/aarch32/mpu/arm_mpu_v7m.h:11,
from /home/tyler/.platformio/packages/framework-zephyr/include/arch/arm/aarch32/mpu/arm_mpu.h:14,
from /home/tyler/.platformio/packages/framework-zephyr/include/arch/arm/aarch32/arch.h:187,
from /home/tyler/.platformio/packages/framework-zephyr/include/arch/cpu.h:19,
from /home/tyler/.platformio/packages/framework-zephyr/include/kernel_includes.h:33,
from /home/tyler/.platformio/packages/framework-zephyr/include/kernel.h:17,
from /home/tyler/.platformio/packages/framework-zephyr/include/zephyr.h:18,
from lib/FirmwareBasics/FirmwareBasics.h:22,
from lib/Communicator/Communicator.h:15,
from lib/Communicator/Communicator.cpp:1:
/home/tyler/.platformio/packages/framework-zephyr/soc/arm/nxp_imx/rt/soc.h:14:10: fatal error: fsl_common.h: No such file or directory
My understanding is that this is part of the HAL for my platform, which is a Teensy 4.1.
This is when I realized that PlatformIO’s packaging of Zephyr is quite a bit more sophisticated then I at first thought. If I understand it correctly, a number of scripts take care of constructing packages for every supported package and framework combination, where the framework and the HAL for the platform are combined. That’s pretty cool! However, I’m confused as to where the best place would be for me to put my patch. Any suggestions would be really appreciated!