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 Reply Children
  • Hex code format will not be include the memory type. If the debug tools, it is located at 0x0000. That means, Finally the hex file start address offset is wrong. The reason usual is the memory map definition. SES is depend on ld file. The Keil C is decided by project file. Even thought, your map file is okaye. But I think that it must be something wrong from your project file or startup .s file.

Related