Why am I getting an address space overflow error?



This error will occur if the project requires more bytes of data, xdata, or idata than can be provided by the micro controller. In the Silicon Laboratories Output Window, find the number of bytes written to data space and xdata space. Check that the data sizes do not exceed the specified data space sizes. Rearrange variables using specifiers in the variable definitions. For instance, a variable will be forced into xdata space if it is declared as 'unsigned char xdata global_var'.

Also, you can sometimes save significant RAM space on the device by using the code keyword for any data constants (variables declared with the keyword constant).  Explicitly declaring contsants as code instead ensures that the constants will take up only code space, instead of both code and RAM.

Additional information:

* KB Article: Address space overflow troubleshooting

* KB Article: Outputting a memory usage summary for projects built with Keil PK51

* Keil Cx51 User's Guide: Memory Types

  • 8-bit MCUs
  • Knowledge Base Articles