Difference between revisions of "Embedded Studio"

From SEGGER Wiki
Jump to: navigation, search
(How to enable RTOS thread awareness)
Line 112: Line 112:
   
 
'''''xhost -si:localuser:root'''''
 
'''''xhost -si:localuser:root'''''
 
=How to enable RTOS thread awareness=
 
== Enable thread awareness for embOS ==
 
 
* First download the latest thread awareness script from our website: https://www.segger.com/products/rtos/embos/tools/plug-ins/embedded-studio/
 
* Open your Embedded Studio project
 
* Go to: Project->Edit Options...->Debug->Debugger->Thread Script File
 
* Set path to your downloaded thread awareness script and press ok
 
 
== Thread awareness for other OSs ==
 
The following thread awareness scripts are provided as is without claim for support.
 
Setup steps are the same as with embOS.
 
 
[[Media:FreeRTOS_ThreadScripts_ES.zip | FreeRTOS thread awareness scripts]]
 
 
'''Note:''' When using FreeRTOS the scripts require FreeRTOS to be compiled such
 
that the referenced symbols do not have static qualifier (so the
 
debugger can access them).
 
   
 
=How to place a function in RAM=
 
=How to place a function in RAM=

Revision as of 17:19, 31 May 2019

Embedded Studio, is a complete all-in-one solution for managing, building, testing and deploying your embedded applications: From the Project Generator which gets you easily started with common ARM microcontrollers, to the powerful Project Manager and source code Editor, the included C/C++ Compiler and the integrated Debugger with advanced debug information windows and direct J-Link integration, right through to version control features for automatic deployment of your applications.

Embedded Studio's uses a style similar to Microsoft's Visual Studio. It brings the same intuitive usage that PC developers are familiar with to the world of embedded engineering.

This wiki page explains and links to details and device specifics that can not be found on the Embedded Studio Product page.

Licensing

Get a License for Nordic Semiconductor Devices

Porting

Port Projects from IAR Embedded Workbench to Embedded Studio

Debugging

Configure ETB Trace in Embedded Studio

Configure SWO in Embedded Studio


VCS configuration

Version Control System (VCS) is an essential tool for individuals or development teams. SEGGER Embedded Studio integrates with several popular source-control systems to provide this feature for files in your Embedded Studio projects.

The source-control capability is implemented by a number of third-party providers, but the set of functions provided by Embedded Studio aims to be provider independent. This article will explain how to set up such a system and how to use it.

Set up source control system

Embedded Studio supports Subversion, Git, and Mercurial as source-control systems. To enable Embedded Studio to utilize source-control features, you need to install the appropriate command line client on your operating system for the source-control systems that you will use.

Once you have installed the command line client, you must configure Embedded Studio to use it.

To configure Subversion:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Subversion Options group to point to Subversion svn command. On Windows operating systems, the Subversion command is svn.exe.

To configure Git:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Git Options group to point to Git git command. On Windows operating systems, the Git command is git.exe.

To configure Mercurial:

  1. Choose Tools > Options.
  2. Select the Source Control category in the options dialog.
  3. Set the Executable environment option of the Mercurial Options group to point to Mercurial hg command. On Windows operating systems, the Git command is hg.exe.
Example with SVN

Source control capabilities

The source-control integration capability provides:

  • Connecting to the source-control repository and mapping files in the Embedded Studio project to those in source control.
  • Showing the source-control status of files in the project.
  • Adding files in the project to source control.
  • Fetching files in the project from source control.
  • Optionally locking and unlocking files in the project for editing.
  • Comparing a file in the project with the latest version in source control.
  • Updating a file in the project by merging changes from the latest version in source control.
  • Committing changes made to project files into source control.

When Embedded Studio loads a project, it examines the file system folder that contains the project to determine the source-control system the project uses. If Embedded Studio cannot determine, from the file system, the source-control system in use, it disables source-control integration.

That is, if you have not set up the paths to the source-control command line clients, even if a working copy exists and the appropriate command line client is installed, Embedded Studio cannot establish source-control integration for the project.

User credentials

You can set the credentials that the source-control system uses, for commands that require credentials, using VCS > Options > Configure. From here you can set the user name and password. These details are saved to the session file (the password is encrypted) so you won't need to specify this information each time the project is loaded.

Note

Embedded Studio has no facility to create repositories from scratch, nor to clone, pull, or checkout repositories to a working copy: it is your responsibility to create a working copy outside of Embedded Studio using your selected command-line client or Windows Explorer extension.

The "Tortoise" products are a popular set of tools to provide source-control facilities in the Windows shell. Use Google to find TortoiseSVN, TortoiseGit, and TortoiseHG and see if you like them.

Source-control operations

Source-control operations can be performed on single files or recursively on multiple files in the Project Explorer hierarchy. Single-file operations are available on the Source Control toolbar and on the text editor's shortcut menu. All operations are available using the Project > VCS menu. The operations are described in terms of the Project Explorer shortcut menu.

More information can be found in the Embedded Studio user manual: SEGGER Embedded Studio > SEGGER Embedded Studio User guide > Using source control

Set up external diff tool

To show the differences between the file in the project and the version checked into source control you can use the build in diff tool:

  1. In the Project Explorer, right-click the file.
  2. From the shortcut menu, choose Source Control > Compare.
ES internal diff tool

You can also use an external diff tool in preference to the built-in Embedded Studio diff tool. To define the diff command line Embedded Studio generates, choose Tools > Options > Source Control > Diff Command Line. The command line is defined as a list of strings to avoid problems with spaces in arguments. The diff command line can contain the following macros:

  • $(localfile): The filename of the file in the project.
  • $(remotefile): The filename of the latest version of the file in source control.
  • $(localname): A display name for $(localfile).
  • $(remotename): A display name for $(remotefile).
Cmd line example with WinMerge

Installation on newer Linux versions

On some newer Linux versions root rights for installing Embedded Studio are not granted per default. To counter that issue the following workaround can be applied. Simply execute the following command in the terminal:

xhost si:localuser:root

This workaround has been confirmed to work for:

  • Ubuntu 17.10
  • Fedora 26

...

This list will be updated once other Linux versions have been confirmed to work with that workaround.


Note: We strongly suggest to revoke the root rights after a successfull installation. To do that simply execute the following command in terminal:

xhost -si:localuser:root

How to place a function in RAM

For some situations it may be beneficial or even necessary to place a function in RAM instead of flash. This for example is needed in case a bootloader (that runs from flash) shall update a firmware (running from the same flash but different sectors). As the flash is not accessible for read accesses while it is programmed, the flash programming routines itself need to run from RAM.

In order to put a function into RAM, it needs to be placed into the .fast section. This is done as follows:

__attribute__ ((section(".fast")))  // Place the following function in RAM
void _Delay(void) {
  [...]
}

How to use an external toolchain with Embedded Studio

Embedded Studio offers the option to build project with an external toolchain of your choice. The following guide will show an example implementation of such a setup with the ARM GCC toolchain.

Example implementation with external GCC toolchain

  • First install the external toolchain of your liking, in this example the currently latest ARM GCC 7-2017-q4-major will be used.
  • Create a new externally build project using the Embedded Studio project wizard and selecting A C/C++ executable for ... processor(internal and external GNU tools).
New external build project
  • Select your target device, next set the toolchain path and finish the project setup by letting all settings on default.
  • Make sure the memory section placement segments are located in the correct memory areas. This can be found int he Common project settings under Linker-> Section Placement Segments
  • Now select build configuration "Debug External" and build the project to build with the external toolchain.
  • If the build succeeds you can download it into your target application and debug it.

Optional steps for more complex builds

When adding more complex projects to Embedded Studio as an external build usually additional steps are required to make full use of the external compiler. The following are the most common:

  • Preprocessor definitions: Under Preprocessor->Preprocessor Definitions in the external build configs missing preprocessor definitions can be set.
  • User include directories: Under Preprocessor->User Include Directories in the external build configs missing include directories can be added.
  • All other commands that can't be set directly through the Embedded Studio GUI need to be set manually to the external build command line which can be found under External Build in one of the external build project configurations.

Connecting to J-Link via J-Link Remote Server

The J-Link Remote Server makes it possible for Embedded Studio to connect to a J-Link remotely, without needing a physical connection to the J-Link.

In order to connect to a J-Link Remote Server using Embedded Studio, follow these instructions:

  • Open your project options (right click on your project in the Project Explorer and select Options)
  • Under Debug select the J-Link menu item
  • Edit the Host connection field
Project options
  • In the property editor, set the Host Connection
    • For a remote server running in LAN mode, enter "IP <RemoteServerIP>".
    • For a remote server running in tunneling mode, enter "IP tunnel:<SN/Nickname>[:<Pasword>[:tunnelserver[:port]]]"
Property editor for J-Link host connection
  • Click OK

From then on, the J-Link is handled the same as if it was connected directly via USB.