Problem debugging MBED LPC1768

Sysprogs forums Forums VisualGDB Problem debugging MBED LPC1768

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #20449
    cvrtky
    Participant

    Hello Sysprogs
    I’m working on the above board.
    When I set up a project, I test the connection in the project properties -> debugger settings and it checks out OK, as shown in the attachment.
    Initialising a debug session is a bit slow. It finally locks up trying to erase the flash as shown in the other attachment.

    Please advice. For the record debugging the board using CrossWorks 4.1.1 by Rowley works flawlessly.

    Sincerely
    Tim Børresen

    Attachments:
    You must be logged in to view attached files.
    #20452
    support
    Keymaster

    Hi,

    Thanks, this looks like an OpenOCD bug. Unfortunately OpenOCD’s support for NXP LPC FLASH programming is a bit flaky. As a workaround please try using Segger J-Link with the Segger GDB stub – it’s much more reliable and faster.

    #20455
    cvrtky
    Participant

    SWDIO and SWCLK aren’t broken out to a connector on the original LPC1768 based MBED board. Those pins (pins 3 & 5) are connected to an onboard debugger IC.

    Are you suggesting I solder wires directly onto the MuC?

    /Tim

     

    #20456
    support
    Keymaster

    Hi,

    Actually Segger provides their firmware for some of the LPC boards that turns the on-board LPC-Link into a limited version of a J-Link that works with their software. We would advise trying that first before doing any changes to the board.

    #20458
    cvrtky
    Participant

    Hello again.

    Just in case this is the board in question: https://os.mbed.com/platforms/mbed-LPC1768/.

    On the SEGGER site, I find J-link firmware for the LPC-Link2/3 and OpenSDA. Neither are suited for the above board. At least not directly. The board has a chip only labeled “MBED interface” which I presume is the MBED DAP-LINK debugger. The only other chips on the board are the LPC1768 itself, an Atmel EEPROM and the Ethernet PHY.

    Please advice.

    Cheers
    Tim

    #20464
    support
    Keymaster

    Hi,

    Thanks for checking this. Soldering the wires to the board could be risky and might end up breaking the board (or even your PC), so we cannot advise doing it unless you are OK with the risk.

    Another option would be to try using PyOCD instead of OpenOCD. PyOCD is a part of mbed and should be well-integrated with mbed boards and debug interfaces. We have published a detailed tutorial showing how to setup PyOCD with VisualGDB: https://visualgdb.com/tutorials/arm/pyocd/

    #20474
    cvrtky
    Participant

    Hello again

    I tried following your tutorial. I wasn’t success full. I might have found a new bug.
    I can flash the lpc1768 and pyocd-gdbserver connects w.o. complaining to much. See below.

    C:\VisualGDB\lpc1678\lpc1678\Debug
    (PyOCD) λ C:\VirtualEnvs\PyOCD\Scripts\pyocd-gdbserver.exe -t lpc1768
    INFO:root:DAP SWD MODE initialised
    INFO:root:ROM table #0 @ 0xe00ff000 cidr=b105100d pidr=0
    INFO:root:[0]<e000e000: cidr=b105e00d, pidr=4002bb000, class=14>
    WARNING:root:Invalid coresight component, cidr=0x0
    INFO:root:[1]<e0001000: cidr=0, pidr=0, component invalid>
    INFO:root:[2]<e0002000:FPB cidr=b105e00d, pidr=4002bb003, class=14>
    WARNING:root:Invalid coresight component, cidr=0x0
    INFO:root:[3]<e0000000: cidr=0, pidr=0, component invalid>
    WARNING:root:Invalid coresight component, cidr=0x0
    INFO:root:[4]<e0040000: cidr=0, pidr=0, component invalid>
    INFO:root:[5]<e0041000: cidr=b105900d, pidr=4002bb924, class=9, devtype=13, devid=0>
    INFO:root:CPU core is Cortex-M3
    INFO:root:6 hardware breakpoints, 4 literal comparators
    INFO:root:4 hardware watchpoints
    INFO:root:Telnet: server started on port 4444
    INFO:root:GDB server started at port:3333
    INFO:root:Telnet: server stopped

    When I try to connect from VisualGDB the error as shown in the attachment. As shown in the other attachment the path to pyocd-gdbserver.exe is correct.
    It looks to me as if the macro holding the port number isn’t expanded correctly.

    Please advice.

    Sincerely
    Tim Børresen

    Attachments:
    You must be logged in to view attached files.
    #20477
    support
    Keymaster

    Hi,

    No problem, please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.1.2095.msi. You will need to change any setting (e.g. port number) on the Settings page in order to save the settings with all variables present (newly created projects won’t need this as long as you are using the new build).

    #20478
    cvrtky
    Participant

    It’s working now. Excellent 🙂 !!!
    Thank you.

    Cheers
    Tim

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.