Sysprogs forums › Forums › VisualGDB › DISCO-F7 Example: Printf to LCD ? _write()?
Tagged: LCD_LOG_PURCHAR _write F7 DISCO
- This topic has 7 replies, 2 voices, and was last updated 6 years, 9 months ago by
support.
-
AuthorPosts
-
January 13, 2019 at 23:04 #23411
jona
SpectatorIn 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!
January 13, 2019 at 23:37 #23412support
KeymasterHi,
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.
January 13, 2019 at 23:45 #23413jona
Spectatorthanks!
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.
January 13, 2019 at 23:47 #23414support
KeymasterThanks 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?
January 13, 2019 at 23:51 #23417jona
SpectatorNew Project -> Embedded Project Wizard -> New Embedded Project ->Sample Selection…..
January 14, 2019 at 00:08 #23418support
KeymasterThanks, 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.
January 14, 2019 at 21:24 #23446jona
SpectatorI 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.
January 14, 2019 at 22:00 #23452support
KeymasterNo 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).
-
AuthorPosts
- You must be logged in to reply to this topic.