Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update source integration test program counter module #47

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d12891b
Update source integration test program counter module
silabs-hieuhoang Nov 12, 2024
bb0a74a
Update source integration test irq module
silabs-hieuhoang Nov 13, 2024
c09ded9
Update source integration test system_clock module
silabs-hieuhoang Nov 13, 2024
95b8d4e
Update source integration test watchdog module
silabs-hieuhoang Nov 13, 2024
cdb2ad3
Update source code integration test variable memory module
silabs-hieuhoang Nov 13, 2024
be57598
Update source integration test invariable memory module
silabs-hieuhoang Nov 13, 2024
cc0e55f
Update source integration test cpu registers module
silabs-hieuhoang Nov 13, 2024
5566626
Update bash script support runs integration tests automatically
silabs-hieuhoang Nov 13, 2024
dfba6d9
Add file support build with IAR tool
silabs-hieuhoang Nov 13, 2024
5cd741a
Update components and sample SDK extension
silabs-hieuhoang Nov 13, 2024
9a60e48
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
963fb95
Merge pull request #56 from SiliconLabs/test/Update-SDK-extension
silabs-hieuhoang Nov 14, 2024
5a8fe25
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
ab10a71
Merge pull request #55 from SiliconLabs/test/Support-build-test-with-…
silabs-hieuhoang Nov 14, 2024
83e7211
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
fe23ab4
Merge pull request #54 from SiliconLabs/test/Bash-script-support-runs…
silabs-hieuhoang Nov 14, 2024
59d12c9
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
bb080ed
Merge pull request #53 from SiliconLabs/test/Integration-test-for-cpu…
silabs-hieuhoang Nov 14, 2024
774b41c
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
0e0d2d4
Merge pull request #52 from SiliconLabs/test/Integration-test-for-inv…
silabs-hieuhoang Nov 14, 2024
b43411b
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
65940d8
Merge pull request #51 from SiliconLabs/test/Integration-test-for-var…
silabs-hieuhoang Nov 14, 2024
bad6bcf
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
31b8de7
Merge pull request #50 from SiliconLabs/test/Integration-test-for-wat…
silabs-hieuhoang Nov 14, 2024
4737f88
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
4a991fc
Merge pull request #49 from SiliconLabs/test/Integration-test-for-sys…
silabs-hieuhoang Nov 14, 2024
b04b15b
resolve conflict before merge branch
silabs-hieuhoang Nov 14, 2024
10fe26c
Merge pull request #48 from SiliconLabs/test/Integration-test-for-irq…
silabs-hieuhoang Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 47 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ message("-- Toolchains build: ${TOOL_CHAINS}")

# enable unit test
option(ENABLE_UNIT_TESTING "Enable a Unit Testing Build" OFF)
# enable integration test
option(ENABLE_INTEGRATION_TESTING "Enable a Integration Testing Build" OFF)

# choose board name
option(BOARD_NAME "choose board name" brd4187c)
Expand All @@ -47,14 +49,11 @@ endif()

add_subdirectory(lib)
add_subdirectory(test)
# Run Make file
include(makefile)

if(ENABLE_UNIT_TESTING)

# Run generate_lib_iec60730
include(generate_lib_iec60730)

if(ENABLE_UNIT_TESTING)
generate_lib_iec60730(${SDK_CMAKE_RELATIVE_DIR})
get_target_property(MAIN_CFLAGS_LIB_IEC60730 slc_lib_iec60730 COMPILE_OPTIONS)
string(REPLACE "$<$<COMPILE_LANGUAGE:C>:SHELL:-imacros sl_gcc_preinclude.h>;" "" MAIN_CFLAGS_LIB_IEC60730 "${MAIN_CFLAGS_LIB_IEC60730}")
Expand All @@ -65,4 +64,48 @@ target_compile_options(unity PUBLIC

endif()

if(ENABLE_INTEGRATION_TESTING)
generate_lib_iec60730(${SDK_CMAKE_RELATIVE_DIR})
endif()

# Support calculate CRC
option(ENABLE_CAL_CRC_32 "Enable calculate crc 32" OFF)
option(ENABLE_CRC_USE_SW "Enable using software calculate CRC" OFF)
option(ENABLE_SW_CRC_TABLE "Enable software calculate CRC using table CRC" OFF)
set(OPTION_SUPPORT_TEST_IMC_MODULE "ENABLE_CAL_CRC_32 ENABLE_CRC_USE_SW ENABLE_SW_CRC_TABLE")

# Set address start calculate crc
if(DEFINED ENV{FLASH_REGIONS_TEST})
set(FLASH_REGIONS_TEST "$ENV{FLASH_REGIONS_TEST}")
else()
set(FLASH_REGIONS_TEST "0x00000000")
endif()

message("-- Options to support running tests of invariable memory modules: ${OPTION_SUPPORT_TEST_IMC_MODULE}")

if(ENABLE_CAL_CRC_32)
set(DEFINE_ENABLE_CAL_CRC_32 "SL_IEC60730_USE_CRC_32_ENABLE=1")
message("-- Support crc calculation for invariable memory modules: CRC-32")
else()
set(DEFINE_ENABLE_CAL_CRC_32 "SL_IEC60730_USE_CRC_32_ENABLE=0")
message("-- Support crc calculation for invariable memory modules: CRC-16")
endif()

if(ENABLE_CRC_USE_SW)
set(DEFINE_ENABLE_CRC_USE_SW "SL_IEC60730_CRC_USE_SW_ENABLE=1")
message("-- Enable using software to calculate CRC")
if(ENABLE_SW_CRC_TABLE)
set(DEFINE_ENABLE_SW_CRC_TABLE "SL_IEC60730_SW_CRC_TABLE_ENABLE=1")
message("-- Enable software using CRC pre-defined table to calculate CRC")
else() # ENABLE_SW_CRC_TABLE
set(DEFINE_ENABLE_SW_CRC_TABLE "SL_IEC60730_SW_CRC_TABLE_ENABLE=0")
message("-- Disable software using CRC pre-defined table to calculate CRC")
endif() # ENABLE_SW_CRC_TABLE
else() # ENABLE_CRC_USE_SW
set(DEFINE_ENABLE_CRC_USE_SW "SL_IEC60730_CRC_USE_SW_ENABLE=0")
message("-- Enable using harware GPCRC to calculate CRC")
endif() # ENABLE_CRC_USE_SW

message("-- Start address calculate crc value of flash: ${FLASH_REGIONS_TEST}")


60 changes: 50 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,24 @@ $ slc generate $GSDK/app/common/example/blink_baremetal -np -d blinky -name=blin

### Export Variable

Export SDK_PATH=<path_to_sdk>, ARM_GCC_DIR=<path_to_toolchain>, TOOL_CHAINS and START_ADDR_FLASH (flash start address support calculate crc for module invariable memory) before run config CMake.
Export SDK_PATH=<path_to_sdk>, ARM_GCC_DIR=<path_to_toolchain>, TOOL_CHAINS and FLASH_REGIONS_TEST (flash start address support calculate crc for module invariable memory) before run config CMake.

If you want to calculate from start address to end address of flash:

```sh
$ export SDK_PATH=~/SimplicityStudio/SDKs/gecko_sdk
$ export TOOL_DIRS=~/Downloads/SimplicityStudio_v5/developer/toolchains/gnu_arm/12.2.rel1_2023.7/bin
$ export TOOL_CHAINS=GCC
$ export START_ADDR_FLASH=0x8000000
$ export FLASH_REGIONS_TEST=0x8000000
```

or if you want to calculate multiple regions:

```sh
$ export FLASH_REGIONS_TEST="0x8000000 0x8000050 0x80000a0 0x80000f0 0x8000140 0x8000190"
```

with START_ADDR_FLASH=0x8000000 is flash start address of board name brd4187c (chip EFR32MG24)
with FLASH_REGIONS_TEST=0x8000000 is flash start address of board name brd4187c (chip EFR32MG24)

1. Create Source and CMakeLists.txt
2. mkdir build
Expand All @@ -167,25 +175,57 @@ $ cd build
$ cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_UNIT_TESTING=ON -DBOARD_NAME=brd4187c
```

With the commands above, the default value supports calculation CRC-16. If you want to change to calculate for CRC-32 bits, use the config command below
CMake Build

```sh
$ cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_UNIT_TESTING=ON -DBOARD_NAME=brd4187c -DENABLE_CAL_CRC_32=ON
$ cmake --build . --target unit_test_info -j4
```

Here is some options to support running tests of invariable memory modules:
- ENABLE_CAL_CRC_32
- ENABLE_CRC_USE_SW (if this option ON, you can enable option: ENABLE_SW_CRC_TABLE)
or

```sh
$ make unit_test_info -j4
```

### Run integration test

CMake config

```sh
$ make prepare
$ cd build
$ cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=brd4187c
```

CMake Build

```sh
$ cmake --build . --target unit_tests -j4
$ cmake --build . --target integration_test_info -j4
```

or

```sh
$ make unit_tests -j4
$ make integration_test_info -j4
```

### CRC calculation options

With the commands above, the default value supports calculation CRC-16. If you want to change to calculate for CRC-32 bits, use the config command below

```sh
$ cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_UNIT_TESTING=ON -DBOARD_NAME=brd4187c -DENABLE_CAL_CRC_32=ON
```

or

```sh
$ cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=brd4187c -DENABLE_CAL_CRC_32=ON
```

Here is some options to support running tests of invariable memory modules:
- ENABLE_CAL_CRC_32
- ENABLE_CRC_USE_SW (if this option ON, you can enable option: ENABLE_SW_CRC_TABLE)

> [!NOTE]
> Only use ENABLE_SW_CRC_TABLE option when the ENABLE_CRC_USE_SW option is ON, otherwise an error will be reported during the build process.
80 changes: 80 additions & 0 deletions cmake/integration_test.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
function(generate_integration_test relative_dir target_name)
set(FULL_DIR ${CMAKE_SOURCE_DIR}/${relative_dir})
set(LINKER_PATH ${CMAKE_BINARY_DIR}/${SDK_LIB_CMAKE_RELATIVE_DIR}/${LIB_IEC60730_MAP})
set(INTEGRATION_TEST_NAME ${target_name})
string(REPLACE "integration_test_" "" INTEGRATION_SOURCE_NAME "${INTEGRATION_TEST_NAME}")
set(INTEGRATION_TEST_NAME_BUILD_DIR "build/${BOARD_NAME}/${target_name}")

if(${target_name} STREQUAL "integration_test_iec60730_cpu_registers")
set(INTEGRATION_TEST_SOURCES
"${FULL_DIR}/src/main.c"
"${FULL_DIR}/src/app.c"
"${FULL_DIR}/src/integration_test_common.c"
"${FULL_DIR}/src/${target_name}.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_cpu_registers.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_cpu_registers_ns.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_cpu_registers_s.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_post.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_bist.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_watchdog.c"
)
else()
set(INTEGRATION_TEST_SOURCES
"${FULL_DIR}/src/main.c"
"${FULL_DIR}/src/app.c"
"${FULL_DIR}/src/integration_test_common.c"
"${FULL_DIR}/src/${target_name}.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_${INTEGRATION_SOURCE_NAME}.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_post.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_bist.c"
"${FULL_DIR}/../../lib/src/sl_iec60730_watchdog.c"
)
endif()
string(TOUPPER ${INTEGRATION_TEST_NAME} DEFINE_INTEGRATION_TEST)
set(INTEGRATION_TEST_INCLUDES
"${FULL_DIR}/inc"
${UNITY_HEADER})
add_executable(${INTEGRATION_TEST_NAME} ${INTEGRATION_TEST_SOURCES})
target_include_directories(${INTEGRATION_TEST_NAME} PUBLIC ${INTEGRATION_TEST_INCLUDES})
target_compile_definitions(${INTEGRATION_TEST_NAME} PUBLIC ${DEFINE_INTEGRATION_TEST}_ENABLE
${DEFINE_ENABLE_CAL_CRC_32}
${DEFINE_ENABLE_CRC_USE_SW}
${DEFINE_ENABLE_SW_CRC_TABLE})

target_link_libraries(${INTEGRATION_TEST_NAME} PUBLIC slc_lib_iec60730)

# Create .bin, .hex and .s37 artifacts after building the project
add_custom_command(TARGET ${INTEGRATION_TEST_NAME}
POST_BUILD
COMMAND rm -rf ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND ${CMAKE_OBJCOPY} -O srec "$<TARGET_FILE:${INTEGRATION_TEST_NAME}>" "$<TARGET_FILE_DIR:${INTEGRATION_TEST_NAME}>/$<TARGET_FILE_BASE_NAME:${INTEGRATION_TEST_NAME}>.s37"
COMMAND ${CMAKE_OBJCOPY} -O ihex "$<TARGET_FILE:${INTEGRATION_TEST_NAME}>" "$<TARGET_FILE_DIR:${INTEGRATION_TEST_NAME}>/$<TARGET_FILE_BASE_NAME:${INTEGRATION_TEST_NAME}>.hex"
COMMAND ${CMAKE_OBJCOPY} -O binary "$<TARGET_FILE:${INTEGRATION_TEST_NAME}>" "$<TARGET_FILE_DIR:${INTEGRATION_TEST_NAME}>/$<TARGET_FILE_BASE_NAME:${INTEGRATION_TEST_NAME}>.bin"
COMMAND mkdir -p ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND mv ${INTEGRATION_TEST_NAME}.out ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND mv ${INTEGRATION_TEST_NAME}.bin ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND mv ${INTEGRATION_TEST_NAME}.hex ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND mv ${INTEGRATION_TEST_NAME}.s37 ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${LINKER_PATH} ${INTEGRATION_TEST_NAME_BUILD_DIR}
COMMAND mv ${INTEGRATION_TEST_NAME_BUILD_DIR}/${LIB_IEC60730_MAP} ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.map
)

if(${target_name} STREQUAL "integration_test_iec60730_invariable_memory")
if(ENABLE_CAL_CRC_32)
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.out > ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.lst
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc32.sh '${CMAKE_CURRENT_BINARY_DIR}/${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' "${FLASH_REGIONS_TEST}")
else()
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.out > ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.lst
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc16.sh '${CMAKE_CURRENT_BINARY_DIR}/${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' "${FLASH_REGIONS_TEST}")
endif()
else()
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.out > ${INTEGRATION_TEST_NAME_BUILD_DIR}/${INTEGRATION_TEST_NAME}.lst)
endif()
# Run post-build pipeline to perform additional post-processing
if(post_build_command)
add_custom_command(TARGET ${INTEGRATION_TEST_NAME}
POST_BUILD
COMMAND ${post_build_command}
)
endif()
endfunction(generate_integration_test)
22 changes: 3 additions & 19 deletions cmake/unit_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@ function(generate_unit_test relative_dir target_name source_file)
set(UNIT_TEST_NAME ${target_name})
set(UNIT_TEST_NAME_BUILD_DIR "build/${BOARD_NAME}/${target_name}")

if(ENABLE_CAL_CRC_32)
set(DEFINE_ENABLE_CAL_CRC_32 "SL_IEC60730_USE_CRC_32_ENABLE")
else()
set(DEFINE_ENABLE_CAL_CRC_32 "")
endif()

if(ENABLE_CRC_USE_SW)
set(DEFINE_ENABLE_CRC_USE_SW "SL_IEC60730_CRC_USE_SW_ENABLE")
if(ENABLE_SW_CRC_TABLE)
set(DEFINE_ENABLE_SW_CRC_TABLE "SL_IEC60730_SW_CRC_TABLE_ENABLE")
else() # ENABLE_SW_CRC_TABLE
set(DEFINE_ENABLE_SW_CRC_TABLE "")
endif() # ENABLE_SW_CRC_TABLE
else() # ENABLE_CRC_USE_SW
set(DEFINE_ENABLE_CRC_USE_SW "")
endif() # ENABLE_CRC_USE_SW

if(${target_name} STREQUAL "unit_test_iec60730_cpu_registers")
set(UNIT_TEST_SOURCES
"${FULL_DIR}/src/main.c"
Expand Down Expand Up @@ -50,6 +33,7 @@ function(generate_unit_test relative_dir target_name source_file)
${DEFINE_ENABLE_CAL_CRC_32}
${DEFINE_ENABLE_CRC_USE_SW}
${DEFINE_ENABLE_SW_CRC_TABLE})

target_link_libraries(${UNIT_TEST_NAME} PUBLIC unity slc_lib_iec60730)

# Create .bin, .hex and .s37 artifacts after building the project
Expand All @@ -71,10 +55,10 @@ function(generate_unit_test relative_dir target_name source_file)
if(${target_name} STREQUAL "unit_test_iec60730_invariable_memory")
if(ENABLE_CAL_CRC_32)
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.out > ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.lst
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc32.sh '${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' '${START_ADDR_FLASH}')
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc32.sh '${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' "${FLASH_REGIONS_TEST}")
else()
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.out > ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.lst
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc16.sh '${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' '${START_ADDR_FLASH}')
&& bash ${CMAKE_SOURCE_DIR}/lib/crc/sl_iec60730_cal_crc16.sh '${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}' '' 'C:/srecord/bin' '${TOOL_CHAINS}' "${FLASH_REGIONS_TEST}")
endif()
else()
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.out > ${UNIT_TEST_NAME_BUILD_DIR}/${UNIT_TEST_NAME}.lst)
Expand Down
16 changes: 13 additions & 3 deletions components/iec60730_lib.slcc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@ description: >
1) Go to C/C++ Build > Settings > Tool Settings > Memory Layout and browse to edit the linker file. The default linker file name is linkerfile_iec60730.ld.

2) In the default configuration, SL_IEC60730_CRC_DEBUG_ENABLE can support debugging the CRC test module invariable memory calculations. If you want to disable this configuration, you should copy either sl_iec60730_cal_crc32.sh or sl_iec60730_cal_crc16.sh in the path: "lib/crc/" which helps a CRC-calculated image file for testing.
You must flash the image which have the corresponding image file suffix _crc16 and _crc32.

To support CRC image calculation, follow these steps: Go to C/C++ Build > Settings > Build Steps > Post-build steps > Command and use the appropriate command for the toolchain, for instance:

- With GCC: arm-none-eabi-objdump -t -h -d -S '${BuildArtifactFileBaseName}.axf' >'${BuildArtifactFileBaseName}.lst' && sh '${ProjDirPath}/iec60730_10.0/lib/crc/sl_iec60730_cal_crc16.sh' '${BuildArtifactFileBaseName}' '' 'C:\srecord\bin' 'GCC' '0x00000000'.
If you want to calculate from start address to end address of flash:

- With IAR: ielfdumparm --all --source ${BuildArtifactFileBaseName}.out > ${BuildArtifactFileBaseName}.lst && sh '${ProjDirPath}/iec60730_10.0/lib/crc/sl_iec60730_cal_crc16.sh' '${BuildArtifactFileBaseName}' '' 'C:\srecord\bin ' 'IAR' '0x00000000'.
- With GCC: arm-none-eabi-objdump -t -h -d -S '${BuildArtifactFileBaseName}.axf' >'${BuildArtifactFileBaseName}.lst' && bash ${ProjDirPath}/iec60730_1.0.0/lib/crc/sl_iec60730_cal_crc16.sh ${BuildArtifactFileBaseName} "" "C:\srecord\bin" GCC "0x8000000"

- With IAR: ielfdumparm --all --source ${BuildArtifactFileBaseName}.out > ${BuildArtifactFileBaseName}.lst && bash ${ProjDirPath}/iec60730_1.0.0/lib/crc/sl_iec60730_cal_crc16.sh ${BuildArtifactFileBaseName} "" "C:\srecord\bin" IAR "0x8000000"

or if you want to calculate multiple regions:

- With GCC: arm-none-eabi-objdump -t -h -d -S '${BuildArtifactFileBaseName}.axf' >'${BuildArtifactFileBaseName}.lst' && bash ${ProjDirPath}/iec60730_1.0.0/lib/crc/sl_iec60730_cal_crc16.sh ${BuildArtifactFileBaseName} "" "C:\srecord\bin" GCC "0x8000000 0x8000050 0x80000a0 0x80000f0 0x8000140 0x8000190"

- With IAR: ielfdumparm --all --source ${BuildArtifactFileBaseName}.out > ${BuildArtifactFileBaseName}.lst && bash ${ProjDirPath}/iec60730_1.0.0/lib/crc/sl_iec60730_cal_crc16.sh ${BuildArtifactFileBaseName} "" "C:\srecord\bin" IAR "0x8000000 0x8000050 0x80000a0 0x80000f0 0x8000140 0x8000190"

For the IAR toolchain, it is necessary to add the linker option in C/C++ Build > Settings > Tool Settings > IAR Linker for ARM > Extra Options: "--keep __checksum --place_holder __checksum,2,.checksum,64"

For the IAR toolchain, it is necessary to add the linker option: "--keep __checksum --place_holder __checksum,2,.checksum,64"
label: IEC60730 Lib
quality: production
id: iec60730_lib
Expand Down
14 changes: 14 additions & 0 deletions docs/html/EFR32_ICE60730_Libraries/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ <h3><a id="index_i"></a>- i -</h3><ul>
<li>iec60730_WatchdogValid
: <a class="el" href="group__IEC60730__WDOG__Test.html#ggaece8bdb434f4c8bafba3590467815044a7f643e2fc022bee4149c82ec9c42f3ef">sl_iec60730_watchdog.h</a>
</li>
<<<<<<< HEAD:docs/html/EFR32_ICE60730_Libraries/globals.html
<li>SL_IEC60730_IMC_CRC_BUFFER_SAMPLE_TEST
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#ga558de50fe1c89a1afb8292d2ee4346da">sl_iec60730.h</a>
</li>
Expand All @@ -390,6 +391,19 @@ <h3><a id="index_i"></a>- i -</h3><ul>
</li>
<li>SL_IEC60730_IMC_DATA_READ_BYTE_REVERSED
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#gga06fc87d81c62e9abb8790b6e5713c55ba641228c714e8ef6fb667f3ee76761f22">sl_iec60730.h</a>
=======
<li>IMC_CRCBUFFER_SAMPLETEST
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#ga558de50fe1c89a1afb8292d2ee4346da">iec60730.h</a>
</li>
<li>IMC_DATA_READ
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#gga06fc87d81c62e9abb8790b6e5713c55ba81e9d30c093158a799c13cf1d42df28a">iec60730.h</a>
</li>
<li>IMC_DATA_READ_BIT_REVERSED
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#gga06fc87d81c62e9abb8790b6e5713c55ba14b98b0e584e8059ab9e3990ffe8e149">iec60730.h</a>
</li>
<li>IMC_DATA_READ_BYTE_REVERSED
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#gga06fc87d81c62e9abb8790b6e5713c55ba641228c714e8ef6fb667f3ee76761f22">iec60730.h</a>
>>>>>>> develop:Doc/html/EFR32_ICE60730_Libraries/globals.html
</li>
<li>INV_CLASSB_PVAR
: <a class="el" href="group__IEC60730__POST.html#ga5e516d9dd091357c8ecb7ba3c10c7f9b">sl_iec60730.h</a>
Expand Down
5 changes: 5 additions & 0 deletions docs/html/EFR32_ICE60730_Libraries/globals_defs.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ <h3><a id="index_i"></a>- i -</h3><ul>
<li>IEC60730_VMC_COMPLETE
: <a class="el" href="group__IEC60730__PROGRAMME__COUNTER.html#gac9c345ed684a034b5a5cb53efa21cc63">sl_iec60730.h</a>
</li>
<<<<<<< HEAD:docs/html/EFR32_ICE60730_Libraries/globals_defs.html
<li>SL_IEC60730_IMC_CRC_BUFFER_SAMPLE_TEST
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#ga558de50fe1c89a1afb8292d2ee4346da">sl_iec60730.h</a>
=======
<li>IMC_CRCBUFFER_SAMPLETEST
: <a class="el" href="group__IEC60730__INVARIABLE__MEMORY__Test.html#ga558de50fe1c89a1afb8292d2ee4346da">iec60730.h</a>
>>>>>>> develop:Doc/html/EFR32_ICE60730_Libraries/globals_defs.html
</li>
<li>INV_CLASSB_PVAR
: <a class="el" href="group__IEC60730__POST.html#ga5e516d9dd091357c8ecb7ba3c10c7f9b">sl_iec60730.h</a>
Expand Down
Loading