AnsweredAssumed Answered

How do I add an LCD to my STM32L476 Discovery Project in STM32CubMX?

Question asked by J B on Nov 18, 2015
Hello!  I have a project just running the basics using my STM32L476 discovery board (buttons, LED, debouncing code, etc) but I wanted to add LCD support (which is clearly supported in the default firmware project).  I added the lines:


I'm getting a warning about C99, which basically means it needs to be declared before it can be used, which is likely caused by the fact I don't have the LCD added to my project by default (despite the fact I loaded the discovery board profile directly into CubeMx, which I would assume would have the LCD configured by default).  I went to add the LCD to the CubeMX project but a number of segments are disabled.  However, when I open the discovery profile, there are a number of pins defined as "SEG15", "Seg17",etc so it's clearly setup somehow (maybe not via the LCD option at the left of the program).  

I can create my own driver but, from what I can see, it appears to already exist because it's implemented by the demo program.  Are there files I need to manually add to my program (stm32l476g_discovery_glass_lcd.c, stm32l4xx_hal_lcd.h, etc) or is there a way to add the LCD to my project using CubeMx?  

Let me know when you get the chance.  Thanks!