ST意法半导体
直播中

段宜敏

8年用户 236经验值
私信 关注
[问答]

在Keil中构建spin3202 6步固件包出现错误

你好,
我正在尝试构建spin3202 6步固件包
出于某种原因
STSW-SPIN3202固件包缺少UM2310第2.5.2节中提到的预编译二进制文件

如果我然后按照部分的指示尝试编译Keil项目
2.5.3.2
UM2310我在尝试构建二进制文件时得到以下错误代码(Keil的全新安装,并且没有对代码进行任何更改,说明后面的内容完全正确)


************************************************** ************************************************** ************************************************** **************************************

***使用编译器'V5.06更新5(版本528)',文件夹:'C: Keil_v5  ARM  ARMCC  Bin'
重建项目'Project_Uart' - 目标'STSPIN32F0A'
编译stspin32f0.c ...
编译STM32f0xx_hal.c ...
编译STEVAL-SPIN3202.c ......
编译stm32f0xx_hal_adc_ex.c ...
编译stm32f0xx_hal_adc.c ...
编译stm32f0xx_hal_cortex.c ...
编译stm32f0xx_hal_dma.c ...
编译stm32f0xx_hal_flash.c ...
编译stm32f0xx_hal_flash_ex.c ...
编译stm32f0xx_hal_gpio.c ...
编译stm32f0xx_hal_rcc.c ...
编译stm32f0xx_hal_rcc_ex.c ...
编译stm32f0xx_hal_tim_ex.c ...
编译stm32f0xx_hal_uart.c ...
编译stm32f0xx_hal_tim.c ...
编译stm32f0xx_hal_uart_ex.c ...
编译stm32f0xx_hal_usart.c ...
编译UART_UI.c ...
编译6Step_Lib.c ...
编译main_32F0.c ...
组装startup_stm32f031.s ...
编译stspin32f0_hal_msp.c ...
编译system_stm32f0xx.c ...
错误:& sharp20:标识符'RCC_CFGR_PLLMULL'未定义
pllmull =
CC-> CFGR& RCC_CFGR_PLLMULL;
错误:& sharp20:标识符'RCC_CFGR2_PREDIV1'未定义
prediv1factor =(
CC-> CFGR2& RCC_CFGR2_PREDIV1)+ 1;
错误:& sharp20:标识符'RCC_CFGR_PLLMULL'未定义

CC-> CFGR& =(uint32_t)((uint32_t)〜(
CC_CFGR_PLLSRC |
CC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
错误:& sharp20:标识符'RCC_CFGR_PLLSRC_PREDIV1'未定义

CC-> CFGR | =(uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
错误:& sharp20:标识符'RCC_CFGR_PLLXTPRE_PREDIV1'未定义

CC-> CFGR | =(uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
错误:& sharp20:标识符'RCC_CFGR_PLLMULL6'未定义

CC-> CFGR | =(uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
RTE  Device  STM32F031C6  system_stm32f0xx.c:0警告,6错误
编译stspin32f0_it.c ...
'。 Objects  Project_Uart.axf' - 6个错误,0个警告。
目标未创建。
建造时间经过:00:00:06
有没有人遇到解决这个问题/找到解决方案?
提前致谢!

#stspin32f0a

以上来自于谷歌翻译


以下为原文





Hello,

Im trying to build the spin3202 6 step firmware package

For some reason the  
STSW-SPIN3202 firmware package is missing the pre compiled binaries mentioned in UM2310 section 2.5.2

if I then try to compile Keil project as directed in section
2.5.3.2 of
UM2310 I get the following error codes when trying to build the binary (fresh install of Keil and no changes made to the code, instructions followed exactly)



********************************************************************************************************************************************************************************************



*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:Keil_v5ARMARMCCBin'
Rebuild Project 'Project_Uart' - Target 'STSPIN32F0A'
compiling stspin32f0.c...
compiling stm32f0xx_hal.c...
compiling STEVAL-SPIN3202.c...
compiling stm32f0xx_hal_adc_ex.c...
compiling stm32f0xx_hal_adc.c...
compiling stm32f0xx_hal_cortex.c...
compiling stm32f0xx_hal_dma.c...
compiling stm32f0xx_hal_flash.c...
compiling stm32f0xx_hal_flash_ex.c...
compiling stm32f0xx_hal_gpio.c...
compiling stm32f0xx_hal_rcc.c...
compiling stm32f0xx_hal_rcc_ex.c...
compiling stm32f0xx_hal_tim_ex.c...
compiling stm32f0xx_hal_uart.c...
compiling stm32f0xx_hal_tim.c...
compiling stm32f0xx_hal_uart_ex.c...
compiling stm32f0xx_hal_usart.c...
compiling UART_UI.c...
compiling 6Step_Lib.c...
compiling main_32F0.c...
assembling startup_stm32f031.s...
compiling stspin32f0_hal_msp.c...
compiling system_stm32f0xx.c...
error:  &sharp20: identifier 'RCC_CFGR_PLLMULL' is undefined
        pllmull =
CC->CFGR & RCC_CFGR_PLLMULL;
error:  &sharp20: identifier 'RCC_CFGR2_PREDIV1' is undefined
          prediv1factor = (
CC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
error:  &sharp20: identifier 'RCC_CFGR_PLLMULL' is undefined
      
CC->CFGR &= (uint32_t)((uint32_t)~(
CC_CFGR_PLLSRC |
CC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
error:  &sharp20: identifier 'RCC_CFGR_PLLSRC_PREDIV1' is undefined
      
CC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
error:  &sharp20: identifier 'RCC_CFGR_PLLXTPRE_PREDIV1' is undefined
      
CC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
error:  &sharp20: identifier 'RCC_CFGR_PLLMULL6' is undefined
      
CC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
RTEDeviceSTM32F031C6system_stm32f0xx.c: 0 warnings, 6 errors
compiling stspin32f0_it.c...
'.ObjectsProject_Uart.axf' - 6 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:06
Has anyone come across a solution this problem / found a solution?
Thanks in advance!

#stspin32f0a

回帖(1)

朱红艳

2018-12-3 09:59:15
我想我解决了这个问题。我在system_stm32f0xx.c中更改了:
1)pllmull = CC-> CFGR& RCC_CFGR_PLLMULL;
pllmull =
CC-> CFGR& RCC_CFGR_PLLMUL;
2)prediv1factor =(CC-> CFGR2& RCC_CFGR2_PREDIV1)+ 1; prediv1factor =(RCC-> CFGR2& RCC_CFGR2_PREDIV_1)+ 1;
3)prediv1factor =(CC-> CFGR2& RCC_CFGR2_PREDIV1)+ 1; RCC-> CFGR& =(uint32_t)((uint32_t)〜(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL));
4)CC-> CFGR& =(uint32_t)((uint32_t)〜(CC_CFGR_PLLSRC | CC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL)); RCC-> CFGR | =(uint32_t)(RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV1 | RCC_CFGR_PLLMUL6);
但现在我遇到UART通信问题。我在重置uC后得到有关串口终端可能命令的信息,但是当我发送命令时,例如HELP,uC没有反应。
如果我有一个预编译的文件,我可以检查硬件是否一切正常。

以上来自于谷歌翻译


以下为原文




I think that I solve this problem. I changed in system_stm32f0xx.c:
1) pllmull = CC->CFGR & RCC_CFGR_PLLMULL;  
pllmull =
CC->CFGR & RCC_CFGR_PLLMUL;
2) prediv1factor = (CC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;  prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV_1) + 1;
3) prediv1factor = (CC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;  RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMUL));
4) CC->CFGR &= (uint32_t)((uint32_t)~(CC_CFGR_PLLSRC | CC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));  RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV1 | RCC_CFGR_PLLMUL6);
But now I have problem with UART communication. I get information about possible command in terminal of serial port after reset uC, but when I send command, for example HELP, uC doesn't react.
If I had a pre compiled file, I could check that with hardware is everything ok.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分