[SOLVED] Controller restart as soon as stdout via semihosting is used

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Controller restart as soon as stdout via semihosting is used

    Hello everyone,

    I'm trying to migrate an IAR project to the Segger embedded studio (with GCC toolchain). The project compile and link properly :) My problem is about debugging. I usually use the SWO interface, now when I "stop" the debugging process the target program shloud keep running, but when the next printf is generated it always stucks in a reboot loop. I'll guess it hang up there because the printf is sent via semihosting, so the controller halt and is waiting for the next jlink command to move on, but didn't get a usuable signal which causes the reboot. So in IAR there is a option for this at the libary settings to move stdout/stdin via SWO and not via semihosting, unfortunately I haven't found a similar option in Segger embedded yet. Is there one? I have tried to force the debugging via SWO but it seems that the stdout (printf) ist not affected. I also tried using Ozone, but it keeps restarting the controller even in normal debug mode.. :(

    TLDR: Is there a possibility to configure all stdout via SWO? Without touching the code nor using RTT implementation?

    Many thanks for your help

    m :)
  • Hello,

    Thank you for your inquiry.
    How to enable SWO in Embedded Studio is explained here:

    Alternatively we suggest using SEGGER RTT. The benefit is that this works without using extra target pins like SWO and target device must not be halted like with Semihosting. Thus it stays portable and is independent of the IDE you are using:

    Best regards,

    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.