Undefined Reference Error and Other Questions
Posted: Sun Oct 28, 2012 7:36 pm
Hi, I just registered to ask a few questions about Chibios/GFX driver.
First of all I want to thank you guys for your great work on the LCD drivers.
I am a mechnical engineer and don't have much background in electronics. But I'm interested in MCU programming. Recently I purchased a STM32F4Discovery card and an LCD with touchpad off ebay. I was able to setup the toolchain in Unbuntu and compiled and ran a few simple programs on the STM32F4Discovery board. Among these simple programs there was one that used Chibios/GFX drivers and drew a few simple shapes on the LCD screen. The ebay description of the LCD panel (http://www.ebay.com/itm/170912654535) stated that it had an SSD1963 controller. However, I couldn't drive it using the SSD1963 driver. Instead I was able to drive it using the SSD1289 driver.
Yesterday I was trying the new Graph example from the GFX driver. When I tried to compile the program I got an error saying "undefined reference to gdisp_llc_control_ssd1289" as well as "undefined refernce to sin". My initial thoughts were I must have missed some header files but I have included "gidsp.h", "graph.h", "math.h" in my main.c. I found out that the first error ("undefined reference to gdisp_llc_control_ssd1289") was caused by function gdispSetOrientation() (I have also got this exact error when trying the notdpad example). The second error message is obviously caused by un-defined sine function. So I was wondering if anyone had seen this error before. Could this be caused by an incorrectly setup toolchain?
As a newbie, I also have a few other questions. Firstly I want to check with you guys if my hardware connection between the STM32F4Discovery and LCD is correct. I'm trying to use FSMC on the STM32F4Discovery board to control the LCD. I followed this post on element14.com (http://www.element14.com/community/groups/development-tools/blog/2012/05/26/stm32f4-discovery-hy32d-tft-lcd) to connect the data pins and control pins. I didn't connect the touchpad pins as I was not ready to try that yet. I used a 1k-ohm resistor between the LCD reset pin and the +3V MCU board pin. Also I used a 33ohm resistor between the LCD backlight pin and the +3V MCU board pin. I don't have resistors between the LCD +3.3V/LCD Ground pins and the MCU board +3V/Ground pins. Does this connection look OK to you guys?
Secondly, I noticed that every time I disconnect and reconnect the power to the STM32F4Discovery board, I have to wait for quite some time (~ 5min) and pressed the board reset button once for the graphics to show up on the LCD screen. Sometimes I have to power off and power on the STM32F4Discovery board a few times before anything shows up on the LCD screen. I'm confused why this happens. I don't think the board needs that long to initialize. So I was wondering if you guys could give me some comments/hints on how to troubleshoot the problem.
Lastly, could you recommend any good beginner books on MCU programming?
First of all I want to thank you guys for your great work on the LCD drivers.
I am a mechnical engineer and don't have much background in electronics. But I'm interested in MCU programming. Recently I purchased a STM32F4Discovery card and an LCD with touchpad off ebay. I was able to setup the toolchain in Unbuntu and compiled and ran a few simple programs on the STM32F4Discovery board. Among these simple programs there was one that used Chibios/GFX drivers and drew a few simple shapes on the LCD screen. The ebay description of the LCD panel (http://www.ebay.com/itm/170912654535) stated that it had an SSD1963 controller. However, I couldn't drive it using the SSD1963 driver. Instead I was able to drive it using the SSD1289 driver.
Yesterday I was trying the new Graph example from the GFX driver. When I tried to compile the program I got an error saying "undefined reference to gdisp_llc_control_ssd1289" as well as "undefined refernce to sin". My initial thoughts were I must have missed some header files but I have included "gidsp.h", "graph.h", "math.h" in my main.c. I found out that the first error ("undefined reference to gdisp_llc_control_ssd1289") was caused by function gdispSetOrientation() (I have also got this exact error when trying the notdpad example). The second error message is obviously caused by un-defined sine function. So I was wondering if anyone had seen this error before. Could this be caused by an incorrectly setup toolchain?
As a newbie, I also have a few other questions. Firstly I want to check with you guys if my hardware connection between the STM32F4Discovery and LCD is correct. I'm trying to use FSMC on the STM32F4Discovery board to control the LCD. I followed this post on element14.com (http://www.element14.com/community/groups/development-tools/blog/2012/05/26/stm32f4-discovery-hy32d-tft-lcd) to connect the data pins and control pins. I didn't connect the touchpad pins as I was not ready to try that yet. I used a 1k-ohm resistor between the LCD reset pin and the +3V MCU board pin. Also I used a 33ohm resistor between the LCD backlight pin and the +3V MCU board pin. I don't have resistors between the LCD +3.3V/LCD Ground pins and the MCU board +3V/Ground pins. Does this connection look OK to you guys?
Secondly, I noticed that every time I disconnect and reconnect the power to the STM32F4Discovery board, I have to wait for quite some time (~ 5min) and pressed the board reset button once for the graphics to show up on the LCD screen. Sometimes I have to power off and power on the STM32F4Discovery board a few times before anything shows up on the LCD screen. I'm confused why this happens. I don't think the board needs that long to initialize. So I was wondering if you guys could give me some comments/hints on how to troubleshoot the problem.
Lastly, could you recommend any good beginner books on MCU programming?