Difference between revisions of "Adding Support for New Devices"

From SEGGER Wiki
Jump to: navigation, search
(Creating a flash algorithm using SEGGER Embedded Studio)
 
(59 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
#REDIRECT [[Open_Flashloader#Create_a_Flash_Loader]]
<table>
 
<tr>
 
<td valign="top">__TOC__</td>
 
<td valign="top"></td>
 
<td valign="top">
 
 
</td>
 
</tr>
 
</table>
 
This article describes how to add support for new devices / flash banks to the J-Link DLL so that they can be used with any J-Link DLL based application like for example J-Flash, J-Link Commander, IDEs, etc...This article assumes that there is already a basic understanding of the CMSIS flash algorithm structure defined by ARM as well as method of adding new devices using the Open Flash Loader concept. In general, there are two possibilities to add support for a new device:
 
#Use a pre-compiled flash loader
 
#Compile / create the flash loader on your own
 
##Using Keil uVision (a license is required, no trial available; Supports Cortex-M, only)
 
##SEGGER Embedded Studio (can be evaluated without license; Supports Cortex-M and Cortex-A/R)<br>How to create a flash loader on your own using Embedded Studio is described below.
 
 
<br>
 
= Creating a flash algorithm using SEGGER Embedded Studio =
 
This article describes how to create a flash loader using SEGGER Embedded Studio. It refers to an Embedded Studio example project for the ST STM32F205RC device. This project can be used as reference for any Cortex-M device.
 
== Debug Configurations ==
 
The example project contains two debug configurations:
 
*Debug
 
*Release
 
=== Debug configuration ===
 
This configuration allows to debug the flash algorithm in Embedded Studio. The configuration includes a main.c containing the typical function call order, executed by the J-Link DLL when programming a sector. The debug optimization level for this configuration is set to zero.
 
=== Release configuration ===
 
This configuration does not allow debugging but creates the output elf file which can be referenced from within the JLinkDevices.xml file as "''Loader''". The debug optimization is set to 3, optimized for speed.
 
== Included files ==
 
{| class="wikitable"
 
|-
 
! Filename !! Content
 
|-
 
| '''FlashDev.c''' || Flash device description for the ST STM32F205RC
 
|-
 
| '''FlashOS.h''' || Function prototypes, definitions and structures
 
|-
 
| '''FlashPrg.c''' || Flash algorithm itself (e.g. ProgramPage(), EraseSector()
 
|-
 
| '''main.c''' || Flash algorithm debug code (used by debug configuration, only)
 
|-
 
| '''Cortex_M_Startup.s''' || Cortex-M startup code (used by debug configuration, only)
 
|-
 
| '''MemoryMap.xml''' || Memory map of the ST STM32F205RC
 
|-
 
| '''Placement_debug.xml''' || Debug configuration section placement file.
 
|-
 
| '''Placement_release.xml''' || Release configuration section placement file.
 
|-
 
| '''thumb_crt0.s''' || Initialization file (used by debug configuration, only)
 
|}
 
 
== Embedded Studio Project ==
 
The projects below have been tested with SEGGER Embedded Studio V3.10.
 
*[[File:OpenFlashLoader_ST_STM32F205RC.zip]]
 
*[[File:OpenFlashLoader_Template_CortexM.zip]]
 

Latest revision as of 15:30, 4 April 2019