Skip to main content
Ramazan Gülcan
Associate III
Feb 24, 2018 11:24 AM UTC
Solved

not generating syscalls.c

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.
    Ramazan Gülcan
    Ramazan GülcanBest answer
    Associate III
    Feb 24, 2018 10:07 PM UTC
    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
    Feb 24, 2018 2:00 PM UTC
    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
    Feb 24, 2018 3:13 PM UTC
    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
    Feb 24, 2018 10:07 PM UTC
    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
    Feb 25, 2018 10:44 PM UTC
    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
    Feb 26, 2018 12:28 AM UTC
    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
    Feb 26, 2018 3:12 AM UTC
    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