cancel
Showing results for 
Search instead for 
Did you mean: 

not generating syscalls.c

Ramazan Gülcan
Associate III
Posted on February 24, 2018 at 12:24

Hi,

Why is CubeMX not generating the syscall.c file?

Regards

Ramazan

#syscalls.c
1 ACCEPTED SOLUTION

Accepted Solutions
Ramazan Gülcan
Associate III
Posted on February 24, 2018 at 23:07

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

View solution in original post

6 REPLIES 6
Andrew Neil
Evangelist
Posted on February 24, 2018 at 15:00

perhaps your code doesn't need it?

Posted on February 24, 2018 at 15:13

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.

Ramazan Gülcan
Associate III
Posted on February 24, 2018 at 23:07

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

Roberto Roman
Associate II
Posted on February 25, 2018 at 23:44

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

https://mcuoneclipse.files.wordpress.com/2015/11/disable-builtin-function-optimization.png?w=584&h=581

Posted on February 26, 2018 at 00:28

>>

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Roberto Roman
Associate II
Posted on February 26, 2018 at 04:12

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