Hello,
I have 10 years experience in embedded domain. I have worked on baremetal and Linux platforms with following processors/controllers : ARM,nrf52, nxp H1S12, PIC32, Jetson TX1, IMX,ppc,DSP etc. Regarding you project, I feel either you create two firmware binaries with only a MACRO defines to identify the code. The problem you face here should be because even though both the boards are ARM based the memory mapping will be different. Your application tried to dump the code in LPC and ATMEL in the same way. That may not be feasible but will have to look at the code and linker files to provide more inputs.
Let me know if my profile suits your requirements.
Regards,
Parvathi