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

Precompiled blinky .hex works, my compiled does not

Hi,

I've installed arm-gcc and the dev kit, I've tried several different versions.

I got it to compile the examples just fine. I can compile the example in examples/peripheral/blinky/pca10040/blank/armgcc/

I built my own dev board, and the problem is: using nrfjprog I can flash the precompiled example and it blinks the LED, but my compiled one does not. I don't understand exactly what's happening.

I'm using nRF5_SDK_14.2.0_17b948a and gcc gcc-arm-none-eabi-7-2017-q4-major on Ubuntu Linux x64_64.

My dev board is "rudimentary" but it contains a LED on GPIO20 and it flashes when the precompiled example runs. I can connect using nrfjprog and send new firmware. I am using a cheapo third party j-link cable.

One other thing - the LED blinks much slower (maybe about 4x slower) than it should. This might be because the chip is not running at the same speed as the real pca10040 dev board, I'm using a Bluenor BT832 module ("dead bug" soldered on a prototype strip-board with some LEDs and a reset button)

Parents
  • This seems quite interesting, I have managed to connect the debugger through segger into the board,

    It gives me the following stack trace and registers:

    (gdb) info reg

    r0             0x3d09000        64000000
    r1             0x848    2120
    r2             0x20000000       536870912
    r3             0x0      0
    r4             0x0      0
    r5             0x0      0
    r6             0x0      0
    r7             0x0      0
    r8             0x0      0
    r9             0x0      0
    r10            0x0      0
    r11            0x0      0
    r12            0x0      0
    sp             0x2000ffd8       0x2000ffd8
    lr             0xfffffff9       4294967289
    pc             0x406    0x406 <HardFault_Handler>
    xpsr           0x61000003       1627389955
    msp            0x0      0
    psp            0x0      0
    primask        0x0      0
    basepri        0x0      0
    faultmask      0x0      0
    control        0x0      0
    (gdb) bt
    #0  HardFault_Handler () at /home/mark/toolchain/nRF5_SDK_14.2.0_17b948a/components/toolchain/gcc/gcc_startup_nrf52.S:300
    #1  <signal handler called>
    #2  0x00000000 in __isr_vector ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Reply
  • This seems quite interesting, I have managed to connect the debugger through segger into the board,

    It gives me the following stack trace and registers:

    (gdb) info reg

    r0             0x3d09000        64000000
    r1             0x848    2120
    r2             0x20000000       536870912
    r3             0x0      0
    r4             0x0      0
    r5             0x0      0
    r6             0x0      0
    r7             0x0      0
    r8             0x0      0
    r9             0x0      0
    r10            0x0      0
    r11            0x0      0
    r12            0x0      0
    sp             0x2000ffd8       0x2000ffd8
    lr             0xfffffff9       4294967289
    pc             0x406    0x406 <HardFault_Handler>
    xpsr           0x61000003       1627389955
    msp            0x0      0
    psp            0x0      0
    primask        0x0      0
    basepri        0x0      0
    faultmask      0x0      0
    control        0x0      0
    (gdb) bt
    #0  HardFault_Handler () at /home/mark/toolchain/nRF5_SDK_14.2.0_17b948a/components/toolchain/gcc/gcc_startup_nrf52.S:300
    #1  <signal handler called>
    #2  0x00000000 in __isr_vector ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Children
No Data
Related