Error - Address already contains a value

Question: While building a project using ImageCraft compiler, I get an error like:  !E C:\PROGRA~1\Cypress\Common\CY3E64~1\tools\Overlap.txt(0) Address from 0x142 to 0x148 already contains a value  What is the reson behind this error and how to resolve it?



A compiler basically first compiles all the C files and generates relocatable assembly code. The linker then places the relocatable assembly code in the relocateable code area.  On the other hand, the project also has code which is placed in absolute area like the boot.asm code.  When an overlap occurs between the relocateable code and the absolute code, the above error is generated. 

Go to Project >> Settings >> Linker tab.  Change the value of Relocatable Code Start Address beyond the range specified in the overlap error.  For example in the above case, the error says Address from 0x142 to 0x148 already contain a value. So, change address value to 0x148 + 1 = 0x149.

Now build the project and the error should have gone.

Most common situation when this Error appears:  Usually, when you begin a new project, the relocateable code start address is correctly set for each device depending on the size of boot.asm.  But when you clone a project from one device to another device, the value of relocateable code start address is taken from the source project.  For example, if the project is cloned from 27443 to 29466, the boot.asm for 29466 is bigger as there is code to handle the Large Memory Model initializations.  But the relocateable code start address value will be from the 27443 project and you will get this error.