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

QFAA H0 examples don't work

Hi. I've developed a custom board on an old E0 51422 chip with SDK 6.1 and SD110 7.3.0. Everything works fine with that setup (SPI, interrupts, timers, etc). Got new batch of chips of version H0 (yes, thats 51822) and external intererrupts stopped working (everything else seems more or less fine tho). So I decided to try to upgrade my application to whatever latest supported SDK version. I've been trying to get to run 8.0.0, 10.0.0, 12.0.0 and 12.2.0 version blinky examples with no luck (following this tutorial devzone.nordicsemi.com/.../). It seems that they just go straight to hardfault, at least according to debugger. As I understand, there should be no difference between writing for 51422 and 51822, it's just a question of having ANT? I'm on arm-none-eabi compiler v5.4

Any suggestions on how to get the magic running?

  • Hi Stiebrs,

    When you tested with blinky example, it was the blinky without softdevice or the ble blinky?

    In the SDK we provided some pre-compiled hex file in each example, could you try to test ?

    We usually suggest users to use GNU ARM v4.9 could you give it a try ?

  • Hi Hung Bui, I've been trying to run blinky without SD. Precompiled hexes are of no use to me, because I have a custom board with LEDs on P15/16, and from devboards I have only old PCA10000 and PCA10003. Tried building with 4.9 and debugging:

    
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20008000)
    Read 2 bytes @ address 0x00000000 (Data = 0x8000)
    Target interface speed set to 1000 kHz
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x0000049C)
    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) = 0000049C
    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 0x0000049C (Data = 0x480A2103)
    Read 2 bytes @ address 0x0000049C (Data = 0x2103)
    Select auto target interface speed (2000 kHz)
    Flash breakpoints enabled
    Semi-hosting enabled (Handle on BKPT)
    Semihosting I/O set to TELNET Client
    Read 4 bytes @ address 0x0000049C (Data = 0x480A2103)
    Read 2 bytes @ address 0x0000049C (Data = 0x2103)
    Downloading 1122 bytes @ address 0x00000000 - Verified OK
    Downloading 8 bytes @ address 0x00000464 - Verified OK
    Downloading 100 bytes @ address 0x0000046C - Verified OK
    Writing register (PC = 0x000003ec)
    Read 4 bytes @ address 0x000003EC (Data = 0x480A2103)
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x000003EC)
    Read 2 bytes @ address 0x00000308 (Data = 0xB580)
    Read 2 bytes @ address 0x0000030A (Data = 0xB084)
    Read 2 bytes @ address 0x0000030C (Data = 0xAF00)
    Read 2 bytes @ address 0x0000030E (Data = 0x2300)
    Read 2 bytes @ address 0x00000310 (Data = 0x60FB)
    Read 2 bytes @ address 0x00000312 (Data = 0xE00E)
    Read 2 bytes @ address 0x00000312 (Data = 0xE00E)
    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) = 000003EC
    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 0x000003EC (Data = 0x480A2103)
    Setting breakpoint @ address 0x00000312, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    
  • And just for fun, build log:

    
    make VERBOSE=1 clean nrf51822_xxaa 
    rmdir /s /q _build
    echo  makefile
     makefile
    mkdir _build
    Compiling file: system_nrf51.c
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBOARD_CUSTOM -DBSP_DEFINES_ONLY -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../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../.. -I../../../../../bsp -I../../../../../../components/device -I../../../../../../components/drivers_nrf/hal -c -o _build/system_nrf51.o ../../../../../../components/toolchain/system_nrf51.c
    Compiling file: main.c
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBOARD_CUSTOM -DBSP_DEFINES_ONLY -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../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../.. -I../../../../../bsp -I../../../../../../components/device -I../../../../../../components/drivers_nrf/hal -c -o _build/main.o ../../../main.c
    Compiling file: nrf_delay.c
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-gcc" -DNRF51 -DBOARD_CUSTOM -DBSP_DEFINES_ONLY -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../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../.. -I../../../../../bsp -I../../../../../../components/device -I../../../../../../components/drivers_nrf/hal -c -o _build/nrf_delay.o ../../../../../../components/drivers_nrf/hal/nrf_delay.c
    Compiling file: gcc_startup_nrf51.s
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-gcc" -x assembler-with-cpp -DNRF51 -DBOARD_CUSTOM -DBSP_DEFINES_ONLY -I../../../../../../components/toolchain/gcc -I../../../../../../components/toolchain -I../../.. -I../../../../../bsp -I../../../../../../components/device -I../../../../../../components/drivers_nrf/hal -c -o _build/gcc_startup_nrf51.o ../../../../../../components/toolchain/gcc/gcc_startup_nrf51.s
    Linking target: nrf51822_xxaa.out
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-gcc" -Xlinker -Map=_build/nrf51822_xxaa.map -mthumb -mabi=aapcs -L ../../../../../../components/toolchain/gcc -Tblinky_gcc_nrf51.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/nrf51822_xxaa.out
    make -f  makefile -C ./  -e finalize
    make[1]: Entering directory `D:/programming/NRF_SDK/8.0.0/examples/peripheral/blinky/htf/blank/armgcc'
    Preparing: nrf51822_xxaa.bin
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-objcopy" -O binary _build/nrf51822_xxaa.out _build/nrf51822_xxaa.bin
    Preparing: nrf51822_xxaa.hex
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-objcopy" -O ihex _build/nrf51822_xxaa.out _build/nrf51822_xxaa.hex
    ""
    "D:\programming\arm-gcc\4.9.2015q3/bin/arm-none-eabi-size" _build/nrf51822_xxaa.out
       text	   data	    bss	    dec	    hex	filename
       1130	    100	      0	   1230	    4ce	_build/nrf51822_xxaa.out
    ""
    make[1]: Leaving directory `D:/programming/NRF_SDK/8.0.0/examples/peripheral/blinky/htf/blank/armgcc'
    
    12:59:21 Build Finished (took 877ms)
    
  • Right. Linker file was written for QFAC chip, which has 32k of RAM, while I was using QFAA, which has 16k. Fixed linker script and now it works.

Related