Skip to content

Commit

Permalink
Add documentation about the checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguokai committed Apr 13, 2020
1 parent 6515e57 commit 66031a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ want to disassemble the code at 0x20000000, use:\
(gdb) disassemble 0x20000001
```

Checksum of binary file
-----------------------

When flashing a file, the checksum of which is calculated, both in md5 and the sum algorithm used by ST's official tool. The detail of sum algorithm can be found in [https://www.st.com/resource/en/user_manual/cd00262073-stm32-stlink-utility-software-description-stmicroelectronics.pdf](https://www.st.com/resource/en/user_manual/cd00262073-stm32-stlink-utility-software-description-stmicroelectronics.pdf).

References
==========

Expand Down
6 changes: 3 additions & 3 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ int stlink_fwrite_sram(stlink_t * sl, const char* path, stm32_addr_t addr) {
fprintf(stderr, "map_file() == -1\n");
return -1;
}
printf("file %s ");
printf("file %s ", path);
md5_calculate(&mf, path);
stlink_checksum(&mf, path);

Expand Down Expand Up @@ -2698,7 +2698,7 @@ int stlink_fwrite_flash(stlink_t *sl, const char* path, stm32_addr_t addr) {
return -1;
}

printf("file %s ");
printf("file %s ", path);
md5_calculate(&mf, path);
stlink_checksum(&mf, path);

Expand Down Expand Up @@ -3266,7 +3266,7 @@ int stlink_fwrite_option_bytes(stlink_t *sl, const char* path, stm32_addr_t addr
return -1;
}

printf("file %s ");
printf("file %s ", path);
md5_calculate(&mf, path);
stlink_checksum(&mf, path);

Expand Down

0 comments on commit 66031a2

Please sign in to comment.