These PIC16 devices have 1024 bytes of physical RAM. Their USB controller can use 496 contiguous bytes from linear address $2000, plus 16 common bytes that this library leaves for the compiler. Ordinary RAM continues after the contiguous USB region.
The library reserves only the USB space your configuration needs. Ordinary variables can use the unused part of the 496-byte region.
For example, a 160-byte USB reservation gives a planning budget of 1024 - 160 = 864 bytes. That budget must hold the stack's arrays and state, compiler working storage, interrupt context and your application. It is not 864 bytes free for your own variables.
The library makes the USB reservation its first normal array declaration and disables automatic heap-array placement for this target. A placement check stops compilation if the reservation does not start at the hardware descriptor-table address.
Keep USB_Device.inc before every variable declaration and before any other include that allocates variables. If the check fails, inspect the assembly/map and include order. Keep the check in place; the descriptor table cannot be moved to an arbitrary address.
Use normal application arrays on PIC16. Do not use USB_ExtraRAM: the compiler already allocates the unused RAM around the USB reservation. Do not place another At variable or array over that reservation, or treat a multi-byte value as one item across a bank boundary.
Enough RAM does not mean enough program memory. MSC and large custom HID descriptors can use all 8192 program words. Compile the smallest useful configuration first, inspect both memory reports, and then add features a little at a time.
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your Documentation with HelpNDoc's Project Analyzer