Working with STM32Cube
I have created a solution using STM32Cube (Windows) and I've imported it and I am using it in CrossStudio (Mac). This is a nice combination. I can update pin usage or peripheral usage in STM32Cube, generate new source, and then compile and test in CS. To expand on this solution, I add in projects with other source files, generate libraries and then include them in the solution. Since I'm working on an embedded project which will be updated over the air, I will have three different images in flash: bootloader which never changes and is responsible for loading an application image (Left or Right). One application image is running and the other can be updated. So far things are pretty good but I have several questions relating to this development method.
1. When adding in a new project under the generated solution, I have to add in preprocessor macros, include paths, add the library to the executable and a couple of other properties to get the project to compile. This is because it references header files from the solution. Is is possible to generate a template project which I can put all that stuff in and then instantiate from that template?
2. As I will be generating identical images for different locations in flash to allow me to do OTA (over the air) updates, should I have a project for each final image and pull in everything as a library generating an executable for that image? I've already created separate section placement files which I would used in each project. Or is there a better way to manage multiply built images?
3. Is it possible to have different configurations for a project with different section placement files? And build them all at once?
4. Is it possible to create PIC (position independent code) so that I can run the same image in memory at two different locations?
5. Is there a memory file editor present in the Mac version of cross studio? I opened the memory section and placement files and they open as plain text full of XML. It is ugly to edit but possible.
6. If I rename a project library, this renames the output library but the enclosing project doesn't get the memo and one has to remember to tell it the new library name. Is it possible to have the enclosing project just use all the libraries in a library folder?
-
On the Cube GUI, the selected code generator output must be MDK-ARM V4. In Crossworks I use "import project" and import the .uvproj file. That's it.
The generated code contains regions where user code can be added so that it will not be removed when regenerating the code for some reason such as adding or changing a peripheral setting.
To add my own code I add a new project, output it as a library and then include the library in the generated solution project.
Please sign in to leave a comment.
Comments
2 comments