Topic : stm8_pgm.exe usage

Forum : ST7/STM8

Original Post
Post Information Post
October 16, 2009 - 11:11am
Guest

Hello, :)

I have saved the "program memory" and the "option byte" portions as intel hex format with the st visual programmer.

I'm using stm8_pgm TSTM8S207R8 Pcode.hex Popt.hex and I get no errors.

Checking the flash content of the mcu I see that only the Pcode is loaded on it.

What's the matter ?

regards

Spectre

Replies
Post Information Post
+1
0
-1
October 16, 2009 - 1:33pm
Raisonance Support Team

Hi,

I was not aware that STVP was allowing to save the option bytes in a hex file.
We should check that it saves them in the same format/address as STM8_pgm expects them,
and if yes maybe it's a bug in STM8_pgm.
Please send your opt.hex file to us, at this address:

You should also check that you are using the latest versions of the Ride7 and RKit-STM8 kits. Click help/about to see the versions you have, compare them with the versions available for download on our website, and update them if needed.

In the meantime, the easy workaround for you is this:

1. Program the device using STVP, both flash and option bytes. Check that it is programmed correctly.

2. Use STM8_pgm to dump the content of the device in a hex file, that will then contain both the flash and option bytes data in the format expected by STM8_pgm.

3. Program this dump to replicate your application on other devices.

Note that the normal way to do this would have been to make the compiler/assembler/linker generate the option bytes in the same hex file as the flash from the beginning.

Best Regards,

Vincent

+1
0
-1
October 16, 2009 - 2:31pm
Guest

VincentC wrote:
Hi,

I was not aware that STVP was allowing to save the option bytes in a hex file.
We should check that it saves them in the same format/address as STM8_pgm expects them,
and if yes maybe it's a bug in STM8_pgm.
Please send your opt.hex file to us, at this address:

You should also check that you are using the latest versions of the Ride7 and RKit-STM8 kits. Click help/about to see the versions you have, compare them with the versions available for download on our website, and update them if needed.

In the meantime, the easy workaround for you is this:

1. Program the device using STVP, both flash and option bytes. Check that it is programmed correctly.

2. Use STM8_pgm to dump the content of the device in a hex file, that will then contain both the flash and option bytes data in the format expected by STM8_pgm.

3. Program this dump to replicate your application on other devices.

Note that the normal way to do this would have been to make the compiler/assembler/linker generate the option bytes in the same hex file as the flash from the beginning.

Best Regards,

Vincent

Hi Vincent,

first of all thanks for the fast reply.

I agree with you when you say:
"Note that the normal way to do this would have been to make the compiler/assembler/linker generate the option bytes in the same hex file as the flash from the beginning."

But I'm trying some programming speed tests between stvp-rlink and stm8_pgm-rlink,and the second one is the winner :)

So don't worry about... I have already dumped the entire flash content as you told me and It works.The only issue is that I can't set the rop byte.

Anyway if you are interested in the option bytes hex file generated from the stvp I have sent it to your attention.

Best regards

Spectre1980

p.s. I'm using the lastest : rkit-stm8,ride7 and the stvp 3.1.1.

+1
0
-1
October 16, 2009 - 6:41pm
Raisonance Support Team

Hi,

Thanks for the information.

The file that you sent is not programmed because it does not contain the complementary bytes that are expected for valid Option Bytes values. I will correct STM8_pgm so that in future releases it reports an error in this case, but I will not make it accept this format and generate the complementary bytes automatically, because that could lead to users programming the wrong values in their option bytes. (I'm not saying this is an error in STVP, as the spec is not very clear on this point, but when in doubt I prefer to choose the safest solution rather than the more comfortable one ;) )

For programming the ROP, you can patch the dumped hex file by hand. The hex format is not so complex, and you just have to write xAA instead of x00 at address x4800, which happens to be on the first line/record of the file. (don't forget to substract xAA from the record's checksum.)

For both problems, the clean solution is to make the linker generate the Option Bytes directly in the same hex file as the flash content. Here is an example of how to do that:
\Examples\STM8\REva\STM8S208RB\Toggle

I hope it helps.

Best Regards,

Vincent