完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
移植步骤: 1、将裸板的LCD程序复制到新建的文件中,与main工程一起,并lcd.c、lcd.h,然后编译通过。 2、然后cubemx生成的文件。
将cubemx生成的文件中的Drivers\STM32F1xx_HAL_Driver\Src文件中的stm32f1xx_ll_fsmc.c文件和stm32f1xx_hal_sram.c复制文件到rtt生成的libraries\STM32F1xx_HAL_Driver\Src文件夹中,并加入编译。 3、在mian.c下面添加代码 static int lcd_display(void) {
} MSH_CMD_EXPORT(lcd_display, lcd_display samole); 以上是我的移植过程,最后编译报错: ../applications/main.c: In function 'MX_FSMC_Init': ../applications/main.c:27:3: error: unknown type name 'FSMC_NORSRAM_TimingTypeDef' FSMC_NORSRAM_TimingTypeDef Timing = {0}; ^ ../applications/main.c:35:3: error: 'hsram4' undeclared (first use in this function) hsram4.Instance = FSMC_NORSRAM_DEVICE; ^ ../applications/main.c:35:3: note: each undeclared identifier is reported only once for each function it appears in ../applications/main.c:35:21: error: 'FSMC_NORSRAM_DEVICE' undeclared (first use in this function) hsram4.Instance = FSMC_NORSRAM_DEVICE;
../applications/main.c:36:21: error: 'FSMC_NORSRAM_EXTENDED_DEVICE' undeclared (first use in this function) hsram4.Extended = FSMC_NORSRAM_EXTENDED_DEVICE;
../applications/main.c:38:24: error: 'FSMC_NORSRAM_BANK4' undeclared (first use in this function) hsram4.Init.NSBank = FSMC_NORSRAM_BANK4;
../applications/main.c:39:32: error: 'FSMC_DATA_ADDRESS_MUX_DISABLE' undeclared (first use in this function) hsram4.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
../applications/main.c:40:28: error: 'FSMC_MEMORY_TYPE_SRAM' undeclared (first use in this function) hsram4.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
../applications/main.c:41:33: error: 'FSMC_NORSRAM_MEM_BUS_WIDTH_16' undeclared (first use in this function) hsram4.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_16;
../applications/main.c:42:33: error: 'FSMC_BURST_ACCESS_MODE_DISABLE' undeclared (first use in this function) hsram4.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
../applications/main.c:43:36: error: 'FSMC_WAIT_SIGNAL_POLARITY_LOW' undeclared (first use in this function) hsram4.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
../applications/main.c:44:26: error: 'FSMC_WRAP_MODE_DISABLE' undeclared (first use in this function) hsram4.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
../applications/main.c:45:34: error: 'FSMC_WAIT_TIMING_BEFORE_WS' undeclared (first use in this function) hsram4.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
../applications/main.c:46:32: error: 'FSMC_WRITE_OPERATION_ENABLE' undeclared (first use in this function) hsram4.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
../applications/main.c:47:28: error: 'FSMC_WAIT_SIGNAL_DISABLE' undeclared (first use in this function) hsram4.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
../applications/main.c:48:30: error: 'FSMC_EXTENDED_MODE_DISABLE' undeclared (first use in this function) hsram4.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
../applications/main.c:49:34: error: 'FSMC_ASYNCHRONOUS_WAIT_DISABLE' undeclared (first use in this function) hsram4.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
../applications/main.c:50:28: error: 'FSMC_WRITE_BURST_DISABLE' undeclared (first use in this function) hsram4.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
../applications/main.c:52:9: error: request for member 'AddressSetupTime' in something not a structure or union Timing.AddressSetupTime = 15;
../applications/main.c:53:9: error: request for member 'AddressHoldTime' in something not a structure or union Timing.AddressHoldTime = 15;
../applications/main.c:54:9: error: request for member 'DataSetupTime' in something not a structure or union Timing.DataSetupTime = 255;
../applications/main.c:55:9: error: request for member 'BusTurnAroundDuration' in something not a structure or union Timing.BusTurnAroundDuration = 15;
../applications/main.c:56:9: error: request for member 'CLKDivision' in something not a structure or union Timing.CLKDivision = 16;
../applications/main.c:57:9: error: request for member 'DataLatency' in something not a structure or union Timing.DataLatency = 17;
../applications/main.c:58:9: error: request for member 'AccessMode' in something not a structure or union Timing.AccessMode = FSMC_ACCESS_MODE_A;
../applications/main.c:58:23: error: 'FSMC_ACCESS_MODE_A' undeclared (first use in this function) Timing.AccessMode = FSMC_ACCESS_MODE_A;
../applications/main.c:61:7: warning: implicit declaration of function 'HAL_SRAM_Init' [-Wimplicit-function-declaration] if (HAL_SRAM_Init(&hsram4, &Timing, NULL) != HAL_OK)
../applications/main.c:61:48: error: 'HAL_OK' undeclared (first use in this function) if (HAL_SRAM_Init(&hsram4, &Timing, NULL) != HAL_OK)
../applications/main.c:63:5: warning: implicit declaration of function 'Error_Handler' [-Wimplicit-function-declaration]
../applications/main.c: In function 'lcd_display': ../applications/main.c:80:5: warning: implicit declaration of function 'LCD_Init' [-Wimplicit-function-declaration]
../applications/main.c:81:5: error: 'POINT_COLOR' undeclared (first use in this function)
../applications/main.c:81:17: error: 'RED' undeclared (first use in this function)
../applications/main.c:82:5: warning: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
../applications/main.c:82:5: warning: incompatible implicit declaration of built-in function 'sprintf' ../applications/main.c:82:5: note: include '<stdio.h>' or provide a declaration of 'sprintf' ../applications/main.c:82:41: error: 'lcddev' undeclared (first use in this function)
../applications/main.c:87:20: warning: implicit declaration of function 'LCD_Clear' [-Wimplicit-function-declaration]
../applications/main.c:87:30: error: 'WHITE' undeclared (first use in this function)
../applications/main.c:88:30: error: 'BLACK' undeclared (first use in this function)
../applications/main.c:89:30: error: 'BLUE' undeclared (first use in this function)
../applications/main.c:91:30: error: 'MAGENTA' undeclared (first use in this function)
../applications/main.c:92:30: error: 'GREEN' undeclared (first use in this function)
../applications/main.c:93:30: error: 'CYAN' undeclared (first use in this function)
../applications/main.c:94:30: error: 'YELLOW' undeclared (first use in this function)
../applications/main.c:95:30: error: 'BRRED' undeclared (first use in this function)
../applications/main.c:96:30: error: 'GRAY' undeclared (first use in this function)
../applications/main.c:97:31: error: 'LGRAY' undeclared (first use in this function)
../applications/main.c:98:31: error: 'BROWN' undeclared (first use in this function)
../applications/main.c:101:9: warning: implicit declaration of function 'LCD_ShowString' [-Wimplicit-function-declaration]
../applications/main.c:108:9: warning: implicit declaration of function 'rt_pin_write' [-Wimplicit-function-declaration]
../applications/main.c:108:22: error: 'LED0_PIN' undeclared (first use in this function)
../applications/main.c:108:32: error: 'PIN_HIGH' undeclared (first use in this function)
../applications/main.c:110:32: error: 'PIN_LOW' undeclared (first use in this function)
../applications/main.c:113:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ ../applications/main.c: At top level: ../applications/main.c:20:13: warning: 'MX_FSMC_Init' defined but not used [-Wunused-function] static void MX_FSMC_Init(void)
make: *** [applications/subdir.mk:21: applications/main.o] Error 1 make: *** Waiting for unfinished jobs.... "make -j12 all" terminated with exit code 2. Build might be incomplete. 是什么地方有问题?希望大佬给看一下。 |
|
相关推荐
3个回答
|
|
未定义是一些类型,说明有头文件没有添加,main.c 尝试包含 rtdevice.h
|
|
|
|
头文件后,编译报错是这样的,请问这种情况是怎么添加的? |
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
819 浏览 0 评论
5690 浏览 0 评论
如何使用python调起UDE STK5.2进行下载自动化下载呢?
2738 浏览 0 评论
开启全新AI时代 智能嵌入式系统快速发展——“第六届国产嵌入式操作系统技术与产业发展论坛”圆满结束
3077 浏览 0 评论
获奖公布!2024 RT-Thread全球巡回线下培训火热来袭!报名提问有奖!
32814 浏览 11 评论
73395 浏览 21 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 07:59 , Processed in 0.801636 second(s), Total 78, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号