|
|||||||||||
Technical Support Support Resources
Product Information |
BL51: Warning 5 (Code Space Memory Overlap)Information in this article applies to:
SYMPTOMSWhen linking your program, the linker responds the following warning:
CAUSEThis warning is caused by one or more code segments that overlap (reside at the same address). The warning message you receive should indicate the address range where the overlap occurred. The segments are typically absolute (interrupt service routines or buffers located at fixed addresses). One common cause is two interrupt routines declared with the same interrupt vector. For example:
Note that the interrupt function names are different but the interrupt vectors are the same. This often happens when an interrupt routine is copied but the vector isn't changed. RESOLUTIONResolving this problem is usually very easy. First, check the linker MAP file for the Code Memory Link Map.
From here, you can locate all of the overlapping segments. Simply search for OVERLAP in the link map section of the map file. In this case, it appears an absolute segment from 10h-23h (14h bytes long) and another absolute segment from 1Bh-1Dh (3h bytes long) are overlapping each other. An absolute segment 3 bytes long starting at address 0000h is the reset vector. Absolute segments 3 bytes long starting at address 0003h, 000Bh, 0013h, 001Bh, and so on are interrupt vectors. These point to the interrupt function (usually written in C). In this case, the absolute segment at address 001Bh is the interrupt vector for interrupt 3. Next, determine where the absolute address comes from by checking the symbol table (from the linker MAP file). For example:
Here you can see that 0010h is buf from the MAIN module (main.c) and 0024h is ISR. If you take a look in the MAIN source file you'll see the problem:
In this case, buf is stored at address 0x10-0x23 and the ISR vector is at address 0x1B-0x1D. And, this is the overlapping memory. MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.