| |||||
Technical Support Support Resources
Product Information | C51: ABSOLUTE FAR VARIABLES DO NOT CALL IBANKING FUNCTIONSInformation in this article applies to:
QUESTIONI'm using far variables to access a Flash device in my application. Currently, I have a very simple test code that just tests my configuration. Here is my program:
#pragma VARBANKING
#include <absacc.h>
#define FLASH_BASE 0x80000
#define FlashCmdAddr1 FVAR(unsigned char, FLASH_BASE + 0x555)
#define FlashCmdAddr2 FVAR(unsigned char, FLASH_BASE + 0xAAA)
#define TEST_BYTE FVAR(unsigned char, FLASH_BASE)
static void FlashCmd (
unsigned char cmd,
unsigned char far* addr) {
FlashCmdAddr1 = 0xaa;
FlashCmdAddr2 = 0x55;
*addr = cmd;
}
void main (void) {
while (1) {
FlashCmdSector (0xa0, &TEST_BYTE);
TEST_BYTE = 1;
}
}
The problem is the software does not call the ?C?CLDXPTR and ?C?CSTXPTR that are defined in the L51_BANK.A51 or XBANKING.A51 file. It seems the linker is loading C51L.LIB instead of C51BL.LIB. How can I solve this problem? ANSWERYour assumption is correct. The linker does not use the variable banking library version. You can solve this problem in two ways:
MORE INFORMATION
SEE ALSOLast Reviewed: Monday, July 18, 2005 | ||||
| |||||