This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: GDB debug in public ROM code

Part Number: AM3358
Other Parts Discussed in Thread: SEGGER

I am working with the BeagleBone Black, based on the am3358. I am using GNU Arm Embedded Toolchain Version 7-2018-q2-update, OpenOCD 10.0.8, and a Segger JLINK adapter.

I"ve built both the bootloader and gpio examples for the beaglebone black from the starterware 2.00 package. The files have been loaded to the SDCARD, per the user guide and the LED is flashing. The software side is good.

To familiarize myself gdb/openocd along with TI's code approach to initializing the chip, I want to follow the known, working code. After starting up openocd and gdb,   I issue a "monitor reset halt"  and then a "break *0x402F0400". As I understand it, the Public ROM reads the SYSBOOT pins and then searches the SDCARD for MLO and then the app file (BBB default boot config). The Public ROM copies the MLO to address 0x402F0400 and starts execution from that address.

As it stands now, gdb is not breaking at that address. After issuing the "continue" command, the LED starts blinking right away. CTRL-C drops me at a program counter somewhere in the 0x8000000 area where the gpio app itself is located. I am unable to stop the CPU at the beginning of user code, after the Public ROM has done its job.

Any ideas as to the steps to start the debugging session after the Public ROM has done first stage initialization and copied the user code to the internal SRAM??

Also. I did "load <...>/boot.out" from gdb. I am able to step through the code like a regular gdb session. However, the bootloader reaches a point where it says it can't find the SDCARD over the UART console. I suspect that even though the chip can execute the code from the load command, the chip is not in a state consistent with how the Public ROM would have initialized it. Another reason I want to stop right after the Public ROM has finished its job is to review the state of the chip at this exact point. I want to confirm that I am reading the Technical Reference Manual correctly.

  • The software team have been notified. They will respond here.
  • Hi,

    You mentioned GDB debugger. What is the environment you practice this? Under Linux? I am not quite sure about this but typically we used the JTAG for debug purpose. The ROM bootloader loads the MLO, the MLO parse the app to find the entry point of the real application (your GPIO LED blinking) and jump into it for execution. We typically set the breakpoint just before the jump.

    Another way we typically debug an application is put a code for infinite loop for a volatile variable right at the beginning of the application, like:

    unsigned int volatile flag = 1;
    main () {

    while (flag==1) {
    }

    real code;
    }

    So when app is entered from MLO, it stuck here. Then we load the symbol and modify the flag to 0 to continue debug through the application.

    I believe the concept is the same for you to use GDB or I use JTAG. Hope this works for you.

    Regards, Eric