I am building a project and I have the board stm nucleo_l496zg. All i want to do is to use the drivers from the board in order to communicate the board after west flash with minicom, it is a simple string transfer and response program. I am building this project with zephyr and my issue is that I cant use the functions tty_init , tty_read and tty_set_rx_buf despite that I use the proper include " #include <console/tty.h> "
. The compiler returns an undefined reference to thoose three functions but in my program I am using another one function from tty.h header which is tty_set_timeout but at this function it doesnt say nothing. Though I notiched in that in here(documentation of tty.h) tty_Set_timeout is the only function that has something inside. I cant understand why I am getting that please if someone can help me let me know !
Asked
Active
Viewed 431 times
0

gregni
- 417
- 3
- 12
-
Have your tried building the console sample? It is the minimum exmaple you're asking for I thing ;) https://docs.zephyrproject.org/latest/samples/subsys/console/getline/README.html – Paul Würtz May 18 '21 at 10:51
-
@PaulWürtz yes i tied that but the specific orders I have got is to use tty ( drivers ) , do you know why is this happening ? – gregni May 18 '21 at 11:56
-
Have you enabled the correct peripherals/pinmuxing in your KConfig and device tree overlay? Which uart do you want to use? I have not used the tty myself, but I am sure you have to enable it in your KConfig file ^^ – Paul Würtz May 18 '21 at 14:06
-
@PaulWürtz hmm in Kconfig only I am using some definitions for the arrays , can you show me an example of how to enable it ? am using usart2 from the board – gregni May 18 '21 at 14:53
1 Answers
1
I had the same problem and I solve it by adding those lines to my .conf file:
CONFIG_SERIAL=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y
And don't forget to mention the file (.conf file) also in your CMakeList.txt file:
set(CONF_FILE ***.conf)
Hope that it will work with you as well

chaymae kiki
- 36
- 1
- 4