SysprogsProfiler and FreeRTOS Causes SIGTRAP using vsnprintf

Sysprogs forums Forums VisualGDB SysprogsProfiler and FreeRTOS Causes SIGTRAP using vsnprintf

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30206
    bjornharink
    Participant

    Perhaps this is something avoidable, but using a VisualGDB example to print to UART using SysProfiler and FreeRTOS causes a SIGTRAP when using the vsnprintf function. It stops inside the xEventGroupWaitBits  function at uxReturn = uxTaskResetEventItemValue();.

    Somehow I did not encounter this issue before. Anyone have a thought on this? Function used and called in start of a FreeRTOS task, it hangs on the vsnprintf:

    
    char * pmpGetValue(const char *cmd, ...)
    {
    char send_data[PMP_CMD_LEN];
    memset(send_data, 0x00, PMP_CMD_LEN);
    va_list args;
    va_start(args, cmd);
    int cx = vsnprintf(send_data, PMP_CMD_LEN, cmd, args);
    va_end(args);
    if (cx < 0 | cx > PMP_CMD_LEN)
    {
    addConsoleBuffer("Buffer overflow.");
    }
    pmpSend(send_data);
    char *data = pmpReceive();
    char *data_parse = pmpParse(data);
    return data_parse;
    }
    
    • This topic was modified 3 years, 7 months ago by bjornharink.
    #30208
    bjornharink
    Participant

    OKay. Apologies. This was an easy fix. The task stack was way too small to deal with a vsnprintf. Had it at 128 bytes and increased it to 512 bytes and resolved the issue.

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