AnsweredAssumed Answered

I have some problem in far pointer use on hy64 microcontroller:  I defined a banked flash section and put a const varible in it;

Question asked by hongjian zhang on Apr 21, 2016
Latest reply on Apr 22, 2016 by hongjian zhang

I have some problem in far pointer use on hy64 microcontroller:  I defined a banked flash section and put a const varible in it; and I want to know the address of this const varible, so I defined a varible to get the address, but it does't work well.  my code is like this:

#define uint16 unsigned int

 

#pragma const_seg bank_flash1

const uint16 CheckHead = 0x22AA;

#pragma const_seg default

 

void ValuleCheck(void)

{

     uint16 * far Value1;

     volatile uint16 Value2;

 

     Value1 = CheckHead;

      Value2 = * Value1; 

}

 

 

the bank_flash1 in .prm file is defined as 0x0efbc0~0x0efbc1

 

and every time the Value2 is not the const value ,it is just the value of the page of unbanked

Outcomes