Page 1 of 1

[PATCH] added missing STM32F103x8 definition  Topic is solved

Posted: Wed Mar 06, 2019 1:36 pm
by ceremcem
Regarding to the comment, I'm providing the patch here:

Code: Select all

From 6bc2bd8fc3871dea3c6410587b9ee4966096e15a Mon Sep 17 00:00:00 2001
From: Cerem Cem ASLAN <cem@aktos.io>
Date: Wed, 6 Mar 2019 15:29:32 +0300
Subject: [PATCH] added missing STM32F103x8 definition

---
 os/common/ext/ST/STM32F1xx/stm32f1xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/os/common/ext/ST/STM32F1xx/stm32f1xx.h b/os/common/ext/ST/STM32F1xx/stm32f1xx.h
index 333095bae..40e63e457 100644
--- a/os/common/ext/ST/STM32F1xx/stm32f1xx.h
+++ b/os/common/ext/ST/STM32F1xx/stm32f1xx.h
@@ -127,6 +127,10 @@
   * @{
   */
 
+#if defined(STM32F103x8)
+  #define STM32F103xB // see line 90
+#endif
+
 #if defined(STM32F100xB)
   #include "stm32f100xb.h"
 #elif defined(STM32F100xE)
--
2.20.1

Re: [PATCH] added missing STM32F103x8 definition

Posted: Sat Mar 16, 2019 4:51 pm
by Giovanni
Hi,

Usually we do not fix vendor files, the fix would be lost next time we update the headers. Perhaps the best workaround is to define the x8 as an xB in board.h.

Giovanni

Re: [PATCH] added missing STM32F103x8 definition

Posted: Sat Mar 16, 2019 4:55 pm
by faisal
Report issues with CMSIS files here:
https://github.com/ARM-software/CMSIS_5

Also, check if the latest trunk code already has the fix.


Submit bug report to STMicro, on their forums perhaps?

Re: [PATCH] added missing STM32F103x8 definition

Posted: Sat Mar 16, 2019 5:01 pm
by Giovanni
faisal wrote:Report issues with CMSIS files here:
https://github.com/ARM-software/CMSIS_5

Also, check if the latest trunk code already has the fix.


The problem is in ST files, those are not handled there I believe.

Giovanni

Re: [PATCH] added missing STM32F103x8 definition

Posted: Sat Mar 16, 2019 10:05 pm
by ceremcem
Giovanni wrote:Hi,

Usually we do not fix vendor files, the fix would be lost next time we update the headers.
Giovanni


That's reasonable.


Perhaps the best workaround is to define the x8 as an xB in board.h.


Current examples in ChibiOS/demos stick to this approach. However, I find that quite confusing because it becomes very hard to remember which definition encapsulates what other definitions. In order to prevent typing errors (I'm not quite sure of this name) definitions in the header files should be same as the included files in the makefiles.

Another approach might be maintaining another repository for this files, like https://github.com/modm-io/cmsis-header-stm32 and applying this type of patches in that repository. When vendor makes an update, we can simply copy and paste all files into our "vendor" branch, either cherry pick all of our patches or create a "vendor update" patch, review them and finally apply everything to the "master" branch. This may seem a little bit complex, but it would consume a tiny amount of time per vendor update once it's put in order.

If you still find above approach cumbersome, I may propagate my own patches along with a ST-patches folder within chibi-project, my boilerplate for ChibiOS projects.