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

why the HEX file compiled by Eclipse is different from compiled by keil ?

I install

  1. gcc-arm-none-eabi-4_9-2015q3-20150921-win32
  2. make-3.81
  3. coreutils-5.3.0

and setup the PATH in windows then i enter CMD mode make some command to make sure it works

image description

  1. set the toolchain path in makefile.windows and makefile.posix
"C:\GNU Tools ARM Embedded\4.9 2015q3"
  1. i install "eclipse-cpp-kepler-SR2-win32.zip", then Install GNU ARM Eclipse plug-in (Cross compiler, J-link Debugging and Packs) and load the packs follow " gnuarmeclipse.github.io/.../ " Then go to C/C++->Build->Global Tools path add the paths

          "C:\GnuWin32\bin"
          "C:\GNU Tools ARM Embedded\4.9 2015q3\bin"
    
  2. enter Run/Debug, click on SEGGER J-link ,make sure that it is pointing to your latest Segger install

          "C:\Program Files\SEGGER\JLink_V510f"
    
  3. Create a new Eclipse project from SDK example "blinky" and build Makefile , get "Error: Program "" not found in PATH", so i

  • replace the default build commandwith make VERBOSE=1
  • change thecompiler command pattern from (gcc)|([gc]++)|(clang) to (.gcc)|(.[gc]++)
  • replace ${COMMAND} with arm-none-eabi-gcc and click Apply
  • include the C_SOURCE_FILES,andA SM_SOURCE_FILES.Source files"

and i build Makefile again ,get this from console

14:18:21 **** Incremental Build of configuration Default for project blinky ****
make VERBOSE=1 all 
rm -rf _build
make -f  makefile -C ./  -e cleanobj
make[1]: Entering directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'
rm -rf _build/*.o
make[1]: Leaving directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'
make -f  makefile -C ./  -e nrf51422_xxac 
make[1]: Entering directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'
echo  makefile
 makefile
mkdir _build
Compiling file: system_nrf51.c
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBSP_DEFINES_ONLY -DBOARD_PCA10031 -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -flto -fno-builtin -I../../../ -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/drivers_nrf/hal -I../../../../../bsp -c -o _build/system_nrf51.o ../../../../../../components/toolchain/system_nrf51.c
Compiling file: main.c
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBSP_DEFINES_ONLY -DBOARD_PCA10031 -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -flto -fno-builtin -I../../../ -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/drivers_nrf/hal -I../../../../../bsp -c -o _build/main.o ../../../main.c
Compiling file: nrf_delay.c
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBSP_DEFINES_ONLY -DBOARD_PCA10031 -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu99 -Wall -Werror -O3 -mfloat-abi=soft -ffunction-sections -fdata-sections -fno-strict-aliasing -flto -fno-builtin -I../../../ -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/drivers_nrf/hal -I../../../../../bsp -c -o _build/nrf_delay.o ../../../../../../components/drivers_nrf/hal/nrf_delay.c
Compiling file: gcc_startup_nrf51.s
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-gcc" -x assembler-with-cpp -DNRF51 -DBSP_DEFINES_ONLY -DBOARD_PCA10031 -I../../../ -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../../../../../components/drivers_nrf/hal -I../../../../../bsp -c -o _build/gcc_startup_nrf51.o ../../../../../../components/toolchain/gcc/gcc_startup_nrf51.s
Linking target: nrf51422_xxac.out
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-gcc" -Xlinker -Map=_build/nrf51422_xxac.map -mthumb -mabi=aapcs -L ../../../../../../components/toolchain/gcc -T../../../../../../components/toolchain/gcc/gcc_nrf51_blank_xxac.ld -mcpu=cortex-m0 -Wl,--gc-sections --specs=nano.specs -lc -lnosys _build/system_nrf51.o _build/main.o _build/nrf_delay.o _build/gcc_startup_nrf51.o  -o _build/nrf51422_xxac.out
make -f  makefile -C ./  -e finalize
make[2]: Entering directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'
Preparing: nrf51422_xxac.bin
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-objcopy" -O binary _build/nrf51422_xxac.out _build/nrf51422_xxac.bin
Preparing: nrf51422_xxac.hex
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-objcopy" -O ihex _build/nrf51422_xxac.out _build/nrf51422_xxac.hex
""
"C:\GNU Tools ARM Embedded\4.9 2015q3/bin/arm-none-eabi-size" _build/nrf51422_xxac.out
   text	   data	    bss	    dec	    hex	filename
    899	     96	      0	    995	    3e3	_build/nrf51422_xxac.out
""
make[2]: Leaving directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'
make[1]: Leaving directory `C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'

14:18:22 Build Finished (took 1s.291ms)
  1. i creat a Make target "nrf51422_xxac" and build target (it can only use this name or it will show up "make: *** No rule to make target `nraf51422_xxac'. Stop." )

  2. and i try to download the hex file "C:\nRF51_SDK_7.2.0_cf547b5\examples\peripheral\blinky\pca10031\blank\armgcc_build\nraf51422_xxac.hex" use nRFgo ,but it can not work. so i try to download hex file which compiled by keil,and it works . then i open both of them (two hex file) find they are different

image description

what is the problem in this case?


thx for ur response.so if that problem is chip setting ,how do i set up it? and i run the debug config,but it show up " No source available for "0x0" and " No source available for "(gdb[31].proc[42000].threadGroup[i1],gdb[31].proc[42000].OSthread[1]).thread[1].frame[0]" "

image description

image description

it's my setting

image description

image description

image description

image description

Related