Hello NXP Community !
I am trying to setup a new repository to compile code on the MCXN947. The goal is to have a single repository that will support multiple board variants of the MCXN947 (called in my project "dcm", dcm1212" and "mcxn947-eval"). The last one (mcxn947-eval) is based on the FDR board for the MCXN947, with a daughter board attached to it. It is the only one that currently compiles, so do not worry about the others if you are looking into the issue.
In my current folder structure, I would like to have (see attached project):
- app folder for my application layer
- ecu folder that abstract the different board variants to the application (one sub folder gets compiled depending on the variant picked via CMake Preset)
- modules folder for some of my library submodule, including a generic HAL layer to abstract the sdk for the application
- mcuxpresso-sdk folder to contain my sdk
For the SDK folder, I used the Github mcuxsdk-manifests and customized the yml to only pull the MCXN serie and the component I was interested in. For anybody looking at the project attached, a simple "west update" inside the mcuxpresso-sdk folder should pull what I need.
I now seem to have a hard time figuring out how to setup my CMake system to allow everything to compile nicely together. Most of my project use the CMake library concept to add each subfolder cleanly and nicely. However, I wasn't able to do that with the SDK.
For now, the best solution I have is to manually add the SDK .c files I needs inside my ecu\sources\mcxn947-eval\board CMakeLists. It is honnestly a huge pain and doesn't work fully (for example, initializing the FlexComm in peripherals.c creates a hardware fault). I looked at a couple post in the NXP Community, but none of them seemed to work for me. I always ended up with some compilation or configuration issues when implementing them.
Note: Since the final production variant (dcm and dcm1212) will run on a custom board, I am trying to get away from get-go from the "board-defined" settings. This is why the mcxn947-eval do not use the frdm board settings in the SDK at the moment.