This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Fill of flash memory during reprogram UVision 3

Hello,

I've got some code that saves setup information to flash if the user wants. I save a code to a memory location to let the software know that whether setup information is available or not. If not, I use defaults.

Is there some way on the UVision IDE that will automatically fill a segment of memory with a byte code when I reprogram? Without this capability, the code believes that there are always saved settings and this would be the quick fix.

Thanks in advance,
Matt

Parents
  • Isn't your flash 0xff-filled when you receive the processor?

    In that case, it should be enough to define a flag byte in the data save area. As soon as you save configuration, you set this byte to a value different from 0xff.

    If it is dangerous for your application to run with incorrect configuration, you should store a CRC32, MD5 or Adler-32 or similar in the data save area, to allow you to check if the data is valid. Avoid using a simple check-sum - they give too many false matches!

Reply
  • Isn't your flash 0xff-filled when you receive the processor?

    In that case, it should be enough to define a flag byte in the data save area. As soon as you save configuration, you set this byte to a value different from 0xff.

    If it is dangerous for your application to run with incorrect configuration, you should store a CRC32, MD5 or Adler-32 or similar in the data save area, to allow you to check if the data is valid. Avoid using a simple check-sum - they give too many false matches!

Children