printf crashes after reset when built/flashed with fast semihosting enabled

Sysprogs forums Forums VisualGDB printf crashes after reset when built/flashed with fast semihosting enabled

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11129
    borbmizzet
    Participant

    I’ve noticed that when I build with fast semihosting enabled, using –specs=rdimon.specs and –specs=nosys.specs, after I reset either via hard powercycle or the “Reset Device” button in the GDB Session window, calls to printf essentially crash the program in FastSemihosting.cpp::WriteRawFastSemihostingData(line 65) as it goes into an infintite loop:
    while ((s_FastSemihostingState.WriteOffset – s_FastSemihostingState.ReadOffset) > (FAST_SEMIHOSTING_BUFFER_SIZE – minRequiredSize))
    {
    #if FAST_SEMIHOSTING_BLOCKING_MODE
    continue;
    #else
    return 0;
    #endif
    }

    s_FastSemihostingState.WriteOffset is 0, and s_FastSemihostingState.ReadOffset is some big number.

    #11130
    borbmizzet
    Participant

    I just switched the semihosting settings to discard further data when the buffer is full. So that probably fixed it. Still something to think about though.

    #11134
    support
    Keymaster

    Hi,

    Thanks, we will investigate and fix it in the upcoming v5.3.

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