You are reading a single comment by @user156811 and its replies. Click here to read the full conversation.
  • Progress being made.

    helpful links
    debugging nordic chips
    gdb commands

    So after your running gdb is connect to your server you need to

    • load

    Which flashes the code onto the device. From there you can do your next and continue commands.

    You can also edit your ~/.gdbinit file so you don't have to hit enter every time.

    next problem

    So i have testing the above stuff on a nRF52840DK which has lots of flash. But the current micro is a nRF52832 with barely any. So my plan was to add the debug symbols to just the specific files i care about. So this compiles but doesn't seem to add any size to the code base. So thats the next thing to figure out.

    trying to add special debug symbols

    
    $(OBJDIR)/libs/banglejs/jswrap_bangle.o: libs/banglejs/jswrap_bangle.c 
    	@echo " $($(quiet_)compile) "
    
    	@mkdir -p $(shell dirname $@) # create directory if it doesn't exist
    	@$(CC) $(CFLAGS) $< -g -o $@
    
  • So my plan was to add the debug symbols to just the specific files i care about

    AFAIK there is no issue with debug symbols, you have all symbols even without DEBUG=1, they are in elf file and kept on PC side, not part of binary in device. What DEBUG=1 does is turning off optimizations so the binary is much larger. RELEASE=1 turns off extra assert checks (also not needed for debugging). You should be able to debug even without DEBUG=1 and with RELEASE=1. What can happen is that some code is optimized out so the debugger will not match all lines 1:1 when the code is not there, however mostly it works just fine.

    BTW, you can also run make BOARD=... lst to generate .lst text file with C and assembly language mix and all symbols so you can figure out how the code really looks if you get lost when debugging optimized code.

About

Avatar for user156811 @user156811 started