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

Compile blinky&ble_app_hrs from SDK_7.2 example in Eclipse

I try to compile SDK example following the tutorials (devzone.nordicsemi.com/.../) , but i got some problems.

1.I can't finish setp of " Setting up a project for debugging in Eclipse "

--in Blinky it show up "Program file does not exist
C:\nRF51_SDK_7.2\examples\peripheral\blinky\pca10031\blank\armgcc_build\nrf51422_xxac.out not found"

--in Ble_App_Hrs it show up "Error while launching command: gdb --version"

I have no ideal to fix it .

2.when i compile the "blinky" as i skip "Setting up a project for debugging in Eclipse" step, then its seems ok! so i downloaod Blinky(use the hex file in _build folder<nrf51422_xxac.h>) use nRFgo to board ,but it can not work!

3.when i compile the "Ble_App_Hrs" also skip "Setting up a project for debugging in Eclipse"step, first,it appear a lot problem with header(include<XXX.h>) can't be found, but i solve it (i add each header's path in properties->C/C++ General->Paths and Symbols->Includes ) , then it is compiled sussceful ,but i can't work after i download to board (use hex file in _build folder<nrf51422_xxac.h> by nRFgo )

4.how to set up the start address in eclipse

so how should i solve those problems, and eclipse can creat the hex file for download?

i need help PLZ

  • i already finished

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

    then i build makefile get this from console :

    • 19:14:23 **** Incremental Build of configuration Default for project armgcc **** 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 directoryC:/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 -O0 -g3 -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 -O0 -g3 -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 -O0 -g3 -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 directoryC:/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 1155 100 0 1255 4e7 _build/nrf51422_xxac.out "" make[2]: Leaving directory C:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc' make[1]: Leaving directoryC:/nRF51_SDK_7.2.0_cf547b5/examples/peripheral/blinky/pca10031/blank/armgcc'

    19:14:24 Build Finished (took 1s.792ms)

    • now the hex file is created

      then i set up the debug config and run the debug

      get this from console :

    • SEGGER J-Link GDB Server V5.10f Command Line Version

    JLinkARM.dll V5.10f (DLL compiled Dec 22 2015 14:24:20)

    -----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: localhost only Generate logfile: off Verify download: on Init regs on start: on Silent mode: off Single run mode: on Target connection timeout: 0 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: nRF51422_xxAC Target interface: SWD Target interface speed: 1000kHz Target endian: little

    Connecting to J-Link... J-Link is connected. Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04 Hardware: V7.00 S/N: 20151125 Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull Checking target voltage... Target voltage: 3.30 V Listening on TCP/IP port 2331 Connecting to target...Connected to target Waiting for GDB connection...Connected to 127.0.0.1 Reading all registers Read 4 bytes @ address 0x00000000 (Data = 0x20008000) Target interface speed set to 1000 kHz Resetting target Halting target CPU... ...Target halted (PC = 0x00000404) R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF R12= FFFFFFFF, R13= 20008000, MSP= 20008000, PSP= FFFFFFFC R14(LR) = FFFFFFFF, R15(PC) = 00000404 XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Read 4 bytes @ address 0x00000404 (Data = 0x480A2103) Select auto target interface speed (2000 kHz) Flash breakpoints enabled Semi-hosting enabled (Handle on BKPT) Semihosting I/O set to TELNET Client SWO disabled succesfully. SWO enabled succesfully. Read 4 bytes @ address 0x00000404 (Data = 0x480A2103) Downloading 891 bytes @ address 0x00000000 - Verified OK Downloading 8 bytes @ address 0x0000037C - Verified OK Downloading 96 bytes @ address 0x00000384 - Verified OK Comparing flash [....................] Done. Erasing flash [....................] Done. Programming flash [....................] Done. Verifying flash [....................] Done. Writing register (PC = 0x00000304) Read 4 bytes @ address 0x00000304 (Data = 0x480A2103) Read 2 bytes @ address 0x00000260 (Data = 0xB5F0) Read 2 bytes @ address 0x00000262 (Data = 0x4647) Read 2 bytes @ address 0x00000264 (Data = 0x25C0) Read 2 bytes @ address 0x00000266 (Data = 0x20A0) Read 2 bytes @ address 0x00000268 (Data = 0x2300) Read 2 bytes @ address 0x0000026A (Data = 0x2401) Read 2 bytes @ address 0x0000026C (Data = 0x2103) Read 2 bytes @ address 0x0000026E (Data = 0xB480) Read 2 bytes @ address 0x00000270 (Data = 0x00AD) Read 2 bytes @ address 0x00000272 (Data = 0x05C0) Read 2 bytes @ address 0x00000274 (Data = 0x3301) Read 2 bytes @ address 0x00000276 (Data = 0x2B20) Read 2 bytes @ address 0x00000278 (Data = 0xD009) Read 2 bytes @ address 0x00000276 (Data = 0x2B20) Resetting target Halting target CPU... ...Target halted (PC = 0x00000304) Read 2 bytes @ address 0x00000260 (Data = 0xB5F0) Read 2 bytes @ address 0x00000262 (Data = 0x4647) Read 2 bytes @ address 0x00000264 (Data = 0x25C0) Read 2 bytes @ address 0x00000266 (Data = 0x20A0) Read 2 bytes @ address 0x00000268 (Data = 0x2300) Read 2 bytes @ address 0x0000026A (Data = 0x2401) Read 2 bytes @ address 0x0000026C (Data = 0x2103) Read 2 bytes @ address 0x0000026E (Data = 0xB480) Read 2 bytes @ address 0x00000270 (Data = 0x00AD) Read 2 bytes @ address 0x00000272 (Data = 0x05C0) Read 2 bytes @ address 0x00000274 (Data = 0x3301) Read 2 bytes @ address 0x00000276 (Data = 0x2B20) Read 2 bytes @ address 0x00000278 (Data = 0xD009) Read 2 bytes @ address 0x00000276 (Data = 0x2B20) R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF R12= FFFFFFFF, R13= 20008000, MSP= 20008000, PSP= FFFFFFFC R14(LR) = FFFFFFFF, R15(PC) = 00000304 XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Read 4 bytes @ address 0x00000304 (Data = 0x480A2103) Setting breakpoint @ address 0x00000276, Size = 2, BPHandle = 0x0001 Starting target CPU...

    • where is the problem?
  • yes , why it can't work? or i set up the wrong chip? hex file should be same as keil's ,so i think the problem may in compiling process. do u have any ideal?

Related