Skip to content

Commit

Permalink
Add Hands-on CRC and ISR_in_ICTM
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanhuanginst committed May 20, 2019
1 parent 419b4ea commit 617741d
Show file tree
Hide file tree
Showing 49 changed files with 4,366 additions and 65 deletions.
Binary file added docs/imgs/hands-on/08_00_crc-test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_00_ewarm-crc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_01_properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_02_post-build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_03_rebuild.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_04_check_files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_05_check-by-programmer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_06_2nd-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_07_modify_debug_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/08_08_final-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_20_SetupLinker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_21_BuildAnalyzer_case2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/hands-on/09_31_BuildAnalyzer_case3.png
2 changes: 1 addition & 1 deletion hands-on/08_F746-DISCO-CRC/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>08_F746-DISCO-CRC</name>
<name>06_F746-DISCO-CRC</name>
<comment></comment>
<projects>
</projects>
Expand Down
62 changes: 0 additions & 62 deletions hands-on/08_F746-DISCO-CRC/08_F746-DISCO-CRC.elf.launch

This file was deleted.

72 changes: 72 additions & 0 deletions hands-on/08_F746-DISCO-CRC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Hands-on: CRC Checksum Generation

### Introduction

IAR EWARM provides a way to generate checksum as shown below:
![](../../docs/imgs/hands-on/08_00_ewarm-crc.png)

How can this be done by using STM32CubeIDE? This hands-on provides an option for you.

### Steps

1. Import the reference project.

2. Build Project

3. Start Debug session and check result from serial port console as shown below:
![](../../docs/imgs/hands-on/08_00_crc-test.png)

* CRC generated by CRC unit in STM32F746 is 0x872D0D45.
* CRC generated by CRC code running over STM32F746 is also 0x872D0D45.
* Checksum stored in the last word of the first sector is 0xFFFFFFFF which is not aligned with that generated by CRC unit and therefore CRC check fails. This is expected since we have not put any checksum into the HEX/BIN file yet.



4. [Srec_cat](http://srecord.sourceforge.net/download.html) could be used to generate CRC checksum and put it into HEX file. To simplify the process, please put srec_cat.exe into the root of project folder.



5. Right click on project icon and then select "Properties":
![](../../docs/imgs/hands-on/08_01_properties.png)



6. Type "..\checksum.bat" in Command of Post-build steps:
![](../../docs/imgs/hands-on/08_02_post-build.png)



7. "Clean Project" and then "Build Project" again and we can see checksum.bat executes correctly without error:
![](../../docs/imgs/hands-on/08_03_rebuild.png)



8. Check files under "Debug" folder and **06_F746-DISCO-CRC_SRECORD.hex** generated by checksum.bat is found:
![](../../docs/imgs/hands-on/08_04_check_files.png)



9. Check the last word of 06_F746-DISCO-CRC_SRECORD.hex by STM32CubeProgrammer. CRC checksum generated by srec_cat and put in the last word of **06_F746-DISCO-CRC_SRECORD.hex** (0x872D9D45) is exactly the same as that by CRC unit of STM32F746 (0x872D9D45).
![](../../docs/imgs/hands-on/08_05_check-by-programmer.png)



10. After running the debug session and checking the result in serial port console, we still get CRC check failure. And memory address 0x08007FFC which is supposed to have CRC checksum 0x872D9D45 still contains 0xFFFFFFFF:
![](../../docs/imgs/hands-on/08_06_2nd-run.png)



11. The reason of this failure is due to the fact that **06_F746-DISCO-CRC_SRECORD.hex** (containing CRC checksum) is not programmed when running debug session. We need to assign 06_F746-DISCO-CRC_SRECORD.hex** (containing CRC checksum) to be programmed instead of original **06_F746-DISCO-CRC.elf** (w/o CRC checksum). Please open "Debug Configuration" and make the following change:

![](../../docs/imgs/hands-on/08_07_modify_debug_config.png)



12. Run debug session again and finally get correct expected result:

![](../../docs/imgs/hands-on/08_08_final-run.png)





4 changes: 2 additions & 2 deletions hands-on/08_F746-DISCO-CRC/checksum.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
arm-none-eabi-objcopy -O ihex 08_F746-DISCO-CRC.elf "08_F746-DISCO-CRC.hex"
srec_cat 08_F746-DISCO-CRC.hex -Intel -fill 0xFF 0x08000000 0x08007FFC -STM32 0x08007FFC -o 08_F746-DISCO-CRC_SRECORD.hex -Intel
C:\ST\STM32CubeIDE_1.0.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\objcopy.exe -O ihex 06_F746-DISCO-CRC.elf "06_F746-DISCO-CRC.hex"
..\srec_cat.exe 06_F746-DISCO-CRC.hex -Intel -fill 0xFF 0x08000000 0x08007FFC -STM32 0x08007FFC -o 06_F746-DISCO-CRC_SRECORD.hex -Intel
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 617741d

Please sign in to comment.