Skip to main content
Explorer II
March 4, 2024
Solved

Logic for checksum of s19 file in stm8 stvp

  • March 4, 2024
  • 3 replies
  • 2034 views

Hello. I am trying to modify my s19 file which is generated for stm8 using stvd and cosmic c compiler.

 

Consider an S19 file which starts from 0x4000 address [EEPROM starting address]

The first two lines would be : 

S123400000000000000000000000000000000000000000000000000000000000000000009C
S123402000000000000000000000000000000000000000000000000000000000000000007C

I want to know what is the meaning of the first characters S123 and the last byte 9C/7C etc.

 

This is important for me to understand the logic to modify the s19 accordingly.  

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    @raja1 You can also find the format described in Wikipedia.

    Regards
    /Peter

    3 replies

    Graduate II
    March 4, 2024

    You'd think it would be documented somewhere..

    Perhaps look at srecords project

    Technical Moderator
    March 4, 2024

    @raja1 You can also find the format described in Wikipedia.

    Regards
    /Peter

    raja1Author
    Explorer II
    March 4, 2024

    Thank you @Peter BENSCH ! This is what I was looking for. I was confused on how the checksum was being evaluated but it makes sense now.