Open escherstair opened 9 months ago
Hi,
We'll plan to have this process automated in a wizard, till then, below is the list of steps to switch to a custom board:
1. Generate a new debug configuration for your custom board. I suppose you want to derive from an existing board (let's use iMX RT1064 as an example):
Go to LinkServer installation and identify existing support for desired device/board: C:\nxp\LinkServer_1.2.45>linkserver devices -f RT1064 If exists, it will list the supported boards and devices
Copy debug configuration for EVK-MIMXRT1064 board: C:\nxp\LinkServer_1.2.45>linkserver config RT1064 -o devices/my1064config.json
Edit my1064config.json and modify the board name ("board" field) to be identified as a unique entry (example: instead EVK-MIMXRT1064 use CUSTOM-MIMXRT1064) plus other needed fields (i.e. flash driver file name, memory layout, additional debug proprieties, etc.)
Issue again the identified RT1064 support, this time your board should be listed too: C:\nxp\LinkServer_1.2.45>linkserver devices -f RT1064 Family Device Board Cores
MIMXRT1064 MIMXRT1064xxxxA CUSTOM-MIMXRT1064 cm7
MIMXRT1064 MIMXRT1064xxxxA EVK-MIMXRT1064 cm7
If you have a new flash on your board, the flashdriver you mentioned in the config file should be available in: C:\nxp\LinkServer_1.2.45\binaries\Flash For details on linkserver usage, please see LinkServer_1.2.45\Readme.md
2. Project. The easiest way to have a "template" project is to start from an example of the MCUXpresso SDK. So also supposing you use iMX RT1064:
Hi @cristitep-nxp
thank you for your detailed steps.
In my case I would like customizing evkmimx8mp board (i.MX 8MQuad Evaluation Kit) - Cortex-M7.
Does LinkServer support this device too?
It's not listed in
C:\nxp\LinkServer_1.2.45>linkserver devices
Hi,
Unfortunately, LinkServer doesn't have support for Cortex-M from iMX processors in this moment. You can try to use Segger connection instead. Similarly, you should edit mcuxpresso-tools.json but for Segger connection, in "segger": {"device": "
Regards, Cristian
Hi,
thank you again.
This is quite clear for the debugging.
But, for building (compiling and linking) should I change the sdk
section inside mcuxpresso-tools.json
?
"sdk": {
"version": "2.14.0",
"path": "d:\\repos\\NXP_SDK",
"boardId": "evkmimx8mp",
"deviceId": "MIMX8ML8xxxKZ",
"coreId": "cm7_MIMX8ML8xxxKZ",
"manifestId": "SDK_2.x_EVK-MIMX8MP_manifest_v3_13"
}
I imagine, at least "boardId"
.
But where should I place my "board" source code?
I imagine that the VS code extension has some automatic steps that rely over some conventions.
Hi @cristitep-nxp
I tried changing "boardId": "custom_board"
but now I see the following <not found>
I imagine that the extension searches "the board" inside SDK path
core/boards
I imagine.
Is this the case?
But since it's a custom board, I don't think that the best location is inside the SDK itself.
Is there a parameter that can be used to specify where the extension should search for custom board files?
Thanks
Hi @escherstair,
The board, core, device and manifest identifiers are defined by the SDK itself. They are used by the extension for things like determining information necessary for connecting and using GDB servers, identifying peripheral definitions, filtering components applicable for the current project, etc. Modifying the board identifier would require changes in the manifest.xml (SDK metadata information) and it is quite difficult. Our recommendation would be not to change that ID. So, apart from having a board name in the UI that reflects the actual name of your custom board, do you want to change this for other reasons?
Source code used by the project are not influenced by the boardID from the JSON file. They can be added/removed by changing CMakeLists.txt. In case of MCUXpresso SDK, board specific files are present in the project folder.
Thanks.
Hi @DragosMiloiuNXP
So, apart from having a board name in the UI that reflects the actual name of your custom board, do you want to change this for other reasons?
Source code used by the project are not influenced by the boardID from the JSON file. They can be added/removed by changing CMakeLists.txt. In case of MCUXpresso SDK, board specific files are present in the project folder.
I thought that the extension generates automatically the proper CMakeLists.txt
based on the values set in mcuxpresso-tools.json
(when it updates the MCU
section in the UI).
But you explanation says that this is not the case and no source file is modified under the hood by the extension.
If this is the case, I can safely edit manually all the relavant files and the extension will never change/overwrite them.
Can you confirm this, please?
Hi @escherstair,
Modifications in mcuxpresso-tools.json do not trigger changes in CMake files (like CMakeLists.txt, flags.cmake, etc.). More, the CMake files are not generated or regenerated by the extension. So, any change you make to the CMake files will be preserved.
As a side note, the only changes the extension makes to the CMake files are:
set(CONFIG_USE_..., true)
will be added config.cmake.include(ide_overrides.cmake OPTIONAL)
is added so the user can build the project from command line too.Please note that inside cmake-kits.json there are settings that impact the CMake/build behavior (like "DEBUG_CONSOLE": "UART" tells CMake to link and use the UART libraries). These do not modify the CMake files, they are used to construct the command-line arguments passed to CMake.
Regards.
I see that this project has a lot of nice features, and simplifies the process of working with NXP SDK. I wonder what is the expected way to use it to create a project based on one of the templates, but for a custom board (designed starting from one of the evaluation boards). I meean, which files/folder should I create, and where. And which changes to the
.json
files inside.vscode
are needed.Thanks