I'm working on a port to a STML151 target (also cortex M3 based) and have some code running (python shell on UART). Yet I was wondering how to best integrate it into the existing stmhal file/build structure.
For example, the makefile has hardcoded CFLAGS_CORTEX_M4 flags, which obviously are different for a cortex M3 CPU... Yet I'd like to integrate my changes into the stmhal directory rather than into a (yet another..) build folder.
So I'd like to raise a discussion if a new structure of the stmhal build target might be useful in order to simplify the ports to a different ARM CPUs
The approach I'd would have taken was to separate host specific compiler switches into sub-mak files that each platform can implement individually. For example, each platform (board) would specifiy "CFLAGS_HOST" that will be included by the master makefile in the stmhal root.
As most of the boards currently supported are using the F4 CPU there might be an option to group it to something like:
Code: Select all
-stmhal
- boards
- F4based
- PYBOARD
- HYDRABUS
- ...
- F2based
- L1based
in each "..based" directory would be the location of the submakefile mentioned above.
For memory constraint systems, I'd also include the possibilty to configure the USB subsystem (e.g. only supporting CDC profile) in that makefile.
Anyway is this idea completly way off or what do people think?