This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app.hex was loaded in bootloader area when using KEIL compiling.

Hey experts,

We encountered a problem about project porting and using KEIL compiling. 

Here are detailed:

Our products are using gcc+makefile method to compile and generate .hex file, it works fine.
We want to debug product in hardware situation, so we port the project from gcc+makefile to keil.
According to the configuration of makefile and linker file, we added all necessary parameters in options of KEIL.
We didn't change anything of codes. But the startup file was replaced with arm_startup_nrf52.s, not gcc_startup_nrf52.S.

The process of compiling and linking are successful, .hex file was also generated, it sounds good. 

But when we loaded the .hex file generated by KEIL compiler, the application couldn't work.
We found the application was loaded in bootloader area, althoungh we didn't download any bootloader file to chip.

We checked the .map file, it showed all address information are same with we has set. 

Here are some detail figures to explain what happened:

Options for keil:

the .map file:


Thanks for your answer.

Parents
  • May you try the nRF connect programer for your case?

    Actually the MBR(Boot load) , SD (softdevice) ,App (main code) should arrange like above.

    If the app hex code is normal the address offset should be 0x29000 in your case.SD should be 0x1000.

    If your case is app 0x0000, I think the keil C flash will be conflict with SD.But,....It's seems like

    not happen conflict? How?....

    The direct way to debug, You may check the hex generate by keil C. Make sure the address offset is 0x0000 or not.

    Actually will not be 0x0000. 

Reply
  • May you try the nRF connect programer for your case?

    Actually the MBR(Boot load) , SD (softdevice) ,App (main code) should arrange like above.

    If the app hex code is normal the address offset should be 0x29000 in your case.SD should be 0x1000.

    If your case is app 0x0000, I think the keil C flash will be conflict with SD.But,....It's seems like

    not happen conflict? How?....

    The direct way to debug, You may check the hex generate by keil C. Make sure the address offset is 0x0000 or not.

    Actually will not be 0x0000. 

Children
Related