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

Debug Bootloader Makefile settings for Eclipse

I haven't really found too much referencing how to setup an Eclipse DFU Bootloader project for Debugging.

What I know

To get the image to fit in the allocated memory you have to adjust to memory allocation settings in dfu_types.h and the linker file for the project.

Linker File settings

FLASH (rx) : ORIGIN = 0x3A000, LENGTH = 0x5C00

dfu_types.h setting

#define BOOTLOADER_REGION_START         0x0003A000

Makefile Settings

However there are any posts mentioned how to get the compiler optimization settings to play nice with the project. Changing from the default #CFLAGS += -Wall -Werror -Os can result in compile errors. And when this isn't the case, debugging can't find the main.c memory start to be able to trace the code. Can anyone recommend debug settings for the MakeFile?

Parents
  • According to the Development with GCC and Eclipse tutorial, you have to do the following to set up your project for debugging:

    Locate the CFLAGS variables, and change ‘-O3’ to '-O0' for debugging to produce expected results (stack variables loaded directly to CPU registers,etc). Then add '-g3' to CFLAGS to include debug symbols in the .out file (GNU manual).

    As for the RAM settings in the dfu_gcc_nrf51.ld linker file for the QFAA variant, i.e. 16kB RAM:

    RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x1380
    NOINIT (rwx) :  ORIGIN = 0x20003F80, LENGTH = 0x80
    

    -Bjørn

Reply
  • According to the Development with GCC and Eclipse tutorial, you have to do the following to set up your project for debugging:

    Locate the CFLAGS variables, and change ‘-O3’ to '-O0' for debugging to produce expected results (stack variables loaded directly to CPU registers,etc). Then add '-g3' to CFLAGS to include debug symbols in the .out file (GNU manual).

    As for the RAM settings in the dfu_gcc_nrf51.ld linker file for the QFAA variant, i.e. 16kB RAM:

    RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x1380
    NOINIT (rwx) :  ORIGIN = 0x20003F80, LENGTH = 0x80
    

    -Bjørn

Children
Related