Skip to main content
markbng
Associate II
May 16, 2003
Question

Constant at certain location (0xefff) with C compiler?

  • May 16, 2003
  • 3 replies
  • 943 views
Posted on May 16, 2003 at 06:25

Constant at certain location (0xefff) with C compiler?

This topic has been closed for replies.

3 replies

markbng
markbngAuthor
Associate II
May 14, 2003
Posted on May 14, 2003 at 08:41

Hello,

I wrote firmware that is able to update the firmware of the device ($e000-$efff) by USB. I want to place a constant at the end of this memory to check whether the firmware has been programmed/updated successfully.

This is the constant value:

const Byte FlashableVersionNumber=0x01; //place at 0xefff?

How can I do this with the Cosmic compiler? I was/am new in C, so please clarify with some code. Thanks in advance

Kind regards,

Mark

sjo
Associate III
May 14, 2003
Posted on May 14, 2003 at 15:03

Have alook at

http://www.stmcu.com/forums-cat-256-1.html

, this topic was discussed.

Regards

SJO
stephanie23
Visitor II
May 16, 2003
Posted on May 16, 2003 at 06:25

In both C compilers (Cosmic or Metrowerks), you can define a variable by precising the address where you want it to be (like in the mapfiles for the hardware registers for instance!):

const Byte FlashableVersionNumber @efff;