MICROCONTROLLER RECORD INITIAL PARAMETERS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MICROCONTROLLER RECORD INITIAL PARAMETERS

ソリューションへジャンプ
1,423件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
1 解決策
1,302件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,303件の閲覧回数
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 件の賞賛
返信
1,302件の閲覧回数
Superdiode
Contributor II

Hi Derrick:

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

0 件の賞賛
返信
1,302件の閲覧回数
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 件の賞賛
返信