Split S-Record

Hello, can anybody tell me how to split a s-record file into 2 or more parts. i must upload it over a unit which has only 1 MB Memory, but my s-record is unfortunatly bigger. so i must upload it seperated. Any ideas?

mfg mc

Reply to
mcakal
Loading thread data ...

Use a text editor to split it and copy the end record to the other file.

Meindert

Reply to
Meindert Sprang

do you know how i can manage it, when i must use checksums?

Reply to
mcakal

I assume you respond to my earlier reply. Better leave a piece of the original post, so anyone can see to whom you are responding.

Checksums are only per sentence. So if you cut the file between sentences, there is no need to recalculate any checksum. Of course, when the receiving system calculates its own checksum over the entire file, this needs to be dealt with.

Meindert

Reply to
Meindert Sprang

If you look at the S record file in a text editor you will see that each line starts with an S. Each one of these lines is an S record and has a checksum - i.e. the last two characters in the line are the checksum for that record. The very last line in the file probably starts with S8 or S9 - this is a terminating record.

You need to explain more about what the "unit with the 1MB memory limitation" is doing with the S records. Does it interpret that actual data within each S record or does it just store them all, then pass them on. If it just stores them and then passes them on, you just need to do what Meindert says

e.g. S0 ... S1 ... a S1... b S1... c S1... d S9 ...

split into S0.... S1 ... a S1... b S9 ...

and S0.... S1 ... c S1... d S9 ...

So it depends how the unit with the 1MB memory limitation is processing them.

Reply to
darkknight

to darknight:

i need to pass my software through the unit with 1MB to the end system. my prob is that my software is bigger then 1 MB and so i must upload it in 2 parts. i must verify over checksum the two different uploads that they are correct. Afterwards i must make a checksum about the hole software --> and here i am getting confused, when i paste the software together again on the end system, how i build the checksums?

TIA mcakal

Reply to
mcakal

to darknight:

i need to pass my software through the unit with 1MB to the end system. my prob is that my software is bigger then 1 MB and so i must upload it in 2 parts. i must verify over checksum the two different uploads that they are correct. Afterwards i must make a checksum about the hole software --> and here i am getting confused, when i paste the software together again on the end system, how i build the checksums?

TIA mcakal

Reply to
mcakal

You can see a decsription of S record format here

formatting link

formatting link

I can't really answer you properly without knowing more.

Assuming that you're writing the code at both ends and the 1MB unit just stores all the S records as text, then

  1. At the end system (receiving end), you need to firstly check the checksum of each S record as it's received. However, even if all the individual S record checksums are correct, it doesn't prove that all the data has been received correctly (some records may be missing completely)

  1. You can see in the first of the two links above that the S0 record that appears at the start of the S records, optionally contains text such as a filename so you can use this record to send details such as extra checksums. Alternatively, you could send a third set of S records that contain checksum information and extra detail such as the total number of S records.

To calculate a checksum over a set of S records you can either

  1. Calculate it over the ascii characters that make up the S records or
  2. Decode each S record and build an "image" of the "binary content" of the S records and checksum that.

The checksum itself could be CRC32 which you can find code on the net - e.g. here

formatting link

You might find some useful code here - not sure exactly what it is.

formatting link

formatting link

darkknight

Reply to
darkknight

To darkknight:

Thanks a lot for your Information.

Here i describe you the system:

there is a central unit over which i must make my uploads to my endsystem. this central system has a 1MB limit, so i must split my software in two parts. i must verify for each part that i have made the upload correct by checksum. and for the hole software i must make also a checksum, to check if it is allright. so my question now is can i also split the binary of my software in 2 parts? i will upload it through the central unit and past i together again in the end-system. how can i make now the checksums?

TIA mcakal

Reply to
mcakal

In the S-record there is already a checksum in every line, each one is checked when downloading. Why do you need other checksums?

Reply to
Lanarcam

Let's try this again.

Do you control the software on this central system? What is it? What is it running? Why does it have to buffer the whole load rather than pass it through one buffer at a time?

What is the purpose of this central system? If this is homework, that's OK, but you are not supply enough information for anyone to help you. You are just restating the problem.

This verification is outside the scope of the S-Record, and unless it is a stronger checksum than what is included in the S-Record, seems to be unncessesary.

By just simply doing it. That is the answer.

Reply to
Bryan Hackney

Use the srecord utility you can get at

formatting link

Regards Anton Erasmus

Reply to
Anton Erasmus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.