Add stm32 support
Following the initial STM32 support provided by CERN, this PR captures the work Diamond has done to integrate this into the upstream.
Hi Michael,
We are still reviewing your PR before merging, but so far we have the following observations:
- The STM32 hardware abstraction library comes with a license that is not compatible with GPL, nor does it qualify as an Open Source license due to its restrictive nature in using it on microcontrollers not manufactured by ST Microelectronics. We have the same problem with the hardware abstraction library used by the LPC176x port, but we are taking steps to fix it. I believe you can generate BSD or Apache v2 licensed versions of the STM32 HAL using STM32Cube, I did it few years ago, though I don't remember how exactly;
- I doesn't feel right having target specific code under the
sensors/directory. I couldn't come with a good alternative yet; - Do no use
-fcommongcc flag, global variables should not be instantiated on header files, instantiate them on a .c file and use theexternattribute on headers. We already force-fno-commonhere: https://github.com/lnls-dig/openMMC/blob/a6317247d426273bdd6f4ea31b7c5de92ee57a34/toolchain/toolchain-arm-none-eabi.cmake#L29 so to make the compiler behaviour consistent between different versions.
As we discussed previously, we will merge this on the stm32-support branch for now, then we need to harmonise this with the devel branch (that has diverged substantially). Also, please keep in mind that there will be substantial changes to the openMMC in the near future to fulfil our desire to fix some design issues and fix some long standing issues: https://github.com/lnls-dig/openMMC/issues/110.
@gustavosr8 is our new intern that will start working on the openMMC project shortly, so now we will have someone dedicated to help on this.