Semihosting an Serial out both failing

Sysprogs forums Forums VisualGDB Semihosting an Serial out both failing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29108
    occamman
    Participant

    I’m using Arduino on an Adafruit nrf52840 Feather Express with a J-Link debugger. I can build and flash software, step through code, etc, all is working well.

    I’d like to have a way to write to a terminal, but my efforts are failing so far. I tried enabling semihosting on the Embedded Debug Tweaking properties page, and the ARM semihosting window shows up but my printf statements don’t seem to write to it.

    I thin tried going the serial port route instead, an set up the serial port in the Arduino Project and Arduino Serial Terminal properties page, and when I click the “test connection now” link on the page it comes back as valid. But when I run my code, the port tab says the port can’t be opened.

     

    I’m using VisualGDB Linux edition, version 5.5 preview 4 build 3540)

    Any thoughts are appreciated!

    #29110
    support
    Keymaster

    Hi,

    In order to use semihosting or serial output, it needs to be properly supported by the debugged program. I.e. the call to _write() should be routed to the code that outputs the data to either semihosting interface, or the serial port.

    The semihosting-specific implementation of _write() is usually provided by the toolchain and can be used for regular embedded projects, however as Arduino uses its own build system, it won’t work there out-of-the-box. Our best advice would be to first get semihosting working on a regular embedded project for the same target, understand the involved compiler options (e.g. by comparing the .rsp files) and then try patching the Arduino build scripts to replicate them. That said, this will require non-trivial troubleshooting and may not work at all.

    It could also be worthwhile to check whether the Arduino core for your device provides an existing setting that would enable this functionality.

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