2018-02-24 03:24 AM
Hi,
Why is CubeMX not generating the syscall.c file?
Regards
Ramazan
#syscalls.cSolved! Go to Solution.
2018-02-24 02:07 PM
I found the solution. can be created on atollic.
I give a link to the doc that helps in this matter.
https://www.youtube.com/watch?v=qSzme7qcBb0
https://www.youtube.com/watch?v=qSzme7qcBb0
Regards
Ramazan
2018-02-24 06:00 AM
perhaps your code doesn't need it?
2018-02-24 07:13 AM
I need. With the Usart module I want to run functions like printf, scanf. so the _read and _write functions in syscalls.c are required.
2018-02-24 02:07 PM
I found the solution. can be created on atollic.
I give a link to the doc that helps in this matter.
https://www.youtube.com/watch?v=qSzme7qcBb0
https://www.youtube.com/watch?v=qSzme7qcBb0
Regards
Ramazan
2018-02-25 02:44 PM
Hello Ramazan
I'm using the next implementation for printf, is really helpful if you want a printf multi-tasking
static char Buffer[1024];
int printf(const char *format, ...)
{ unsigned int Counter = 0;if(format != NULL)
{/*you can add a mutex for multitasking purposes*/
va_list args; va_start(args,format);Counter = vsprintf(Buffer,format,args);
HAL_UART_Transmit(&huart3, (uint8_t *)Buffer, (uint16_t) Counter, 100);
va_end(args);
} return Counter; }in addition you need to disable the follow option to avoid that the linker tries to use the default printf function
-fno-builtin
2018-02-25 04:28 PM
>>
I'm using the next implementation for printf, is really helpful if you want a printf multi-tasking
Doesn't look to be remotely thread safe, and it blocks. Might be better to use a local/auto buffer and then enqueue.
2018-02-25 07:12 PM
Yes, I'm agree with you. My last post not included the complete implementation, If you wan the complete implementation please sendme a inbox.
The copmlete implementation send a message at a queue of the task in charge of sent via uart in order to avoid delays in the task that wants print a string