Difference between revisions of "Integrity checks with Embedded Studio and SEGGER Linker"

From SEGGER Wiki
Jump to: navigation, search
(Created page with "To be announced.")
 
(Prerequisites)
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
[[Category:Embedded Studio]]
To be announced.
 
  +
This article will show how the integrity check feature of the SEGGER Linker can be used with algorithms like CRC, MD5, SHA and many more.
  +
  +
= Prerequisites =
  +
To use this feature the following software versions of Embedded Studio and SEGGER Linker must be used:
  +
*[https://www.segger.com/downloads/embedded-studio/ SEGGER Embedded Studio] V5.10 or later
  +
* SEGGER Linker V3.00 or later (included since the above Embedded Studio version)
  +
  +
= Available algorithms =
  +
The following algorithms are currently available:
  +
*CRC-7/MMC
  +
*CRC-8
  +
*CRC-8/CDMA2000
  +
*CRC-8/DARC
  +
*CRC-8/MAXIM, CRC-8/1WIRE
  +
*CRC-8/AUTOSAR
  +
*CRC-8/BLUETOOTH
  +
*CRC-16/CCITT:AUG
  +
*CRC-16/CCITT:NOAUG
  +
*CRC-16/KERMIT
  +
*CRC-16/X.25
  +
*CRC-16/XMODEM
  +
*CRC-16/ARC
  +
*CRC-16/UMTS
  +
*CRC-16/MODBUS
  +
*CRC-16/USB
  +
*CRC-32
  +
*CRC-32/BZIP2
  +
*CRC-32/MPEG2, CRC-32/STM32
  +
*CRC-32/POSIX
  +
*CRC-32/XFER
  +
*CRC-32C
  +
*CRC-32D
  +
*CRC-32Q
  +
*CRC-CCITT:AUG
  +
*CRC-CCITT:NOAUG
  +
*MD5
  +
*RIPEMD-160
  +
*SHA-1
  +
*SHA-224
  +
*SHA-256
  +
*SHA-384
  +
*SHA-512
  +
*SHA-512/224
  +
*SHA-512/256
  +
*SHA3-224
  +
*SHA3-256
  +
*SHA3-384
  +
*SHA3-512
  +
*SM3
  +
  +
  +
= How to=
  +
  +
* First define a region for the area you want to do the integrity check on and a region where to place the result
  +
* As an example we will create a CRC over a complete Flash area and place the result at the end of Flash
  +
<pre>
  +
define region FLASH = [0x80000000 size 512k];
  +
define region CRC = [end(FLASH)-4, size 4];
  +
define region APPLICATION = FLASH - CRC;
  +
</pre>
  +
* Now place your application sections in region APPLICATION
  +
* Next do the CRC calculation with a selected algorithm e.g. CRC-32
  +
<pre>
  +
place in CRC {
  +
integrity check of APPLICATION with algorithm="CRC-32" fill=0xFF
  +
};
  +
</pre>
  +
  +
Now the CRC-32 result over the region APPLICATION is saved in region CRC.
  +
You can of course use other algorithms and other approaches to utilize the integrity check feature.
  +
  +
For more information see the SEGGER Linker reference manual [http://studio.segger.com/segger/UM20005_Linker.pdf UM20005]
  +
  +
= Example project=
  +
The following example project will show an example implementation of such integrity check on a [https://www.segger.com/products/debug-probes/j-trace/accessories/trace-reference-boards/overview/#cortex-m-trace-reference-board Cortex-M Trace Reference Board] based on a ST STM32F407VE target device.
  +
  +
In the example project the SEGGER Linker integrity check result will be compared to the result of the STM32 CRC peripheral.
  +
  +
== Prerequisites ==
  +
To be able to build and debug the project the following prerequisites must be met:
  +
  +
* SEGGER Embedded Studio V5.10 or later
  +
* Any J-Link
  +
* [https://shop.segger.com/Cortex_M_Trace_Reference_Board_p/6.68.18.htm Cortex-M Trace Reference Board]
  +
  +
== Project files ==
  +
[[Media:STM32F407_CRC_SEGGER_LINKER.zip|STM32F407_CRC_SEGGER_LINKER.zip]]

Revision as of 12:41, 6 August 2020

This article will show how the integrity check feature of the SEGGER Linker can be used with algorithms like CRC, MD5, SHA and many more.

Prerequisites

To use this feature the following software versions of Embedded Studio and SEGGER Linker must be used:

  • SEGGER Embedded Studio V5.10 or later
  • SEGGER Linker V3.00 or later (included since the above Embedded Studio version)

Available algorithms

The following algorithms are currently available:

  • CRC-7/MMC
  • CRC-8
  • CRC-8/CDMA2000
  • CRC-8/DARC
  • CRC-8/MAXIM, CRC-8/1WIRE
  • CRC-8/AUTOSAR
  • CRC-8/BLUETOOTH
  • CRC-16/CCITT:AUG
  • CRC-16/CCITT:NOAUG
  • CRC-16/KERMIT
  • CRC-16/X.25
  • CRC-16/XMODEM
  • CRC-16/ARC
  • CRC-16/UMTS
  • CRC-16/MODBUS
  • CRC-16/USB
  • CRC-32
  • CRC-32/BZIP2
  • CRC-32/MPEG2, CRC-32/STM32
  • CRC-32/POSIX
  • CRC-32/XFER
  • CRC-32C
  • CRC-32D
  • CRC-32Q
  • CRC-CCITT:AUG
  • CRC-CCITT:NOAUG
  • MD5
  • RIPEMD-160
  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512
  • SHA-512/224
  • SHA-512/256
  • SHA3-224
  • SHA3-256
  • SHA3-384
  • SHA3-512
  • SM3


How to

  • First define a region for the area you want to do the integrity check on and a region where to place the result
  • As an example we will create a CRC over a complete Flash area and place the result at the end of Flash
define region FLASH       = [0x80000000 size 512k];
define region CRC         = [end(FLASH)-4, size 4];
define region APPLICATION = FLASH - CRC; 
  • Now place your application sections in region APPLICATION
  • Next do the CRC calculation with a selected algorithm e.g. CRC-32
place in CRC {
  integrity check of APPLICATION with algorithm="CRC-32" fill=0xFF
};

Now the CRC-32 result over the region APPLICATION is saved in region CRC. You can of course use other algorithms and other approaches to utilize the integrity check feature.

For more information see the SEGGER Linker reference manual UM20005

Example project

The following example project will show an example implementation of such integrity check on a Cortex-M Trace Reference Board based on a ST STM32F407VE target device.

In the example project the SEGGER Linker integrity check result will be compared to the result of the STM32 CRC peripheral.

Prerequisites

To be able to build and debug the project the following prerequisites must be met:

Project files

STM32F407_CRC_SEGGER_LINKER.zip