Project Structure and Settings
Project Structure and Settings
First, we will explain the project structure and important settings using the standard TWELITE application App_Twelite
as an example. Please select the App_Twelite
project from the [Project Explorer] in MCUXpresso.
App_Twelite/ : Source code storage location
Common/ : Source code storage location
build/ : Stores all build-related files
scripts/ : Script to embed signature data into the .bin file in the post-build process
linkscripts/ : Linker definition
Release/ : Intermediate files and generated products are stored here after a Release build
Debug/ : Intermediate files and generated products are stored here after a Debug build
MCUXpresso Settings Screen
From the menu, select [Project] > [Properties]
(or right-click the top-level project folder in the Project Explorer and select [Properties]
) to bring up the settings screen shown below. The following sections will cover how to check and operate on this settings screen.

C/C++ Settings
Source Code for Building
Source code to be built can be added or removed by making definitions in MCUXpresso. Newly added directories are usually included in the build by default.
- To exclude a resource from the build, right-click the target directory, select
[Properties..] > [C/C++ Build]
, set[Configuration]
to[All Configurations]
, and check[Exclude resource from build]
.
Build Configurations (Release/Debug)
Two types of build definitions are provided: Release and Debug.
- Release: An executable build with optimization.
- Debug: A build with debug symbols. Supports output via PRINTF macros.
Note: Since the directory for storing library files is specified using this definition name, if you create a new build definition, you will need to adjust the project definition. (In [Properties..] > [C/C++ Build] > [Settings] > [MCU C++ Linker/Libraries]
, the ${ConfigName}
part of "${workspace_loc:/TWENETxxx}/${ConfigName}"
is replaced with Release or Debug).
Build Variables
In [C/C++Build] > [Build Variables]
, you define the information required for compilation, such as the version number.
Definition | Value | Description |
---|---|---|
VERSION_MAIN | Required [0..255] | Version number (main) |
VERSION_SUB | Required [0..255] | Version number (sub) |
VERSION_VAR | Required [0..255] | Version number (variation) |
DK6_PY | Usually not needed | Python command for script execution (e.g., py.exe -3.7 )If not specified, py.exe -3 or python3 will be used. |
MCU Settings…
In the MCU settings, JN5189 is selected.
This page displays the memory map of the RAM area, but the settings in MCUXpresso are not reflected in the build. For details, please refer to RAM Allocation.

MCU Settings
Include Paths
The include paths for source files are configured here. Without this setting, building is not possible, even for the TWENETxxx
(where xxx is the library name) libraries.
- The project definitions contain redundant settings (e.g., a path is set for a project that does not use the mwx library).
- The settings are defined relative to the workspace, such as
"${workspace_loc:/TWENETxxx}"
. Even if a directory namedTWENETxxx
exists, it will not be searched unless it is registered as a project in the workspace. Make sure to add the libraries as projects to your workspace.
Include paths are configured as follows. Be aware that the settings are separate for each configuration (Release/Debug).
[Properties..] > [C/C++ Build] > [Settings] > [MCU C++ Compiler] > [Includes]
(for C++ source files)[Properties..] > [C/C++ Build] > [Settings] > [MCU C Compiler] > [Includes]
(for C source files)
Most projects have the following directories added:
${ProjName}/${ProjName}
${ProjName}/Common
TWENETcmpt/source
TWENETcore/source
TWENEText/source
TWENETmcu
TWENETmcu/CMSIS
TWENETmcu/board
TWENETmcu/component
TWENETmcu/component/lists
TWENETmcu/component/uart
TWENETmcu/component/serial_manager
TWENETmcu/device
TWENETmcu/drivers
TWENETmcu/framework
TWENETmcu/framework/Common
TWENETmcu/startup
TWENETmcu/uMac
TWENETmcu/utilities
TWENETmcu/printf
TWENETmwf/source
TWENETmwx/source
TWENETstgs/source
TWENETutils/source
The first two, ${ProjName}
, are the project directory names. For App_Twelite
, App_Twelite/App_Twelite
and App_Twelite/Common
are specified. Edit this according to the directory layout of the libraries and source code referenced by your project.
Preprocessor Definitions
Preprocessor definitions are set as follows. Be aware that the settings are separate for each configuration (Release/Debug).
[Properties..] > [C/C++ Build] > [Settings] > [MCU C++ Compiler] > [Preprocessors]
(for C++ source files)[Properties..] > [C/C++ Build] > [Settings] > [MCU C Compiler] > [Preprocessors]
(for C source files)
Here is an explanation of some of the definitions:
Definition | Value | Description |
---|---|---|
VERSION_MAIN | ${VERSION_MAIN} | Cites the setting value from [Build Variable] |
VERSION_SUB | ${VERSION_SUB} | Cites the setting value from [Build Variable] |
VERSION_VAR | ${VERSION_VAR} | Cites the setting value from [Build Variable] |
CPU_JN518X | Set during a TWELITE GOLD (JN518x) build. Used for writing device-specific code. | |
TOCONET_DEBUG | 0 or 1 | Controls internal debug output of TWENET (enabled with 1 ). This setting must be the same for the application, TWENETcore, and TWENEText when building. |
T_ENUM_INT | int16_t | The definition type for teEvent and teState used in TWENET (previously an enum with a 16-bit length compile option, but changed to int16_t to accommodate building on ARM and coexisting with C++). |
SDK_DEBUGCONSOLE | 0..2 | See About printf. |
SERIAL_PORT_TYPE_SWO | 0 or 1 | See About printf. |
DEBUG or NDEBUG | Specifies a debug or release build. |
Specifying Versions
In the build definitions written in TWENET, VERSION_MAIN
, VERSION_SUB
, and VERSION_VAR
are defined in the Makefile and are used as preprocessor definitions with the same names in the code (e.g., -DVERSION_MAIN=1
). If these definitions are not present in the code, the build will fail.
In MCUXpresso, these are defined in the Eclipse build macros under [Properties..] > [C/C++ Build] > [Build Variable]
to pass the definitions to the compiler.
Debug Definitions
In most projects, the following are defined:
VERSION_MAIN=${VERSION_MAIN}
VERSION_SUB=${VERSION_SUB}
VERSION_VAR=${VERSION_VAR}
CPU_JN518X
JN5189=5189
JENNIC_CHIP_FAMILY_JN518x
JENNIC_CHIP=JN5189
JENNIC_CHIP_JN5189
JENNIC_CHIP_FAMILY_NAME=_JN518x
TOCONET_DEBUG=1
T_ENUM_INT=int16_t
__MCUXPRESSO
__USE_CMSIS
CPU_JN5189THN
CPU_JN5189THN_cm4
SDK_DEBUGCONSOLE=1
SERIAL_PORT_TYPE_SWO=0
DEBUG
Release Definitions
In most projects, the following are defined:
VERSION_MAIN=${VERSION_MAIN}
VERSION_SUB=${VERSION_SUB}
VERSION_VAR=${VERSION_VAR}
CPU_JN518X
JN5189=5189
JENNIC_CHIP_FAMILY_JN518x
JENNIC_CHIP=JN5189
JENNIC_CHIP_JN5189
JENNIC_CHIP_FAMILY_NAME=_JN518x
T_ENUM_INT=int16_t
__MCUXPRESSO
__USE_CMSIS
CPU_JN5189THN
CPU_JN5189THN_cm4
SDK_DEBUGCONSOLE=2
NDEBUG
Linker
Repeated Symbol Search
Because library dependencies are complex, repeated symbol search using the ld
command’s --start-group
and --end-group
is enabled (this setting repeats the search until all dependencies are resolved, as they may remain unresolved due to the order of dependent symbols). Please refer to [Command line pattern:]
under [Properties..] > [C/C++ Build] > [MCU C++ Linker]
for the definition details.
Libraries to Link
The libraries to be linked are set in [Properties..] > [C/C++ Build] > [Settings] > [MCU C++ Linker] > [Libraries]
.
Note: The Library search path is described as "${workspace_loc:/TWENETxxx}/${ConfigName}"
where ${ConfigName}
is the build definition name (Release/Debug). You need to modify this if you create a new build definition.
- Details on TWENET Libraries: Libraries, Apps, etc.
- Microcontroller Libraries (stored in
TWENETmcu/libs
) - MiniMac: The MAC layer for handling IEEE802.15.4 processing (compact version with limited features).
- Radio: Handles the wireless physical layer part.
- arm_cortexM4l_math: (Not mandatory) An arithmetic library provided by ARM.
Link Script
The link scripts that define memory maps, etc., for generating the executable file (.bin
) are stored in TWENETmcu/linker/linkscripts/JN5189
.
The Managed linker script, which MCUXpresso automatically generates link scripts, is not used. Please uncheck it and make the following settings:
Linker Script ⇒
TWENET_Release.ld
orTWENET_Debug.ld
Script Path ⇒
"${workspace_loc:/TWENETmcu}/linker/linkscripts/
You can also specify the placement of heap and stack regions. For memory maps, please refer to RAM Allocation (you write the definitions in
build/App_User_Defs.ld
in the user project folder).
Other Build Settings
[Properties..] > [C/C++ Build]
has tabs for [Builder Settings]
, [Behavior]
, and [Refresh Policy]
, but they usually do not need to be edited.
- In the
[Behavior]
tab, you can set the number of parallel builds. If an excessive number of CPU cores is allocated, try reducing it.
[Properties..] > [C/C++ Build] > [Settings]
has [Build Steps]
, [Build Artifact]
, [Binary Parsers]
, and [Error Parser]
, but they usually do not need to be edited.
- In
[Build steps]
, the.bin
binary file is generated after the linker runs.
The standard MCUXpresso definitions have been rewritten to call dk6_image.sh
as shown below. No special processing has been added compared to the standard, but the purpose is to specify the Python script used in the process and to strengthen error handling.
sh '${workspace_loc:/TWENETmcu}/linker/scripts/dk6_image.sh' "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}" DK6_PY="\"${DK6_PY}\"" DK6_OPTS="\"${ENV_IMAGE_TOOL_OPTS}\""