NXP Semiconductors EVKmimx8mm Скачать руководство пользователя страница 16

-..\..\..\..\boards\<YOUR_BOARD>\demo_apps\safety_iec60730b\mdk\debug\dev_safety_iec60730b_crc.hex

-..\..\..\..\tools\srecord\srec_cat.exe

The meaning of this afterbuild command is described in 

Postbuild in IEC60730B safety example 

.

The product of the postbuild operation with the 

crc-hex.bat

 file is the 

<your_project_name>_crc.hex

 edited file, which must be

loaded to the target. The best way to do this is to create a debug initialization file.

5.1.2.2 Debug initialization settings

By default, the uVision Keil IDE downloads the output file specified in "Options->output". Due to this, it is necessary to create an
alternative debug initialization file. In our case, a 

*.hex

 file with an added CRC is dedicated for the download to the target.

In the uVision Keil IDE, it is necessary to select the following options:

• "Options ->Debug->Initialization file" - fill it with the "safety_debug.ini" pattern.
• "Options->Utilities->Init File" - fill it with the "safety_debug.ini" pattern.

Use a text editor to create the 

safety_debug.ini

 file. Create an empty file, save it with the 

*.ini

 extension, and copy the following

command into the file: "LOAD .\debug\<YOUR_PROJECT>_crc.hex INCREMENTAL".
This command loads the 

<YOUR_PROJECT>_crc.hex

 file from the 

.\debug\

 relative path and this address is relative to the project

file (

<YOUR_PROJECT>.uvprojx

 in the presented case). It means that the file is in the 

debug

 folder.

It is necessary to save this file to the project root path (to the folder with 

<YOUR_PROJECT>.uvprojx

 in the presented case).

After these IDE settings, the IDE calls the 

crc-hex.bat

 file after the build and it uses the alternative hex file

<YOUR_PROJECT>_crc.hex

 as the source for programming during the download.

5.1.2.3 Linker settings for information table

The 

crc-hex.bat

 postbuild file expects the information table at the end of the 

*.hex

 file. For this purpose, it is good to define your

own section in the linker. In the uVision Keil IDE, it can be the following:

LR_IROM3 m_fs_flash_crc_start __size_flash_crc__{
; Safety-flash CRC region
ER_CRC (m_fs_flash_crc_start) FIXED (__size_flash_crc__)
{
*(.flshcrc)
}
}

Where "m_fs_flash_crc_start" and "__size_flash_crc__" are the user-defined address. This address must be at the end of the flash.
After defining this section in the ROM, a correct structure must be defined in the C language:

/* The safety-related FLASH CRC value. */
fs_crc_t c_sfsCRC __attribute__((used, section(".flshcrc"))) =
{
.ui16Start = 0xA55AU,

Post-build CRC calculation

i.MX8M Safety Example , Rev. 3, 07/2021

NXP Semiconductors

16

Содержание EVKmimx8mm

Страница 1: ...i MX8M Safety Example NXP Semiconductors Document identifier IEC60730BIMX8MXEUG User s Guide Rev 3 07 2021...

Страница 2: ...guide 3 Chapter 2 Hardware settings 4 Chapter 3 File structure 7 Chapter 4 Example application 9 Chapter 5 Running example 14 Chapter 6 IEC60730B tests 22 Chapter 7 Revision history 25 NXP Semiconduc...

Страница 3: ...gh the MCUXpresso SDK website This example user s guide describes how to set the hardware correctly and how to use the example code with the IEC60730B Safety library The library user s guide is the ma...

Страница 4: ...bugger The default debugger in the example project is set to J Link FreeMASTER FreeMASTER communication is used via an external J Link plugin The hardware settings are as follows 1 Connect the 12 V po...

Страница 5: ...he 12 V power supply J302 USB port and the J Link debug probe to the board and switch the SW101 switch to power on the board 2 Connect a USB C cable between the host PC and the J301 USB port this port...

Страница 6: ...Figure 2 Hardware connection of EVK MIMX8MN EVK MIMX8MN Nano i MX8M Safety Example Rev 3 07 2021 NXP Semiconductors 6...

Страница 7: ...tains the source files for the peripheral test this is a common cross core These tests are compiled to library libIEC60730B_ core _COM_ compiler _ version a The compiler folder contains compiler suppo...

Страница 8: ...gure 4 Figure 4 Example of project structure in example folder This folder contains the example source file and three folders for the IDE project file iar mcux mdk The following files are generated by...

Страница 9: ...K library and safety example related folders The safety related folders are the following Board this folder contains the files related to the board used clock_config h pin_config h board h and so on C...

Страница 10: ...t The project_setup_ your_board c file contains the setup functions clock port UART and so on The file contains the handling function for safety routines from the IEC60730B library and also the test i...

Страница 11: ...the Device Manager Two new COM ports should appear Open both COM ports in the serial terminal with settings mentioned above The COM port with the higher number shows the output of the bootloader The o...

Страница 12: ...size 256 Bytes erase size 4 KiB total 32 MiB SF 20480 bytes 0x0 Erased OK device 0 offset 0x0 size 0x4864 SF 18532 bytes 0x0 Written OK The image is now downloaded into the QSPI flash Turn the board o...

Страница 13: ...test The file contains the fs_dio_test_ platform _t list of structures The pointers to these structures are collected in the dio_safety_test_items array which is used in the example application 4 5 So...

Страница 14: ...e post build command calls the crc hex bat file which supports the CRC16 and CRC32 calculations The crc hex bat file is in your SDK package in the sdk_package middleware safety_iec60730b tools crc fol...

Страница 15: ...ipt The linker script depends on the IDE used The exact description for the supported IDE is in the following chapter 5 1 2 Arm uVison Keil IDE postbuild CRC The safety example in the uVision Keil use...

Страница 16: ...This command loads the YOUR_PROJECT _crc hex file from the debug relative path and this address is relative to the project file YOUR_PROJECT uvprojx in the presented case It means that the file is in...

Страница 17: ...d steps Post build steps menu Copy and paste the following post build string into it arm none eabi objcopy v O ihex BuildArtifactFileName BuildArtifactFileBaseName hex ProjDirPath crc_hex bat ConfigNa...

Страница 18: ...table can be defined as the following structure The safety related FLASH CRC value fs_crc_t c_sfsCRC __attribute__ used section flshcrc ui16Start 0xA55AU ui32FlashStart uint32_t __ROM_start__ ui32Fla...

Страница 19: ...ile 5 1 3 3 Flash loader configuration It is necessary to set a correct output file for the download to the target There are the following two ways to do this in the MCUXpresso IDE 1 Using the Debug c...

Страница 20: ...g GUI Flash Tool Only the SEGGER J Link probes in the GUI Flash Tool support hex files In the GUI Flash Tool settings select Workspace Configuration PROJECT_NAME _crc hex file for download Post build...

Страница 21: ...Figure 6 GUI Flash Tool SEGGER J Link Post build CRC calculation i MX8M Safety Example Rev 3 07 2021 NXP Semiconductors 21...

Страница 22: ...re tests all CPU registers for the stuck at condition except for the program counter register The program counter test is implemented as a stand alone safety routine Some tests stay in an endless loop...

Страница 23: ...by the MarchC or MarchX tests The test copies a block of memory to the backup area defined by the linker Be sure that the BLOCK_SIZE parameter is smaller than the backup area defined by the linker Th...

Страница 24: ...Some debuggers do not allow the WDOG reset Due to this it is necessary to turn off the WDOG when debugging the application NOTE Watchdog test i MX8M Safety Example Rev 3 07 2021 NXP Semiconductors 24...

Страница 25: ...er SDK Description 0 2 9 0 Intial release 1 2 10 0 Change devices supported in SDK rel 2 10 2 2 10 0 Post build description added 3 Version cover SDK 2 9 and SDK 2 10 release document for web NXP Semi...

Страница 26: ...ould implement appropriate design and operating safeguards to minimize the risks associated with their applications and products NXP the NXP logo NXP SECURE CONNECTIONS FOR A SMARTER WORLD COOLFLUX EM...

Отзывы: