We are pleased to announce that MCUXpresso IDE v11.0.0 (build 2516) is now available.
This is a major new version of the IDE, and contains many new features and enhancements over the previous MCUXpresso IDE v10.3.1 and earlier releases. The attached presentation, recommended viewing for all users (new or experienced), provides an overview of many of the major changes, as well as things to be aware of when upgrading from an earlier release:
Additional information can be found in the updated User Guide and other documentation, which can be accessed from the built in help system available via IDE's Help menu and in PDF form from within the installation directory or downloaded from:
Upgraded underlying Eclipse Framework to 4.10.0v201812 / CDT 9.6.0
Upgraded supplied GNU ARM Embedded Toolchain to GCC8 (2018q4-major)
Windows version of product now only runs on Win64 (IDE v10.3.1 and earlier ran on Win32 & Win64 platforms). Note that this change has been driven by the fact that Eclipse framework is now 64-bit only. [ Ubuntu and MacOS versions of product already only ran on 64-bit platforms.]
Updated version of "busybox", used on Windows to provide a Unix-like layer for GCC tools to run under, to "GNU MCU Eclipse Windows Build Tools" v2.12 (64bit)
Added support for MCUXpresso SDK v2.6
Upgraded integrated version of MCUXpresso Config Tools to v6
Revamped Develop Perspective with some new and additional views shown by default. Also decluttered by removal of some less commonly used views. Most of the removed views can be added back via the new 'Analysis' menu
New "Image Info" View improves and extends on the functionality previously provided by the “Symbols Browser” view, giving the following analysis of a project build:
Overall memory usage
Content of memory regions
Static call graph, including stack usage information
New "Heap and Stack Usage" view provides ability to track heap and stack usage during debug of baremetal projects
Implemented "editor awareness" for linker map files, linker scripts and linker script templates, providing syntax coloring as well as navigation of file contents via the Outline view
Improved display of components in New Project Wizard and Managed Components dialog. Display of different component types is now tabbed, with an additional summary of the components selected
The New Project Wizard will now open the main source file in the Editor view after project creation
When importing a single SDK example, the wizard will now attempt to open the main source file in the Editor view after project creation. This functionality can also be enabled when importing multiple examples through a workspace preference
Improved support for Cortex-M33 Secure / Non-Secure projects. Improvements include :
Secure and Non-Secure projects more closely linked from build / project configuration point of view
Debugging Secure project will automatically build Non-Secure project and program it into flash, before launching Secure project debug session
Symbols for Non-Secure project automatically loaded into debug session to allow user to step from Secure world into Non-Secure (with source code visibility)
Note that these improvements also require SDK v2.6 for the MCU being targeted
Improved Launch Configurations for LinkServer. Main user impact is that this allows a more friendly way of editing launch configuration settings. Some launch configuration functionality now also provided in “standard” Eclipse/CDT tabs rather than in LinkServer specific manner. LinkServer Launch configurations from older IDE versions will be automatically converted to the new format
New launch configuration tab (for all debug probe types) to allow loading of debug symbols from additional images (in addition to the ones from the main image being debugged)
Improvements to performance of single stepping for LinkServer debug connections
Implemented support for SWO Trace on Cortex-M33 based MCUs
"Live Variables" functionality inside the Global Variables view now supported using SEGGER J-Link and P&E Micro debug probes (in addition to LinkServer debug connections)
FreeRTOS TAD functionality now directly implemented within the IDE, rather than being a separate plugin
Improved look and feel to better match rest of IDE
Timeout period for FreeRTOS TAD increased, to help prevent reading of data failing on slow debug connections. IDE preference also added to allow timeout period to be changed
Fixed issue with Runtime not showing when compiler optimizations turned on
Fixed issue with Timer List with FreeRTOS 10.2 release
Fixed issue with IDE losing C library include paths. This did not prevent projects from building but meant that indexer-related functionality reliant on these paths would not work correctly (for instance trying to open a C library include file from the editor). This issue could also cause Newlib projects to sometimes appear to be using Redlib include files.
Note: Existing projects can be "fixed" using Tools->Fixup Parsers option on the Project Properties view's context sensitive menu
New projects now compile with the --fstack-usage option by default (needed for callgraph functionality in the "Image Info" view)
Quickstart Panel - Quick Settings menu can now indicate current value for Debug Console, Floating Point and Library settings for current build configuration of selected project
New projects now link with --cref option by default (increasing level of information provided in linker map files)
Improved performance of installing/loading SDKs, largely by re-architecting the way that SVD peripheral definition files from the SDK are processed
Installed SDKs view updated so that detailed information on contents of selected SDK is hidden by default, but with new Hide/Show button to display when required
SDK default folder mechanism updated to install SDKs into an "02" subdirectory by default. This means that SDKs installed by IDE v11.0.0 will not be visible to older versions of the IDE
Improved ability to select debug console type (semihosting vs UART vs any preference specified by example definition) when importing SDK examples. This is particularly useful when multiple projects are selected for importing at the same time
Tweaked code generated for main() by New Project Wizard for SDK projects such that the infinite loop at the end of the function can be successfully single stepped at the source level
Fixed issue with default compiler options set by SDK New Project wizard when creating C++ projects. Such projects now also created with "cpp_config.cpp" file containing minimal implementations of the new/delete operators and the verbose terminate handler for exceptions suitable for embedded use. This brings SDK C++ projects inline with C++ projects created with the New Project Wizard for preinstalled parts
Some performance improvements when making a board selection in New Project Wizard and Import SDK example(s) wizard
Fixed issue with IDE incorrectly warning about overlapping memory regions when importing some SDK examples, when the memory regions are actually just adjacent
Fixed issue with IDE being unable to show the context sensitive menu in the Project Properties view for makefile projects in some circumstances
Fixed issue with handling of part support information for MCUs which are supported by internal part support, but for which an SDK exists and has been installed into the IDE
Various updates and clean up of icons. In particular, new icon for "LinkServer" now used in various places instead of general MCUXpresso IDE one
Fixed issue with various tables displayed by IDE failing to display "..." to indicate truncation, when amount of text to display exceeds space currently available in column
Various fixes to SDK Editor / Creator
Fixed issue with managed linker script mechanism when building master projects linking in slave projects containing data with larger than normal alignment
Fixed issue with managed linker script mechanism which was causing some sections (such as .bss) to be erroneously assigned unnecessary load addresses
Fixed issue with section name wildcards used in managed linker script mechanism , which could prevent __BSS/__DATA macros from working as expected in some circumstances
On Managed Linker Script page of Project Properties, IDE now autoconverts any "\" directory separators entered into "Script path" to Unix style "/" expected by the linker
Added implementations of inverse hypobolic functions to Redlib (acosh/acoshf, asinh/asinhf and atanh/atanhf)
Improved Redlib definition of HUGE_VAL (and other related defines) in math.h. Also updated way float_t defined
arm_acle.h header file now on the search path for projects linking against Redlib (providing various ARM C language extension intrinsics). Previously this was only available for Newlib linked projects
IDE now prioritizes use of IDE supplied LinkServer flash drivers over any contained in installed SDKs (rather than the other way around). This behaviour can be reverted if necessary using an IDE workspace preference
Fixed various issues with creation of multiple launch configurations for a particular build configuration in a project
Fixed issue with creation of launch configurations if previous attempt was cancelled
"Attach-only" debug sessions no longer trigger a build before starting the debug connection (as long as image has already built)
Improved size and layout of Launch Configuration Selection Dialog (displayed when project contains launch configurations for multiple probe types)
Fixed issue with display of cycle counters in Registers View
Fixed issue with GUI Flash Tool via LinkServer with LPC51U68 and KL28 MCUs
Fixed issue with debug restart with QN9080 via LinkServer
Fixed issue with LinkServer FreeRTOS thread awareness with Cortex-M33 based MCUs (and CM33 aware versions of FreeRTOS)
Implemented preliminary support for carrying out SWO Trace using CMSIS-DAP probes that implement "CMSIS-SWO commands" (as opposed to the bespoke SWO support implemented by NXP's LPC-Link2 CMSIS-DAP firmware). This has currently only received limited tested using ULINKplus probes with CMSIS-DAP v1.x.x firmware. Note : MCUXpresso IDE does not support the use of WinUSB endpoints as provided by CMSIS-DAP v2.x.x firmware
New IDE workspace preference to allow debug launch configurations for SEGGER J-Link probes to be created with FreeRTOS thread awareness already enabled (off by default)
Upgraded to a later version of the P&E Micro plugin (v4.1.3)
Upgraded to a later version of the SEGGER software (v6.44i)
Finally, a familiarity with the use of MCUXpresso IDE and SDK installation is assumed.
In essence, MCUs incorporating Arm Trustzone technology are able to provide system wide isolation between Secure (S) and Non Secure (NS) worlds. Within the Non Secure environment, access to certain operations, peripherals etc. are controlled from the Secure world. This behaviour is delivered by a single CPU with execution time being shared between these two worlds.
Developing for systems using Trustzone features presents a number of challenges in particular providing Secure World services for Non Secure application developers, debugging of both Secure and Non Secure code (projects) and delivering a usage model within the IDE that can be easily used and understood.
The examples supplied with the SDK contain both Secure and Non Secure linked projects and are configured within the IDE to demonstrate development from the point of view of both Secure and Non Secure development.
However, a more typical 'real world' situation may be for developers working on Non Secure project development and treating the Secure world as a 'Black Box' (or Bootloader) that provides a number of explicit secure operations. This use case will be discussed in a subsequent article.
Note: the LPC55S69 is a multicore MCU as in it contains two physical CPUs - numbered 0 and 1. In these examples all code is targeted at CPU 0, and the use of CPU 1 is outside the scope of this article.
Importing (Linked) Example Project
First, ensure you have installed version SDK version 2.6 for the LPCXpresso55S69 EVK board into MCUXpresso IDE. Once installed it will be visible within the Installed SDKs view and its version shown as below:
From the Quickstart view, launch the 'Import SDK example(s)' Wizard, then select the LPCXpresso55S69 board and click <next>
Expand the trustzone examples and click either of the Hello World projects. Since these projects are linked, both the Secure (_s) and Non Secure (_ns) examples will be selected. Click <finish> to start the import.
Note: Linked projects are coloured yellow within the wizard. This project linkage is set because the Non Secure project relies on Secure project for access to allowed Secure operations (calls). Where as the Secure project references the Non Secure project for debug operations (flash programming).
Once imported, you will see the Project Explorer view contains the projects as expected.
Project Settings Exploration
The memory allocation of each project can be seen in the Project Explorer view by opening the Project Settings Node and then the Memory Node. From here you can see the input memory ranges set for the managed linker script mechanism (for each project):
Apart from the veneer table, these projects can be considered as separate entities and must have non overlapping memory regions.
Secure: A feature of the address space security is that the setting of address bit 28 signifies a secure location (odd numbers in the most significant nibble).
The flash region PROGRAM_FLASH at 0x10000000 specifies the secure LinkServer flash driver LPC55xx_S.cfx.
The SG_veneer_table block at 0x1000FE00 is used for code to provide a gateway to (certain) secure functions and inherits the same flash driver. Note: the name SG_veneer_table is a 'magic' string recognised by the IDE as an option for veneer placement (see later)
Non Secure: For these addresses, bit 28 is not set signifying non secure locations (even numbers in the most significant nibble)
The flash region PROGRAM_FLASH at 0x10000 specifies the non secure LinkServer flash driver LPC55xx.cfx.
Trustzone capable MCUs have a number of dedicated Project Properties primarily addressing linkage and debug.
A project set to be Secure will have further options available, including a setting for the location of the Secure veneer table, and check box to cause the generation of the Import Library. An additional Secure Gateway Import Library can also be specified.
Secure: Below is shown the MCU Linker -> Trustzone properties dialogue.
Note the Secure Gateway Placement (Secure veneers to shared secure operations) is set to use the 'magic' flash memory region (mentioned in the previous section) for placement.
Also observe the MCU Debugger -> Trustzone option. If used (as in this example), this takes the name of the associated non secure project which will then automatically be (built and) programmed when the Secure project debug operation is performed. In addition the symbols for this associated project will be added to allow source level debugging of both projects.
When selected, it will look like below:
Non Secure: Below is shown the MCU Linker -> Trustzone properties dialogue: Note the Secure Gateway Import Library references the Secure projects generated library location.
Building the Example Projects
Building the examples is as simple selecting the project and clicking Build in the Quickstart panel. Be aware that building the Non Secure project will force the Secure project to build first to provide linkage to the Secure Gateway library.
Assuming neither project has been built before, building the Non Secure Hello World project will result in the generation of both Secure and Non Secure .axf(s) and generate the output as below:
Memory region Used Size Region Size %age Used PROGRAM_FLASH: 16872 B 65024 B 25.95% SG_veneer_table: 32 B 512 B 6.25% Ram0: 4388 B 32 KB 13.39% Finished building target: lpcxpresso55s69_hello_world_s.axf
Memory region Used Size Region Size %age Used PROGRAM_FLASH: 7372 B 456 KB 1.58% Ram0: 8448 B 172 KB 4.80% Finished building target: lpcxpresso55s69_hello_world_ns.axf
Note: building the Secure project does not force a build of the Non Secure since there are no build dependencies in this direction.
Debugging the Example Projects
As already mentioned, these examples demonstrate development from the point of view of both Secure and Non Secure projects. Hence the initial flow is intended to show startup within a the Secure world and then the migration to the Non Secure where a secure operation will be performed.
Therefore, begin by selecting the Secure Project in the Project Explorer view and clicking Debug in the Quickstart Panel. Since we have the option set to enable the pre-programming of the Non Secure binary there will be two stages to this debug operation.
Note: If this is the first time this project has been debugged, you will be presented with the option to select a debug probe. Then, since this is a MultiCore MCU, you must also select the core to use (be sure that this is set to Core 0).
First, the Non Secure binary will be programmed into flash memory - this automatic step will proceed like a normal binary programming operation and generate a log associated with Non Secure project, a fragment shown below:
Flash variant 'LPC55xx (608KB)' detected (608KB = 19*32K at 0x0) Writing 7372 bytes to address 0x00010000 in Flash 1 of 1 ( 0) Writing pages 2-2 at 0x00010000 with 7372 bytes ( 0) at 00010000: 0 bytes - 0/7372 (100) at 00010000: 8192 bytes - 8192/7372 Erased/Wrote sector 2-2 with 7372 bytes in 122msec Closing flash driver LPC55xx.cfx (100) Finished writing Flash successfully. Flash Write Done Loaded 0x1CCC bytes in 417ms (about 17kB/s)
Secondly, the Secure project will then be programmed in the normal way, this will generate a standard debug log associated with the Secure project, a fragment is shown below:
Note: again if this is the first time, the debug probe and MCU core must be selected. For subsequent debug operations, these options will be remembered.
Flash variant 'LPC55xx (608KB) (Secure)' detected (608KB = 19*32K at 0x10000000) Writing 32 bytes to address 0x1000FE00 in Flash 1000A000 done 25% (8192 out of 32288) 1000C000 done 50% (16384 out of 32288) 1000E000 done 76% (24576 out of 32288) 10010000 done 100% (32768 out of 32288) Erased/Wrote sector 1-1 with 32 bytes in 709msec Closing flash driver LPC55xx_S.cfx Flash Write Done Flash Program Summary: 16904 bytes in 1.00 seconds (16.59 KB/sec) Starting execution using system reset and halt target with a stall address Retask read watchpoint 1 at 0x50000040 for boot ROM stall Restore internally retasked watch #1 no type address 0x0 (unused) Note - system reset leaves VTOR at 0x13000000 (not 0x10000000 which a booted image might assume) Stopped (Was Reset) [Reset from Unknown] Stopped: Breakpoint #2
Once programming is complete, you should arrive at the default Breakpoint on main within the Secure world as below:
Click Run and this project will first perform some board/MCU initialisation, print a greeting (as below), then setup the environment for the Non Secure project to execute.
Note: this step is necessary because the non secure project is not run from reset, so cannot rely on the default hardware behaviour for initialisation of Stack, Interrupt handlers etc. This is essentially the same operation that a bootloader would perform.
Next, a jump will be made to the Non Secure world.
Note: since the non secure project is not debugged directly, it will have no default breakpoint on its main function. To explore the execution, it is recommended to open the Non Secure projects Source -> hello_world_ns.c and manually set a breakpoint as shown below:
Reminder, since we have the option set to enable the pre-programming of the Non Secure binary this also enabled the loading of Non Secure symbols (which can be observed in the Secure projects debug launch configuration (shown below). It is the loading of these symbols which enables source level debug of the Non Secure project while we are actually debugging the Secure project.
Finally, click Run to run this example to termination and observe the output.
Note: the significance of this example is that the String Compare operation was supplied to the Non Secure project by the Secure project and accessed securely via the Non Secure Entry (NSE).
This step concludes the expected use of this example.
Another mode of operation is to perform a Debug operation directly on the Non Secure project. This is a perfectly valid operation provided the Secure project has first been programmed into flash. If so the Non Secure project will behave like a standard project and arrive the breakpoint on main ()... However, if the Secure Project has not been pre-loaded, the debug operation will fail.
If Debug operations fail...
It is possible to program an image into flash that when run prevents further debug operations succeeding. Should this occur, please follow the steps below:
Click on the "Clean Up debug" button on the main IDE toolbar - this kills any stale low level debug operations
Disconnect the USB cable from your board to remove power
Place a jumper on the ISP header (J10) - this will prevent the board booting the image in flash by forcing the MCU to enter ISP mode
Now reconnect the USB cable to Debug Link connector (P6)
Now select a project in the Project Explorer view, and then click on the GUI Flash Tool on the main IDE toolbar - and use this to mass erase the flash. [More details on using the GUI Flash Tools can be found inside the supplied IDE v11.0 User Guide]
If this succeeds, then:
Disconnect the USB cable from your board
Remove the jumper on the ISP header (J10)
Now reconnect the USB cable to Debug Link connector (P6)
Now try starting a debug session for your project again using the Quickstart Panel's Debug button. If this problem occurs as part of application development, try programming a known working example to ensure there are no underlying problems.
When using the QN9080 with SDK v2.2 2019-01-29, or earlier, there is an issue in the SDK internal data which can lead to MCUXpresso IDE v11.0.0 failing to set consistent floating point options when importing multiple examples. This issue can lead to linker errors when example projects are built relating to "VFP register arguments":
This issue will be resolved in a future release of the QN9080 SDK. But with the current QN9080 SDK, then to avoid this issue, you can:
With the cost of an single pin, many ARM Cortex-M boards including the NXP i.MX RT1064 can produde SWO data: think about a pin able to stream data out of the chip in realtime. For example interrupt activity which otherwise might be hard to capture:
SWO Interrupt Trace
This article describes how to enable and use the SWO (Single Wire Output) of the ARM Cortex-M7 present in the NXP i.MX RT1064 device.
i.MX RT1064-EVK Board
While this is a very valuable feature, not every development tool supports capturing SWO data. And not every board has the SWO pin routed to the debug header which is a prerequisite to get the data.
JTAG TDO Pin (Source: NXP i.MX RT1064 Schematics)
The pin is connected to the AD_B0_10 pin of the i.MX RT1064 device.
Software and tools used:
Eclipse: NXP MCUXpresso IDE 10.3.1
SDK: NXP MCUXpresso SDK 2.4.1 for i.MX RT1064-EVK
Check SDK Manifest File
To use SWO, it has to be enabled in the SDK manifest file. So let’s check this first.
In the IDE, open the location where the SDK zip files are installed:
Best to close the IDE now, as we might need to change the content on disk.
Open the archive:
Open SDK zip file
Locate the manifest XML file:
SDK Manifest File
To check/edit the manifext XML file I can use an external editor or the IDE:
Using the IDE
I can use the IDE to edit the XML (this is useful if I want to change the SDK sources).
To check/edit the file in the IDE workspace preferences, disable the ‘Selected files from SDK View open in read-only mode:
Selected Files Open Option
Open with the context menu the XML description:
Show XML Description
In the XML editor, click on the ‘Source’ tab. Search for internal.has_swo:
XML Source tab
Verify that it has a ‘true’ value. If not, change it to true and save the file.
Using external editor
Below are the steps using an external editor.
Open the file with a text editor and search for ‘internal_has_swo’ and check if it has a ‘true’ value. If not: change the value to true:
If that change is needed: update the zip file with the new content/file.
if that setting is set to false, the IDE does not offer the SWO feature and buttons/views will be grayed out/disabled.
Now I can start the IDE again. If I had to modify the XML file, best to recreate the part information in the IDE:
Recreate Part Information
Muxing SWO Pin
Locate the file ‘pin_mux.c’ and add the following lines to BOARD_InitPins():
IOMUXC_GPIO_AD_B0_10_ARM_CM7_TRACE_SWO, /* GPIO_AD_B0_10 is configured as ARM_TRACE_SWO */
0U); /* Software Input On Field: Input Path is determined by functionality */