You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Louie Lu <me...@louie.lu> on 2017/03/16 08:12:25 UTC

Adding LCD drivers to STM32F429 cause linked error

Hi everyone,

I'm now trying to add LCD driver for STM32F429, but get a linked error that
I can't resolve.

The apps/lcdtest/src/main.c include the lcd driver header, and then used
the defined function "hal_lcd_init":

    #include "stm32f429_lcd/stm32f429_lcd.h"
    int main() {
        sysinit();
        hal_lcd_init();
        ...
     }

But when try to build and at the linking stage, it got the error message:

Linking  bin/targets/lcdtest/app/apps/lcdtest/lcdtest.elf
Error:
bin/targets/lcdtest/app/hw/drivers/lcd/stm32f429_lcd/hw_drivers_lcd_stm32f429_lcd.a(stm32f429_lcd.o):
In function `hal_lcd_init':
repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:56:
undefined reference to `HAL_LTDC_Init'
repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:73:
undefined reference to `HAL_LTDC_ConfigLayer'
collect2: error: ld returned 1 exit status


I have already checked the include in gcc by `newt build lcdtest -v
-ldebug`, and the path of the file is included.

Why will the linker still throw a error and tell me there isn't
HAL_LTDC_init, and why will nm result tells the HAL_LTDC_Init and
ConfigLayer is "U", not found?

The git of the lcd code is here:
https://github.com/grapherd/incubator-mynewt-core/tree/stm32f429_lcd_test

code is inside:
 - apps/lcdtest
 - hw/drivers/lcd/stm32f429_lcd


Thanks,
Louie.

Re: Adding LCD drivers to STM32F429 cause linked error

Posted by Louie Lu <me...@louie.lu>.
* stm32f4xx_hal_conf.h

2017-03-16 18:14 GMT+08:00 Louie Lu <me...@louie.lu>:

> Da, I forgot to enable module at `stm32f4_bsp.h`
>
> it work now.
>
> Louie.
>
> 2017-03-16 16:12 GMT+08:00 Louie Lu <me...@louie.lu>:
>
>> Hi everyone,
>>
>> I'm now trying to add LCD driver for STM32F429, but get a linked error
>> that I can't resolve.
>>
>> The apps/lcdtest/src/main.c include the lcd driver header, and then used
>> the defined function "hal_lcd_init":
>>
>>     #include "stm32f429_lcd/stm32f429_lcd.h"
>>     int main() {
>>         sysinit();
>>         hal_lcd_init();
>>         ...
>>      }
>>
>> But when try to build and at the linking stage, it got the error message:
>>
>> Linking  bin/targets/lcdtest/app/apps/lcdtest/lcdtest.elf
>> Error: bin/targets/lcdtest/app/hw/drivers/lcd/stm32f429_lcd/hw_driv
>> ers_lcd_stm32f429_lcd.a(stm32f429_lcd.o): In function `hal_lcd_init':
>> repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:56:
>> undefined reference to `HAL_LTDC_Init'
>> repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:73:
>> undefined reference to `HAL_LTDC_ConfigLayer'
>> collect2: error: ld returned 1 exit status
>>
>>
>> I have already checked the include in gcc by `newt build lcdtest -v
>> -ldebug`, and the path of the file is included.
>>
>> Why will the linker still throw a error and tell me there isn't
>> HAL_LTDC_init, and why will nm result tells the HAL_LTDC_Init and
>> ConfigLayer is "U", not found?
>>
>> The git of the lcd code is here:
>> https://github.com/grapherd/incubator-mynewt-core/tree/stm32f429_lcd_test
>>
>> code is inside:
>>  - apps/lcdtest
>>  - hw/drivers/lcd/stm32f429_lcd
>>
>>
>> Thanks,
>> Louie.
>>
>>
>>
>

Re: Adding LCD drivers to STM32F429 cause linked error

Posted by Louie Lu <me...@louie.lu>.
Da, I forgot to enable module at `stm32f4_bsp.h`

it work now.

Louie.

2017-03-16 16:12 GMT+08:00 Louie Lu <me...@louie.lu>:

> Hi everyone,
>
> I'm now trying to add LCD driver for STM32F429, but get a linked error
> that I can't resolve.
>
> The apps/lcdtest/src/main.c include the lcd driver header, and then used
> the defined function "hal_lcd_init":
>
>     #include "stm32f429_lcd/stm32f429_lcd.h"
>     int main() {
>         sysinit();
>         hal_lcd_init();
>         ...
>      }
>
> But when try to build and at the linking stage, it got the error message:
>
> Linking  bin/targets/lcdtest/app/apps/lcdtest/lcdtest.elf
> Error: bin/targets/lcdtest/app/hw/drivers/lcd/stm32f429_lcd/hw_
> drivers_lcd_stm32f429_lcd.a(stm32f429_lcd.o): In function `hal_lcd_init':
> repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:56:
> undefined reference to `HAL_LTDC_Init'
> repos/apache-mynewt-core/hw/drivers/lcd/stm32f429_lcd/src/stm32f429_lcd.c:73:
> undefined reference to `HAL_LTDC_ConfigLayer'
> collect2: error: ld returned 1 exit status
>
>
> I have already checked the include in gcc by `newt build lcdtest -v
> -ldebug`, and the path of the file is included.
>
> Why will the linker still throw a error and tell me there isn't
> HAL_LTDC_init, and why will nm result tells the HAL_LTDC_Init and
> ConfigLayer is "U", not found?
>
> The git of the lcd code is here:
> https://github.com/grapherd/incubator-mynewt-core/tree/stm32f429_lcd_test
>
> code is inside:
>  - apps/lcdtest
>  - hw/drivers/lcd/stm32f429_lcd
>
>
> Thanks,
> Louie.
>
>
>