MICROCONTROLLER RECORD INITIAL PARAMETERS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MICROCONTROLLER RECORD INITIAL PARAMETERS

Jump to solution
646 Views
Superdiode
Contributor II

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.

Labels (1)
0 Kudos
1 Solution
525 Views
Derrick
NXP Employee
NXP Employee

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

View solution in original post

0 Kudos
3 Replies
526 Views
Derrick
NXP Employee
NXP Employee

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

0 Kudos
525 Views
Superdiode
Contributor II

Hi Derrick:

Thanks for your answer... i'm, testing. I need some time.

0 Kudos
525 Views
Superdiode
Contributor II

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.

0 Kudos