My team and I are starting on a long, multi-year development project based on the RT1170 family of processors and have chosen Zephyr as our RTOS based on the apparent "all-in" strategy from NXP on Zephyr while moving away from ThreadX/Azure.
We have followed all the tutorials and everything is fine with standard zephyr sample projects like hello world and blinky.. Now we have run into a wall. The reality is that no one releases hellow world or blinky... and no one targets the EVK boards. We have started on our own custom board definition and created a project that builds using the standard zephyr meta tool west. Now we're having a very hard time getting that project to import into the MCUXpresso in VSCode. The import tool appears to think the project is a standard CMake project rather than Zephyr.
Are there any resources available showing, from start to finish, how to build real project on a custom board? My initial search did not turn up anything.
Thanks!
-Matt
Hi @armstrom
You can refer to
Zephyr™ OS for Edge Connected Devices | NXP Semiconductors
Training Zephyr Getting Started RT1060 · nxp-mcuxpresso/vscode-for-mcux Wiki · GitHub
Hope this will help you.
BR
Hang
Hi @armstrom
Here are some steps and recommendations to help you achieve this:
1. Check CMakeLists.txt and Board Configuration
Your project’s CMakeLists.txt should properly reference Zephyr and your custom board configuration.
• Ensure that your CMakeLists.txt includes the necessary Zephyr initialization commands:
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(your_project_name)
target_sources(app PRIVATE src/main.c)
• Your custom board files should be correctly placed in the boards/arm/your_custom_board/ directory within your Zephyr workspace.
2. Importing a Zephyr Project into MCUXpresso
Since your project is recognized as a generic CMake project rather than a Zephyr project, you may need to manually adjust the project settings in MCUXpresso:
• Import the Project Manually: Use the “Open Folder” feature in VSCode to open your project’s root directory. This should load the project in the workspace, but it might still be treated as a CMake project.
• Update Configuration Files: You may need to create or update configuration files like .vscode/settings.json to ensure that Zephyr is correctly identified:
{
"cmake.configureArgs": [
"-DBOARD=your_custom_board"
],
"cmake.generator": "Ninja",
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.toolchainFile": "$ENV{ZEPHYR_BASE}/cmake/toolchain/zephyr/arm/toolchain.cmake"
}
• This configuration tells VSCode (and MCUXpresso) to treat the project as a Zephyr project and provides the necessary build arguments.
3. Zephyr-Specific CMake Integration
If the project is still not recognized as a Zephyr project, you can try explicitly specifying Zephyr in your CMakeLists.txt:
• Add the following line at the beginning of your CMakeLists.txt:
set(ZEPHYR_TOOLCHAIN_VARIANT zephyr)
set(BOARD your_custom_board)
• Alternatively, set these as environment variables or in your VSCode configuration:
"cmake.configureSettings": {
"ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
"BOARD": "your_custom_board"
}
You can also refer to this link
Solved: Import a Zephyr project - NXP Community
BR
Hang