MIMXRT1060 custom board support for NXP HAL modules #48746
-
Hi, I have created a custom (out-of-tree) board for IMX RT 1061 based on MIMXRT1060_EVK Board. The application builds but does not link to the NXP HAL from modules directory and returns an error: "... undefined reference to `dcd_data'" whenever I try to configure the CODE_LOCATION.
I have also noticed that there is a CMakeLists and hal_nxp.cmake files in modules/hal/nxp/mcux folder which adds more configurations and includes directories based on the known NXP boards. for example,
What is the easiest way to add a new custom (out-of-tree) board to these make files? I know I could probably create copies of the same files and use them in my board configuration. But it seems like a lot of work to make it work. I was wondering if NXP has a better, clean solution to do this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
following, I have the same problem. |
Beta Was this translation helpful? Give feedback.
-
Edited: this comment is now outdated. These board files are included by the board's CMakeLists.txt, not hal_nxp.cmake. For me details, see #83607 (comment). Hi @raghulshanmuganathan-sigmaconnectivity , These files are board-specific for a reason. I would want to own those files, and keep them in my custom board folder, in my private repo. Once located in your board folder, you can modify the CMakeLists.txt file in your board folder to include your board-specific files. Based on the lines in hal_nxp.cmake using MCUX_BOARD related to RT1xxx, it appears these are the lines you want in your local board file. Remove the board variables here, and just point to your files/folders:
A good example of this is boards\arm\teensy4\CMakeLists.txt. This is a board using the RT1062 that is not from NXP, and this file includes the local board source files. Best regards |
Beta Was this translation helpful? Give feedback.
-
Thanks @DerekSnell . I also found this step-by-step article which does the same thing for a different NXP board. |
Beta Was this translation helpful? Give feedback.
Edited: this comment is now outdated. These board files are included by the board's CMakeLists.txt, not hal_nxp.cmake. For me details, see #83607 (comment).
Hi @raghulshanmuganathan-sigmaconnectivity ,
As you found, Zephyr support for the NXP boards uses hal_nxp.cmake to include board-specific files into the builds for the in-tree boards. This includes the dcd.c source file that is missing for your board build. The board-specific files are pulled in from the MCUXpresso SDK folders in hal_nxp, using the variable MCUX_BOARD. Once you create your own board and change the board name, this hal_nxp.cmake will no longer find these board-specific files.
These files are board-specific for a reason…