Using embOS with IAR Embedded Workbench

From SEGGER Wiki
Revision as of 09:47, 2 March 2021 by Martin (talk | contribs)
Jump to: navigation, search

embOS was ported for various architectures and respective editions of the IAR Embedded Workbench. This page contains information on how to use embOS with various versions of these editions.

Disabling the IAR stack check feature

The IAR Embedded Workbench includes a stack check feature that will issue warnings to the debug log in case the stack pointer points outside the stack range that was configured in the project options. This typcially results in several warnings being issued when debbuging an application that includes an RTOS, since IAR is not aware of task stacks. It will thus assume the stack pointer does not point to a valid stack range whenever a task stack is used instead of the system stacks. These warning will read “ The stack pointer for stack ... is outside the stack range ...”, similar to the warning shown in the screenshot below:

Active debug session with an IAR steck check warning in the debug log
The IAR steck check warning as displayed in the debug log

Typically, embOS start projects are pre-configured to disable the stack check feature through a *.dni file that is located in the folder settings of the respective start project. If that file was modified or deleted, or a new project was created from scratch, the warnings may reappear. In that case, the warnings may be disabled via the toolchain's options dialog at Tool → Options by unchecking “ Warn when stack pointer is out of bonds” checkbox as shown below:

Disablind the IAR steck check warning in the Options dialog
Uncheck the “ Warn when stack pointer is out of bonds” checkbox

Using embOS with IAR Embedded Workbench for ARM V6/7 and V8

With V8.10 of the IAR Embedded Workbench for ARM, and once again with the release of V8.11 of the Workbench, IAR performed modifications to the Workbench that unfortunately are not backwards-compatible. Specifically, modifications were done to IAR's thread-local storage implementation and the size of the wchar_t data type. Object code that was built using previous versions of the Workbench therefore cannot be used with V8.x of the Workbench and vice versa.

To account for these differences in the IDE versions, starting with V4.34 of embOS for Cortex-M and IAR as well as with V4.34.1 of embOS for ARM and IAR, embOS releases now contain two different shipments in a single Zip file: one shipment contains libraries which may be used with V6.x and V7.x of the IAR Embedded Workbench, while the other contains libraries for use with V8.11 or later.

Except for the contained libraries, these shipments are identical for identical versions of embOS. Customers using source code in their projects therefore may use either shipment, but customers who use the libraries in their projects will need to pick the appropriate shipment for their chosen version of the IAR Embedded Workbench.

Using embOS with IAR Embedded Workbench for ARM V9

When using V9.10 or later of the IAR Embedded Workbench for ARM, the embOS shipment for IAR V8.11 and later must be used for the reasons mentioned above).

When using embOS V5.10.1.0 for Cortex-M and IAR (or earlier versions), some projects need to be modified in regards to their device description file and / or the used flashloader to function properly with IAR V9. When using embOS V5.12.0.0 for Cortex-M and IAR (or later versions), those projects have been modified accordingly and can be used without further modification.

The respective projects are:

  • EFM32PG1B_EFM32_PearlGecko_SK
  • K22FN512_FRDM_K22F
  • K26FN2M0_Custom
  • K66FN2M0_emPower
  • SAMG53N19_SAMG53_XPlainedPro
  • SAMG54N_SAMG53_XPlainedPro
  • SAMG55J19_SAMG55_XPlainedPro
  • SAMV71Q21_SAMV71_XPlainedUltra
  • STM32F072_JLink_OB_STM32F072_Eval
  • STM32F072_STM32F072B_Discovery

Modification of the device description file

The following message may be encountered upon starting the debug session:

Memory Configuration Alert on start of debug session

To rectify this, navigate to Project options -> Debugger -> Setup and uncheck the Override default-box as shown below:

Unchecked Override default checkbox

Modification of the flash loader

If verification errros are encountered upon starting the debug session, an appropriate flash loader is missing in the project and the application will fail.

To rectify this, navigate to Project options -> Debugger -> Download and check the Use flash loader(s)-box as shown below:

Checked Use flash loader(s) checkbox

Using embOS with IAR Embedded Workbench for RX V2/3 and V4

With V4.10 of the IAR Embedded Workbench for RX, IAR performed modifications to the Workbench that unfortunately are not backwards-compatible.

To account for the differences in the IDE versions, starting with V5.02 of embOS for RX and IAR, embOS releases now contain two different shipments in a single Zip file: one shipment contains libraries which may be used with V2.x and V3.x of the IAR Embedded Workbench, while the other contains libraries for use with V4.10 or later.

Except for the contained libraries, these shipments are identical for identical versions of embOS. Customers using source code in their projects therefore may use either shipment, but customers who use the libraries in their projects will need to pick the appropriate shipment for their chosen version of the IAR Embedded Workbench.