The problem you have, if you want to manually add support for additional firmwares in a CubeMX-generated project, for now, is due to the way CubeMX creates the Ac6 System Workbench project: if places the project in a sub-directory (SW4STM32/project Configuration), where it creates sub-trees (Application, Drivers) in which it links the needed source files, keeping the original files in folders you do not see as they are not in the project.
So to add an HAL driver to your project you should:
- Drivers/STM32xxxxx_HAL_Driver >> New >> File
- In the dialog that opens click on Advanced then Link to file in the file system
- Then click Variables...
- Click Extend... to be able to brows your system starting from the selected location (here the current workspace)
- Select the file you need (here stm32f4xx_hal_cryp.c), then clivk OK and Finish
Now your new driver will be included in the project and compiled although it will not be initialized or configured, and you will have to take care of this manually...
So another way to go may be to use CubeMX; however this suppose that you only modify CubeMX-generated files in the sections bracketted by /* USER xxxx BEGIN */ and /* USER xxxx END */ comments (otherwise your changes will be overwriten by CubeMX):
- Close your project in Ac6 System Workbench for STM32 (project >> Close Project)
- You may also close Ac6 System Workbench for STM32 itself
- Reopen your CubeMX project (the .ioc file)
- Modify your CubeMX project
- Add the new devices and/or firmwares,
- Assign pins to the new devices
- Change configuration settings for your project
- Re-generate your project
- Re-open your project
Then all the changes you’ve done in CubeMX will appear in Ac6 System Workbench for STM32 and initialization code will be present to configure and initialize your new devices.
Hope this helps,