Freedom Studio Qemu printf and step issue

  1. printf: with multiple call some printf do not print to console.
    by example printf("%ld item is %ld \n", i, x); from o to 100
    print some of the first 50 and skip all other

setbuf(stdout, NULL);
after each printf does nothing.

  1. stepping is assembly (one instruction at time, Qemu) work correctly most of the time.
    But it happen that “step” command (F6) do not stop after the instruction (instruction is not branch or jump).
    In loop stop happen anywhere in loop code (after or before).
    Instructions after the stepped instruction are executed correctly but “step” do not stop after the stepped instruction.

Hi Alain,

I’m not seeing this behavior running the latest qemu package I have (which is not released yet) using an example for loop as you mentioned. What qemu version and which bsp are you using?


Hi Alain, I was able to replicate the problem in the u54 bsp/machine. I’ll report back when I know more.

Qemu: 5.10.2020-8-1 (from → Freedom Studio → macOS

Hi Alain, It turns out that the problem you are seeing is unrelated to the one I found. We haven’t been able to reproduce your issue yet. We see full and reliable console output using that version of QEMU. Can you specify which BSP you are using, fro instance from this list?



BSP: qemu-sifive–s51

In Preferences the “Console buffer lines” was very low. I increase it by factor 20

I also increase “Console buffer size” and stack size so now everything work fine.

Thank you for your help.

About step issue: don’t use editor to debug.
Open a “Disassembly” window and click the “Link with Active Debug Context”.
Debug only with this window. Set breakpoint, watchpoint and step only there.
Within the “Disassembly” window step work correctly.