Hello:
I'm currently using the flash to record a HC08GZ60 both the program and certain parameters for the user.
My intention is that when recording the microcontroller, these parameters are in their initial defaults recorded in flash.
In other words, I want the compiler to generate code that I record certain values in certain positions of flash.
I've tried with directives "# pragma" and many inventions, but I get nothing.
I hope you can help me.
Thank you.
Solved! Go to Solution.
Hi David,
If I understand correctly, you want to store a group of values at a specific Flash memory address location when you compile your code. I usually do this by declaring a constant string or structure. The following will store the byte values 0x00, 0x01, 0x02, and 0x03 starting at address 0x8000:
const byte FlashData [] @0x8000 = { 0x00, 0x01, 0x02, 0x03};
By default, the linker will locate any constant values in Flash. So 0x8000 will need to be a valid Flash address.
Does this help?
Best Regards,
Derrick
Hi David,
If I understand correctly, you want to store a group of values at a specific Flash memory address location when you compile your code. I usually do this by declaring a constant string or structure. The following will store the byte values 0x00, 0x01, 0x02, and 0x03 starting at address 0x8000:
const byte FlashData [] @0x8000 = { 0x00, 0x01, 0x02, 0x03};
By default, the linker will locate any constant values in Flash. So 0x8000 will need to be a valid Flash address.
Does this help?
Best Regards,
Derrick
Hi Derrick:
Thanks for your answer... i'm, testing. I need some time.
Hi Derrick:
Sorry I took so long to answer, but sometimes I have more serious problems and I must leave some issues for later.
The code that I have said is just what I needed, I never would have thought to put "const" because I saw it as a variable.
Thank you very much.