2022-05-31 03:52 AM
Hello ,
I am a student and want to understand the basic terminologies of the files being generated from the STM32CubeMX. Any document/Video to it will also be helpful.
When I generate the code say for Nucleo-F401RE from the STM32CubeMX , I get these files in the project :
stm32f4xx_hal.msp.c , stm32f4xx_hal_conf.h in the src and inc respectively.
But if I see any CUBE MX project we have files like :
stm32f4xx_nucleo.c , stm32f4xx_nucleo_bus.c and corresponding header file as well
apart from what we get in the STM32Cube code generation like hal_msp and conf header.
Why cant we have these two files also get generated.
I see that we have BSP_inits defined in the bus.c and then from that we call MX_<method> for any given peripheral ( i2c,uart) and this MX is what is generated inside the hal_msp.c.
why to have files like nucleo and nucleo_bus when we can do with the hal_msp.c files?
Thanks for reading this !!
Regards,
Ped
2022-05-31 05:31 AM
Only generate the files that depend on settings in MX.
Much of the code is stable, proven, and independent of MX settings, so it can be in fixed files that are just added to the project. No need to generate it again and chance adding bugs.
Paul
2022-05-31 09:34 AM
i agree but looking for the design thinking behind this.
2022-06-01 04:05 AM
Educated Guess: Limited Resources.
Also:
Paul