Home › Forums › Mastering STM32 book support forum › STM32F429I-DISC1 Discovery Board Project Build
- This topic has 6 replies, 2 voices, and was last updated 8 years, 7 months ago by Carmine Noviello.
-
AuthorPosts
-
May 3, 2016 at 5:43 pm #2677LLHParticipant
Carmine,
Using release 0.10 of “The Book” to setup a toolchain on Windows 7, I would like to build a project for the STM32F429I-DISC1 Discovery Board. Following the procedure starting at section 3.2 was used to create hello_STM32F429 project. This hello_STM32F429 project builds with not errors.
Then, following the procedure starting at section 4.2.2 an Eclipse project was created which will host the files generated by CubeMX. I used the Figure 3: CubeMX board selection tool to select the STM32F429I-DISC1 board. I plan on buying this board after resolving issues listed in this posting. The build process generated 9 errors. After reviewing the steps beginning at section 4.2.2, the only info that was different from procedure listed in subsequent steps are listed below.
a. The macro corresponding to the Figure 17: Eclipse project settings and MCU macro definition included OS_USE_SEMIHOSTING,
b. The STMF429 MCU macro (STM32F429xx) was located in stm32f4xx.h file located at C:\Users\larryh\STM32Cube\Repository\STM32Cube_FW_F4_V1.11.0
\Drivers\CMSIS\Device\ST\STM32F4xx\Include subdirectory.Errors listed on Problems tab are listed below.
Description Resource Path Location Type
make: *** [system/src/stm32f4xx/stm32f4xx_hal_adc.o] Error 1 stm32Disc1_f429I C/C++ Problem
recipe for target ‘system/src/stm32f4xx/stm32f4xx_hal_adc.o’ failed subdir.mk /stm32Disc1_f429I/Debug/system/src/stm32f4xx line 210 C/C++ Problem
unknown type name ‘DMA_Stream_TypeDef’ stm32f4xx_hal_dma.h /stm32Disc1_f429I/system/include/stm32f4xx line 150 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 243 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 244 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 253 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 254 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 255 C/C++ Problem
unknown type name ‘GPIO_TypeDef’ stm32f4xx_hal_gpio.h /stm32Disc1_f429I/system/include/stm32f4xx line 256 C/C++ ProblemI cannot include file contents of first error since it is a make error against an object file type.
File contents of Line Number of second error is:
/stm32Disc1_f429I/Debug/system/src/stm32f4xx/subdir.mk file
# Each subdirectory must supply rules for building sources it contributes
system/src/stm32f4xx/%.o: ../system/src/stm32f4xx/%.c
@echo ‘Building file: $<‘ // line 210File contents of Line Numbers with errors in C:\STM32Toolchain\projects\stm32Disc1_f429I\system\include\stm32f4xx subdirectory files are listed below:
stm32f4xx_hal_dma.h
Line 150: DMA_Stream_TypeDef *Instance;stm32f4xx_hal_gpio.h
Line 243: void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
Line 244: void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
Line 253: GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
Line 254: void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
Line 255: void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
Line 256: HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);I imported to nucleo-f401RE project from your git zip file archive and it builds without error.
Any suggestions on what to try next? Thanks.
Larry H
May 3, 2016 at 6:05 pm #2679Carmine NovielloKeymasterHi Larry,
It seems that all is correct. Without having the project in my hands it’s hard to say what’s wrong. if you can, share it in such a way (dropbox, drive, etc).The only thing I can suggest to you is to refresh the eclipse project:
1. First click with the right mouse button on the project name in the Project Explorer pane and select “Refresh”.
2. Then go Project->C/C++ Index->Freshen all files menu.After that, try to recompile the project.
I’ve successfully imported the CubeMX project using my CubeMXImporter tool (described in 4.2.4) and it compiles correctly.
May 3, 2016 at 6:08 pm #2681Carmine NovielloKeymasterI’ve attached the test project for your reference.
Attachments:
You must be logged in to view attached files.May 3, 2016 at 9:48 pm #2687LLHParticipantHello Carmine,
I used section 4.2.2 to create a new project (STM32F429-DISC1) completing the project wizard through Finish. Then all STM32F429-DISC1 project contents was replaced with contents of project archive attached to your previous reply of this post. Project build was error free with only 1 warning.
Description Resource Path Location Type
unused parameter ‘Regulator’ [-Wunused-parameter] stm32f4xx_hal_pwr.c /STM32F429-DISC1/system/src/stm32f4xx line 383 C/C++ ProblemAttached file is an archive of the stm32Disc1_f429I project which generates the errors listed in the first posting of this thread. Thanks for the “golden standard” example. By comparing the two projects, I should be able to located the project file content differences. Then the hard part will start (i.e., Determine why the project differences exist).
Larry H
Attachments:
You must be logged in to view attached files.May 3, 2016 at 10:35 pm #2692Carmine NovielloKeymasterOk, these are the problems of your project:
- You forgot to go inside the Drivers/CMSIS/Device/ST/STM32F4xx/Include filesystem folder and drag all its content inside the system/include/cmsis Eclipse folder.
- The file system/src/stm32f4xx/stm32f4xx_hal.c is missed
- Remove the macro OS_USE_SEMIHOSTING and leave the macro OS_USE_TRACE_SEMIHOSTING_DEBUG
Let me know if now compiles.
May 4, 2016 at 8:21 pm #2694LLHParticipantCarmine,
After correcting the issues you located so quickly, I am pleased to report the stm32Disc1_f429I compiles with no errors and one warning. It is the same warning detected in test project you provided in an earlier post of this thread for my reference.
Description Resource Path Location Type
unused parameter ‘Regulator’ [-Wunused-parameter] stm32f4xx_hal_pwr.c /stm32Disc1_f429I/system/src/stm32f4xx line 383 C/C++ ProblemAfter more errors were generated in my earlier build attempts, here are some lessons learned from a beginner’s perspective.
1. Do not use another error free project as reference basis for making changes in a project which does not compile; unless you know what you a doing. Reviewing my cliff notes, I see that I deleted the system/src/stm32f4xx/stm32f4xx_hal.c file which was the source of over 90 compile errors. A classic example of what happens when you perform a task without knowing what you are doing.
2. The crucial significance of Table 2 in section 4.2.3 (Importing generated files into the Eclipse project manually) really hit home after you discovered I forgot to go inside the Drivers/CMSIS/Device/ST/STM32F4xx/Include file system folder and drag all its content inside the system/include/cmsis Eclipse folder.
I suggest flagging the significance of Table 2 in the first paragraph of section 4.2.3 and suggest the developer number each row of Table 2. Note these row numbers within section 4.2.3 text. Check off each referenced Table 2 row after the select-click-drag of the file contents from .\Drivers\CMSIS\… or .\Drivers\STM32F4xx_HAL_Driver\… file system folder and to inside the applicable Eclipse folder. Where .\Drivers is a subdirectory of C:\Users\<USER-ID>\STM32Cube\Repository\STM32Cube_FW_F4_V1.11.0 directory on Windows OS.
Larry H
May 5, 2016 at 12:44 pm #2704Carmine NovielloKeymasterHi,
The warning in the HAL_PWR module depends on the way the HAL is designed. Some HAL functions defines arguments that aren’t used on the specific HAL port (for example CubeF4 HAL). ST has decided to include unused parameters to facilitate the porting of user applications to other HALs. However, ST developers are progressively suppressing those warnings in newer HAL releases.I’ll update the paragraph 4.2.3 using your suggests.
Regards,
Carmine -
AuthorPosts
- You must be logged in to reply to this topic.