Changes between Version 3 and Version 4 of Boards/Beagle Board

Mar 1, 2018, 8:14:09 AM (4 years ago)
Christian Mauderer

Add chapter describing JTAG debugging using Segger J-Link on BBB.


  • Boards/Beagle Board

    v3 v4  
    233233This section cover JTAG debugging on the various Beagle boards.
    235 == Beaglebone Black JTAG ==
     235== Beaglebone Black JTAG using OpenOCD ==
    237237The following details debugging on a Beaglebone Black with a [ Flyswatter2] and the [ ARM 20-pin to cTI 20-pin JTAG Adapter Board]. You need to solder the adapter board to the Beaglebone Black board.
     321== Beaglebone Black JTAG using Segger J-Link ==
     323This describes how to set up a debugger using the [ Segger J-Link] or [ Segger J-Link EDU] on a Linux host. Note that you need a mechanical adapter for connecting the BBB.
     325=== J-Link gdb Server ===
     327Install the J-Link software either from the Segger home page or from your distributions repository. On Arch Linux, the [ AUR jlink] package can be used.
     329Start the gdb-server with the following command:
     332JLinkGDBServer -device AM3358 -if JTAG -speed 16000
     335Note that this will start a server in the foreground. So do it on it's own console or in some screen or tmux session.
     337=== GDB ===
     339Create a gdb-script `start.gdb` with the following content:
     342define reset
     343        echo -- Reset target and wait for U-Boot to start kernel.\n
     344        monitor reset
     345        # RTEMS U-Boot starts at this address.
     346        tbreak *0x80000000
     347        # Linux starts here.
     348        tbreak *0x82000000
     349        continue
     351        echo -- Disable watchdog.\n
     352        set *(uint32_t*)0x44e35048=0xAAAA
     353        while (*(uint32_t*)0x44e35034 != 0)
     354        end
     355        set *(uint32_t*)0x44e35048=0x5555
     356        while (*(uint32_t*)0x44e35034 != 0)
     357        end
     359        echo -- Overwrite kernel with application to debug.\n
     360        load
     363target remote :2331
     366Start your gdb with a line like follows:
     369arm-rtems4.12-gdb -x start.gdb app.elf
     372The gdb script assumes that the Beagle has some system that it can boot. So put for example a Debian Linux or some RTEMS image on a SD card or on the eMMC of the BBB before starting the gdb. The script will interrupt the boot process during the jump to the "normal" application and load your given elf file instead.
     374Execute the command `reset` (defined by the gdb script) in the gdb shell to start or restart the application.