DISCO-F7 Example: Printf to LCD ? _write()?

Sysprogs forums Forums VisualGDB DISCO-F7 Example: Printf to LCD ? _write()?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23411
    jona
    Spectator

    In a prior example I was working with, “Audio Record and Playback” I had to manually import a file names “syscalls.c” in order for the example to be able to printf to the discover board’s LCD. I am trying other examples that are similar, but when I import the sample code the LCD is not written to because the file syscalls.c or one of the functions in it is missing. So LCD_LOG_PUTCHAR is not defined and doesn’t point to anything.

    in lcd_log_config.h:

    #define LCD_LOG_PUTCHAR int __io_putchar(int ch)

    Which file should be in the project and is the proper file to use here, instead of dragging syscalls.c in from an older example project?

    I am not sure how that part works!

     

    #23412
    support
    Keymaster

    Hi,

    The examples like “Audio Record and Playback” come directly from ST, so we are usually not able to provide much insights into them (you might be able to get some hints from ST via their support forums) . That said, if it looks like VisualGDB is not automatically importing a file that is a part of the example, please let us know the exact example name and the device name and we will double-check this.

    #23413
    jona
    Spectator

    thanks!

    Every example that attempts to write to the LCD via LCD_LOG_PUTCHAR  ( int __io_putchar(int ch)) needs syscalls.c (I am using the one from the STM32Cube_FW sources) syscalls.c is a ” System Workbench Minimal System calls file”

    Perhaps someone here knows which file these examples should be using.

     

    #23414
    support
    Keymaster

    Thanks for the clarification. How do you import those examples into VisualGDB? Are you using the New Project -> Samples -> Use STM32CubeMX Examples setting, or a different mechanism?

    #23417
    jona
    Spectator

    New Project -> Embedded Project Wizard -> New Embedded Project ->Sample Selection…..

    #23418
    support
    Keymaster

    Thanks, we have rechecked this and indeed it looks like our sample project wrappers don’t include this file. We will run a few internal tests with this and will try to automatically include this file in the next releases of our STM32 package.

    #23446
    jona
    Spectator

    I am not sure that file contains the proper _sbrk() routine though. This is something I am trying to understand as I go through these examples and was the root of one of my questions earlier.

    #23452
    support
    Keymaster

    No problem. _sbrk() is usually implemented by the standard library (you can select the syscall implementation type on the first page of VisualGDB Project Properties). If you want to fine-tune the location of the heap, you can add your own implementation of this function (see this tutorial).

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.