2015-05-19 09:12 PM
Dear ST,
I'd like to give a bit of feedback now that I've worked with STM32CubeMX for a while.Since CubeMX is really generating HAL code, what do you think of having CubeMX put the generated code into a directory called hal instead of src?Also, since I want to have control over what is in my main.c file, could CubeMX put the startup code into something like cube_init.c? Or something else, but not main.c.It's small, but I'd rather use my 35 years of experience to determine the structure of my directories (I put MY source into a directory called src these days, and I put bible code that isn't linted for MISRA compliance, into a separate directory). MY code starts at main() according to C, your code gets called since it is library code.It would be nice if the directories didn't have to be generated where the ioc file lives. The ioc file is more of a hardware file and EEs would like to throw them in with their Altium files instead of the software files.It's kinda like having your code fit in to my/our way of working rather than me/us fitting into your code structure.That's what I've noticed, a couple of sharp edges that get in the way.Just a thought.Thanks,Andrei from The Great White North2015-05-20 04:30 AM
Hi Andrei,
I agree that dumping the generated files in .../src is not the best choice. I would suggest .../cube or .../MX since strictly speaking, it is not HAL library code but rather generated code that uses HAL. .../src/MX or .../src/cube (or similar) would also be acceptable to me.Location of the .ioc file has not been an issue for me because the H/W engineer did not produce it. Had he done so, it would (or should) have been in the source management system and the location and an alternate code location would have been convenient. The project settings show the project path but it seems not to be editable.2015-06-04 09:28 AM
2015-06-10 03:22 PM
Please try and understand this, main.c is MY file, in fact with my chosen RTOS my entrypoint is called Init() and there is no main(). Your code is support library code and should be encapsulated from my code.
A more appropriate structure is for you to supply something like InitCube(). I can call that from my startup code, much like FatFS does.