PIC24 and dsPIC memory

… visits
Parent Previous Next

On supported Positron16 targets, the compiler places USB backing storage in suitable unpaged RAM. The USB controller needs that storage aligned to a 512-byte boundary. The backing array includes 511 extra bytes so the library can find an aligned position inside it.

Count the shared RAM once

Value

What it counts

USB_RAM_USED

The working USB storage requirement

USB_RAM_ALLOC

That storage plus the alignment allowance

The tool counts the allocation inside the shared variable budget. USB and ordinary variables use the same physical RAM; do not add the USB budget to the variable budget as if they were separate banks.


Some devices have more total RAM than this library can use as unpaged memory. Extra paged/extended RAM is not automatically suitable for USB backing storage. Generated limits use the usable address range below $8000 and stay inside the selected device's real RAM boundaries.

Use normal application arrays

Leave USB_EXTRA_RAM_BYTES disabled on Positron16. Use normal arrays and let the compiler allocate them. Check that the complete program fits the shared budget.


If USB_Init() rejects the backing-storage placement, inspect the final memory map and return to the memory settings generated for your device.

See also

Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and Password Protection