Warning message received while trying to allocate variable at specified address

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

Warning message received while trying to allocate variable at specified address

3,219 Views
Xbot
Contributor II
Hi all,
 
I received a warning while trying to allocate a variable at this address :
"failed to convert address 0xBEA01 of IllegalAddress because of Flash area (C000..FFFF) is not paged"
 
my code goes like this:
---> unsigned long IllegalAddress @780801;
 
where did 0xBEA01 came from?
what i want to happen is move a value to that address in a push of a button.
 
 
thanks,
 
 
Labels (1)
0 Kudos
9 Replies

875 Views
ang
Contributor I
hi
0xBEA01 is the hex value of the address (780801)you have mentioned. it may not be a valid address of the micro which you are using
Regards
Ang
0 Kudos

875 Views
Xbot
Contributor II
hahaha my bad... still i got a warning tho. Is my declaration correct?
0 Kudos

875 Views
ang
Contributor I
i think the declaration is correct. but the address may be wrong.
0 Kudos

875 Views
Xbot
Contributor II
any other suggestions?
 
i just want to point to a memory address so i can simulate an access violation interrupt.
0 Kudos

875 Views
CrasyCat
Specialist III
Hello
 
Addresses specified after the @ modifier are always logical addresses.
You cannot specify a global address here.
 
CrasyCat
0 Kudos

875 Views
Xbot
Contributor II
ok, so how do i instead point to an address say the flash area?
 
My code will point to an address(maybe write a value in it) to simulate an access violation in a press of a button.
 
 
for(;:smileywink:{
 
    if (!(PORTB&0x10)){      // PUSH PTB4 button
      *far farptr = 0x780000;
    }
 
...
 
my accessviolation ISR here:
0 Kudos

875 Views
JimDon
Senior Contributor III
Well, I don't know if if CW will set up the page registers correctly, but the syntax would be:


*((far char*) 0x780000) = 0;

This would work on a normal flat address space (i.e 32 bit) machine.
0 Kudos

875 Views
Xbot
Contributor II
Hello Jim,
 
Tried you code. I cant seem to verify if location 780000 had been cleared. From your syntax was it clearing address 780000?
 
any other suggestions from my problem? 
0 Kudos

875 Views
CrasyCat
Specialist III
Hello
 
I tried
  
   *(( char *far) 0x780000) = 0x0;
 
and it did clear global address 0x780000.
To look at global address 0x780000 in memory window:
  - Click with the right mouse button inside of the Memory window
  - In the drop down menu select Address
  -  In the edit box enter 780000'G
 
This should display memory starting at address 0x780000 in global address space.
 
CrasyCat
0 Kudos