I want to merge soft device, application and boot loader in order to improve efficiency for factory. I searched relative topics in this forum and found something useful. At last I got a solution. But I still have confusion on it. It is said that declaration "uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used));" should be initialized. So I do as I was told like this: "uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used)) = {BANK_VALID_APP};". After everything done, I got m_bootloader_settings. I found member bank_0 wasn't the very value BANK_VALID_APP. Once I found it was 0x1FF0B00 and 0x101FF02. I changed initialization as 0x02, 0x03 and other 1 byte length values, then I found the most significant byte of member bank_0 changed as I set. I'm sure I had erased all flash before programming. It seems that m_bootloader_settings doesn't locate from address BOOTLOADER_SETTINGS_ADDRESS. When I use "const" to restrain m_bootloader_settings, I can find it at BOOTLOADER_SETTINGS_ADDRESS correctly, with everything as I expected. But I'm not sure what adventure it will cause.
Is there anyone have got any tips?