在开发产品中,由于需要做can 升级,所以分别作了boot 和app,但是发现合版成一个一个固件时,总是发现会有重复部分,可是自己明明做的偏移为什么还会重复,仔细分析源码可得,原来是程序中有一个宏定义配置了参数,代码如下:

#ifndef KEIL
#ifndef USE_BOOTLOADER
#ifdef KEIL
const uint32_t __flash_config[] __attribute__((at(0x400))) =
#elif (defined(__GNUC__))
const uint32_t __flash_config[] __attribute__ ((section(".cfmconfig"))) =
#else
#pragma location = 0x400
__root const uint32_t __flash_config[] = //@ ".intvec" =
#endif
{
CONFIG_1,
CONFIG_2,
CONFIG_3,
CONFIG_4,
};  
#endif
#endif

所以需要在app中添加USE_BOOTLOADER。