Conversation
…ubeMX.Debug+STM32F217IGHx.cbuild.yml Depending on the call the tests require the generator variants of cbuild-idx and cbuild from the tmp directory but not the ones from out.
…t possible .mxproject content
… case than the values it will contain. so I'll try another crazy name.
|
Diff Coverage: The code coverage on the diff in this pull request is 80.3%. Total Coverage: This PR will increase coverage by 14.26%. File Coverage Changes
🛟 Help
|
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #129 by adding support for parsing and including source files from the ThirdPartyIp section of .mxproject files. The implementation adds a new ThirdPartyIqFiles struct to store third-party IP includes, source files, and assembly files, which are then written to the generated CGEN YAML output.
Key changes:
- Added parsing logic for
ThirdPartyIpsections in.mxprojectfiles - Extended the CGEN YAML generation to include a new "ThirdParty" group with associated files
- Added comprehensive unit tests for the new functionality
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vcpkg-configuration.json | Added vcpkg configuration with ARM toolchain and compiler dependencies |
| testdata/testExamples/STM32H7_SC/STM32CubeMX/device/MX_Device/MX_Device.h | Updated timestamp in generated device header |
| testdata/testExamples/STM32F2/RTE/Device/STM32F217IGHx/regions_STM32F217IGHx.h | Added new regions configuration header for STM32F2 device |
| testdata/testExamples/STM32F2/RTE/Device/STM32F217IGHx/ac6_linker_script.sct.src | Added new AC6 linker script template for STM32F2 device |
| testdata/stm32cubemx/cfg/MX_Device.h | Added new test device header file |
| internal/stm32CubeMX/stm32CubeMX_test.go | Added comprehensive tests for WriteProjectFile function |
| internal/stm32CubeMX/stm32CubeMX.go | Added logic to append ThirdParty group with files to CGEN output |
| internal/stm32CubeMX/iniReader_test.go | Added tests for GetData function covering ThirdPartyIp parsing |
| internal/stm32CubeMX/iniReader.go | Added ThirdPartyIqFiles struct and parsing logic for ThirdPartyIp sections |
| internal/readFile/readFile.go | Added comments and fixed path reference for STM32CubeMX.ioc |
| internal/common/common.go | Added missing error return statement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
The current implementation does not work for me as the files are not correctly specified relative to the cgen.yml file:
File location
STM32CubeMX\STM32F423VHTx\STM32CubeMX\Middlewares\ST\threadx\common\src\tx_initialize_high_level.c
currently specified in *.cgen.yml
../Middlewares/ST/threadx/common/src/tx_initialize_high_level.c
should read:
./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_initialize_high_level.c
After patching the cgen.yml all specified filed were found. But linking is still missing symbols.
@brondani thanks for the investigation. It seems we are missing files from mxproject in the cgen.yml file:
- file: ./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_thread_system_suspend.c
- file: ./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_thread_system_resume.c
- file: ./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_thread_system_preempt_check.c
- file: ./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_timer_system_activate.c
- file: ./STM32CubeMX/Middlewares/ST/threadx/common/src/tx_timer_system_deactivate.c
Another observation is that RW_IRAM1 is not in the default linker script, however I think we need to configure to use the linker script from STCube which needs to be added manually?
@bgn42 can you please compare all files listed in .mxproject and cgen.yml
DavidLesnjak
left a comment
There was a problem hiding this comment.
I didn’t have a chance yet to deeply analyze the code changes, but I did test the cbridge artifact using STM32CubeMX 6.15 with the STM32F769I-DISCO board.
In my test project, I enabled FatFS, FreeRTOS, and USB Audio middleware components.
Please take a look at the attached input files (.ioc and .mxproject) and the generated output cgen.yml.
You can notice that all third-party sources (FreeRTOS, FatFS, and USB) are currently listed under the CubeMX group, while the ThirdParty group is empty — which leads to a schema validation error.
I would expect that these third-party files are listed under the ThirdParty group instead.
Actually, I’d suggest going a step further and splitting the ThirdParty group into multiple groups, one per individual third-party component (e.g., FreeRTOS, FatFS, USB, etc.). This would improve clarity and structure.
It’s also worth considering that the .mxproject file might be generated differently for different STM32 families or depending on which third-party components are enabled. Some investigation may be needed to understand how third parties are represented in .ioc and .mxproject files across device families.
I recommend updating the STM32CubeMX projects in testData/testExamples to include configurations that enable various third-party components.
Additional tests could then be added that generate cgen.yml from these examples and compare the results against reference outputs.
|
@DavidLesnjak , in your case there is no ThirdParty-Section in .mxproject, all files are in the [PreviousUsedKeilFiles]. cbridge cannot know that these should be moved to a new section. But, cbridge should not create an ampty ThirdParty group in cgen.yml. |
…d party part from vendor and version creating multiple groups. Removed filter of file names from third party files. Changed filter "system_" to "system_stm32"
…p... as an error.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes
#129
Changes
now adds sources of ThirdPartyIp section of .mxproject
Checklist