So in my zephyr directory inside the root platformio project looks like this:
In the root zephyr CMakeLists.txt I’ve added the drivers path above to the ZEPHYR_EXTRA_MODULES. When running the build, zephyr didn’t complain and seemed to understand that I put a custom module there. But when platformio compiling, it stopped and gave me error:
*** [.pio/build/solemetrix_dwm1001/………solemetrix-repo__gms-firmware__zephyr__drivers__m24m02__zephyr/modules/m24m02/m24m02.c.o] Source
src/drivers/m24m02/zephyr/m24m02.c' not found, needed by target .pio/build/solemetrix_dwm1001/……__…__solemetrix-repo__gms-firmware__zephyr__drivers__m24m02__zephyr/modules/m24m02/m24m02.c.o’.
I replicated the the project structure and managed to compile it using west build. Please kindly advise to get it working in platformio.