Hi,
My plan is to program in C++ a stm board nucleo f446re using Zephyr in pIO (I’m not using west).
I installed the framework-zephyr but when building I keep getting errors like:
‘zephyr/kernel.h’ file not found
‘zephyr/autoconfig.h’ file not found
So I guess it doesn’t see the the framewrok-zephyr fodler with all the *.h files.
My .ini file:
[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = zephyr
build_type = debug
upload_protocol = stlink
I have added build_flags with the directories of these files but nothing.
My cmake.txt file:
cmake_minimum_required(VERSION 3.13.1)
set(DTC_OVERLAY_FILE ../nucleo_f446re.overlay)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})project(Zephyr_RTOS_STM-nucleo)
file(GLOB app_sources ${CMAKE_CURRENT_SOURCE_DIR}/../src/*.cpp)
target_sources(app PRIVATE ${app_sources})
It also doesn’t see the files in my include folder (but if I put them in the src folder it sees them).
My prj.conf file:
# # Enable C++ and new stdlib and c++20 features
CONFIG_CPP=y
CONFIG_NEWLIB_LIBC=y
CONFIG_STD_CPP20=y
# Threading and memory
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_THREAD_STACK_INFO=y
CONFIG_THREAD_MONITOR=y
CONFIG_TIMESLICING=y
CONFIG_MULTITHREADING=y
# Drivers
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_PWM=y
CONFIG_PWM_STM32=y
# Logging
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_LOG_DEFAULT_LEVEL=3
My folder tree:
├── include
│ ├── motors.hpp
│ └── README
├── lib
│ └── README
├── nucleo_f446re.overlay
├── platformio.ini
├── src
│ ├── main.cpp
│ └── motors.cpp
├── test
│ └── README
└── zephyr
├── CMakeLists.txt ├── **dts** │ └── **bindings** │ └── pwm-motors.yaml └── prj.conf
When compiling it also generates the .pio/build folder with the zephyr folder and all the *.h files.
My c_cpp_property.json:
“configurations”: \[
{
“name”: “PlatformIO”,
“includePath”: \[
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/src”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/include”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated/zephyr”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated/zephyr/syscalls”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/include”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/lib/libc/newlib/include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32/common”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/drivers”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32/stm32f4x”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/cmsis/CMSIS/Core/Include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/cmsis_6/CMSIS/Core/Include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/modules/cmsis_6”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/stm32f4xx/soc”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/common_ll/include”,
\],
“browse”: {
“limitSymbolsToIncludedHeaders”: true,
“path”: \[
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/src”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/include”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated/zephyr”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated/zephyr/syscalls”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/include”,
“/Users/danilomessina/Documents/GIT_repository/robot/Projects/Zephyr_RTOS_STM-nucleo/.pio/build/nucleo_f446re/zephyr/include/generated”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/lib/libc/newlib/include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32/common”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/drivers”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/soc/st/stm32/stm32f4x”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/cmsis/CMSIS/Core/Include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/cmsis_6/CMSIS/Core/Include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/modules/cmsis_6”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/stm32f4xx/soc”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include”,
“/Users/danilomessina/.platformio/packages/framework-zephyr/\_pio/modules/hal/stm32/stm32cube/common_ll/include”,
\]
},
Help!