Home › Forums › Mastering STM32 book support forum › Create Eclipse Project Problem(s) - section 4.2.2
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by Ron Fracchia.
-
AuthorPosts
-
February 4, 2017 at 1:13 am #5993LLHParticipant
The NUCLEO-F446RE board and the related HAL Macro applies to all exercises.
After Generating a C Project with CubeMX (Section 4.2.1) using Project -> Generate command,
a msg window pops up with the message to open project. After clicking the Open button, the following msg window is displayed. See Sec4-2-1_ToolChainSettingMsg.png
Do steps in later procedures associate the file type of the project with Toolchain in System Default Program settings? If not, how do I resolve the issue flagged by this warning message?Plowing ahead before submitting this posting, I tried to create an Eclipse Project (section 4.2.2). During the manual build of the Eclipse Project, the source subdirectory location of the following two files is listed in parenthesis.
system_stm32f4xx.c (C:STM32Toolchaincubemxoutstm32nucleo-f446Src)
startup_stm32f446xx.s (C:STM32Toolchaincubemxoutstm32nucleo-f446startup)
the file type of the second file was changed from .s to .S
This deviation of source directory location for these files is note on forum as caused by an update in ST CubeMX firmware functionality.
The first problem encountered was at Figure17, page 133, book release .21.The Cross ARM C Compiler option is not available in Tool Setting tab. See Sec4-2-3_Figure17.png attachment. I used the next best option as shown in attachment and run Project -> Build Project. 96 errors and 5 warnings were generated. One common thread in all the Release build errors, is the files where errors are located are in the
C:STM32Toolchainprojectsstm32nucleo-f446systemincludestm32f4xx
subdirectory.*.h files. File names of files with errors are
stm324f4xx_hal_[dma, flash, gpio,rcc,uart]
Only the stm32f4xx.hal.c file in C:STM32Toolchainprojectsstm32nucleo-f446systemsrc subdirectory has errors.Rather than include more error details, please suggest how to fix two issues associated with two attachments. Thanks.
Larry
Attachments:
You must be logged in to view attached files.February 4, 2017 at 5:17 pm #6004Ron FracchiaParticipantHi,
When you created the project in STM32Cube, you selected “SW4STM32” in Settings->Toolchain/IDE. When code generation completes, and you click “Open Project”, STM32Cube attempts to launch the SW4STM32 Workbench, which you probably do not have installed on your PC. The same sort of thing would happen if you clicked on an “.xls” file if you didn’t have Excel installed.
Even if you managed to associate the project with Eclipse (with the GNU ARM plugins), you would get a load of error messages because the STM32Cube project won’t compile unless it is imported via the procedure detailed in the “Mastering-STM32” book, section 4.2.3.
Did you import the project manually, or did you use Carmine’s Python script?
Just for grins, I imported an STM32Cube-generated ST32F446RE project into the SW4STM32 IDE (also based on Eclipse), and it compiled/linked with no errors. It did in fact use “STM32F446xx” as the preprocessor define.
If I have a spare moment this weekend, I’ll import into an Eclipse/GNUARM Plugin environment (I have a Windows utility that automates this process) and see if it compiles/links without errors.
-Ron
Attachments:
You must be logged in to view attached files.February 4, 2017 at 10:37 pm #6012LLHParticipantRon,
Thanks for the comments. Since I do not have the AC6-based tool chain on my PC, the Toolchain Settings error message should be flagged as a false negative.in Section 4.2.1, Figure 11 specifies SW4STM32 as Toolchain/IDE dropdown selection. In the current version of CubeMX, there is an additional entry at the bottom which specifies path to Firmware Package and the “Use Default Firmware Location” checkbox is checked. See Sec4-2-1_Figure11.png attachment.
I imported the project manually. See the File-FoldersImportedToEclipseFolders.pdf attachment. This is my version of Sec4-2-3_Table2 which I generated for the details of this specific Eclipse project.
After looking at your project properties window attachment in your reply, there are significant differences from Figure 17 (section 4.2.3). I assume your figure is from the SW4STM32 Toolchain.The only C Compiler listed on the Tool Settings tab is MCU GCC Compiler. The only C Compiler listed in my version of Figure 17 (section 4.2.3) is Cross ARM GNU C Compiler. See Sec4-2-3_Figure17.png attachment. I did a Clean and Build Project for all three Configuration settings: Debug [Active], Release, and [All Configurations]. Same number of errors in each case. It looks like I need to find out how to add Cross ARM C Compiler to this STM32Toolchain.
Larry
Attachments:
You must be logged in to view attached files.February 5, 2017 at 12:37 am #6020Ron FracchiaParticipantLarry,
I created an STM32Cube ST32F446RE project, and imported it into an Eclipse GNU ARM environment (set up as per “Mastering STM32”). It compiled and linked with no errors. In STM32Cube, I selected “SW4STM32” as the Toolchain/IDE, per “Mastering STM32”.
Try redoing your project selecting SW4STM32 as the STM32Cube toolchain… This just tells STMCube how to structure the project (A project file for Keil, for example, is totally different from one for IAR). STMCube doesn’t care if you have the selected IDE, or not.
Manually importing is a tedious, error-prone process. I’m thinking about posting my utility online, if I do, I’ll post a link here. It still needs a couple of tweaks to get it to insert the correct processor definition, but it moves all of the files correctly. (Are you using Windows?)
I have included screenshots of the console and the Eclipse setup….
-Ron
Attachments:
You must be logged in to view attached files.February 5, 2017 at 3:16 am #6030LLHParticipantRon,
Thanks for the added attachments. Test_04.png attachment (Your copy of Section 4.2.2 Figure 15) was the key. I was not following the proper case naming convention for MCU Macro which you circled in red (great highlight). Changing Vendor CMSIS name from stm32f4xx to STM32F4xx fixed the problem. Project now compiles with no errors or warnings.
Carmine’s book mentions the importance of using correct case convention for applicable names. He even used an example (i.e., a name containing f4 is different from a name containing F4). I just reconfirmed the guideline. 🙂
Larry
February 5, 2017 at 3:36 am #6031Ron FracchiaParticipantLarry,
Most excellent! I knew that red Magic Marker would come in handy one day!
-Ron
-
AuthorPosts
- You must be logged in to reply to this topic.