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:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
char*pmpGetValue(constchar*cmd,...)
{
charsend_data[PMP_CMD_LEN];
memset(send_data,0x00,PMP_CMD_LEN);
va_list args;
va_start(args,cmd);
intcx=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);
returndata_parse;
}
This topic was modified 2 years ago by bjornharink.
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.