This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Address Space Overflow, change to startup.a51

I have created two pieces of code for the AT89C51CC01, the first is the bootloader, which is located in the flash memory space [0x7000 - 0x7FFF].

This compiles and runs fine, with the reset vector pointing to the startup code which is located at 0x7000.

The second piece of code is the application, which is downloaded in the flash memory space [0x0000 - 0x6FFF]. What I have done is to re-direct the reset vector to jump to 0x7000 in the startup file to call the bootloader first, which will on finding a valid application calls the application startup code fixed at 0x0100.

The problem I have, is if I change the startup.a51 code to

CSEG AT 0
?C_STARTUP: LJMP 0x7000

then I get an address space overflow, the compiler says it requires 208.4 bytes of DATA space. Yet, if I use the default startup.a51 file I dont get any errors, and only 83.2 bytes of DATA space is required?

Has anyone seen this problem before and got any ideas how to solve it?

Parents Reply Children
  • Thank you guys for the hints, I have now got a working solution.

    I changed the SBV register to 0x70 [0x7000] when downloading the bootloader via FLIP software, so the device thinks the reset vector is now at 0x7000, so always calls the bootloader.

    The application code is compiled using the default startup.a51 file, except the code space is limited to 0x0000-0x6FFF and the startup code is redirected to 0x0100. Thus the normal reset vector located at 0x0000 (assigned by the application code to LJMP 0x0100) is ignored.