Skip to main content
Ramazan Gülcan
Associate III
February 24, 2018
Solved

not generating syscalls.c

  • February 24, 2018
  • 6 replies
  • 1975 views
Posted on February 24, 2018 at 12:24

Hi,

Why is CubeMX not generating the syscall.c file?

Regards

Ramazan

#syscalls.c
    This topic has been closed for replies.
    Best answer by Ramazan Gülcan
    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

    6 replies

    Andrew Neil
    Super User
    February 24, 2018
    Posted on February 24, 2018 at 15:00

    perhaps your code doesn't need it?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ramazan Gülcan
    Associate III
    February 24, 2018
    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
    Ramazan GülcanAuthorBest answer
    Associate III
    February 24, 2018
    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
    February 25, 2018
    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

    Tesla DeLorean
    Guru
    February 26, 2018
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Roberto Roman
    Associate
    February 26, 2018
    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