-
Notifications
You must be signed in to change notification settings - Fork 1k
[New series] STM32MP1xx (just Cube package) #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @kbumsik |
For Astyle issue, you should add |
Thanks for mentioning about Astyle. BTW I need to discuss one thing for the upcoming PR. As STM32MP1 is indeed a special board among other STM32 MCUs, it is necessary to include a new README document on how to use STM32MP1 Discovery board with Arduino IDE. For example, instructions about a special upload tool (STM32Prog is not supported) and some warnings regarding collision of Arduino binary and Linux device tree. Where is the best place to put the READMEs? Maybe in |
Good question, I guess, as a first step, this could be add in the variant. |
Hi @kbumsik
Do you succeed? |
@fpistm Pretty much, except I2C is not working properly for unknown reasons and that is the only reason I haven't made a PR for weeks :( |
OK thanks for the quick feedback. |
Great, I got another person who can test the actual hardware :D I will soon make a PR then. |
Hi @kbumsik |
If you need another person to test on hardware, I also have a STM32MP157C-DK2 board and will be working on getting this up and running. |
Hi @aedancullen |
a2c2456
to
23eceb0
Compare
@fpistm @aedancullen I was quite busy for a moment but now I can make a PR: #717 :) #717 also has the same commits as this PR. I will clean up #717 after this PR is merged. Though the hardware issues seems to be resolved, I would appreciate if anyone test my PR :) |
Thanks @kbumsik for the update It misses the HAL version in the https://github.com/stm32duino/Arduino_Core_STM32/blob/master/system/Drivers/STM32YYxx_HAL_Driver_version.md During my review I found 3 files diff in the HAL (compare to the one installed by CubeMX 5.4.0): 3 files diff
--- Arduino_Core_STM32/system/Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_tim_ex.h
+++ STM32Cube/Repository/STM32Cube_FW_MP1_V1.1.0/Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_tim_ex.h
@@ -261,7 +261,13 @@
#define IS_TIM_BREAKINPUT(__BREAKINPUT__) (((__BREAKINPUT__) == TIM_BREAKINPUT_BRK) || \
((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2))
+#if defined(COMP1) && defined(COMP2)
+#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN) || \
+ ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \
+ ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2))
+#else
#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) ((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)
+#endif /* COMP1 && COMP2 */
#define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__) (((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE) || \
((__STATE__) == TIM_BREAKINPUTSOURCE_ENABLE)) --- Arduino_Core_STM32/system/Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_ll_tim.h
+++ STM32Cube/Repository/STM32Cube_FW_MP1_V1.1.0/Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_ll_tim.h
@@ -122,13 +122,13 @@
/* Generic bit definitions for TIMx_AF1 register */
#define TIMx_AF1_BKINE TIM1_AF1_BKINE /*!< BRK BKINE input enable */
#if defined(DFSDM1_Channel0)
-#define TIMx_AF1_BKDFBKE TIM1_AF1_BKDF1BK0E /*!< BRK DFSDM1_BREAK[0] enable */
+#define TIMx_AF1_BKDFBKE TIM1_AF1_BKDFBKE /*!< BRK DFSDM1_BREAK[0] enable */
#endif /* DFSDM1_Channel0 */
#define TIMx_AF1_BKINP TIM1_AF1_BKINP /*!< BRK BKIN input polarity */
/* Generic bit definitions for TIMx_AF2 register */
#define TIMx_AF2_BK2INE TIM1_AF2_BK2INE /*!< BRK B2KINE input enable */
#if defined(DFSDM1_Channel0)
-#define TIMx_AF2_BK2DFBKE TIM1_AF2_BK2DF1BK1E /*!< BRK DFSDM_BREAK[0] enable */
+#define TIMx_AF2_BK2DFBKE TIM1_AF2_BK2DFBKE /*!< BRK DFSDM_BREAK[0] enable */
#endif /* DFSDM1_Channel0 */
#define TIMx_AF2_BK2INP TIM1_AF2_BK2INP /*!< BRK BK2IN input polarity */
#define TIMx_AF1_ETRSEL TIM1_AF1_ETRSEL /*!< TIMx ETR source selection */
@@ -1058,6 +1058,8 @@
* @{
*/
#define LL_TIM_BKIN_SOURCE_BKIN TIM1_AF1_BKINE /*!< BKIN input from AF controller */
+#define LL_TIM_BKIN_SOURCE_BKCOMP1 TIM1_AF1_BKCMP1E /*!< internal signal: COMP1 output */
+#define LL_TIM_BKIN_SOURCE_BKCOMP2 TIM1_AF1_BKCMP2E /*!< internal signal: COMP2 output */
#define LL_TIM_BKIN_SOURCE_DF1BK TIM1_AF1_BKDF1BK0E /*!< internal signal: DFSDM1 break output */
/**
* @}
@@ -3731,8 +3733,12 @@
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether
* or not a timer instance allows for break input selection.
* @rmtoll AF1 BKINE LL_TIM_EnableBreakInputSource\n
+ * AF1 BKCMP1E LL_TIM_EnableBreakInputSource\n
+ * AF1 BKCMP2E LL_TIM_EnableBreakInputSource\n
* AF1 BKDF1BK0E LL_TIM_EnableBreakInputSource\n
* AF2 BK2INE LL_TIM_EnableBreakInputSource\n
+ * AF2 BK2CMP1E LL_TIM_EnableBreakInputSource\n
+ * AF2 BK2CMP2E LL_TIM_EnableBreakInputSource\n
* AF2 BK2DF1BK1E LL_TIM_EnableBreakInputSource
* @param TIMx Timer instance
* @param BreakInput This parameter can be one of the following values:
@@ -3740,6 +3746,8 @@
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2
* @param Source This parameter can be one of the following values:
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2
* @arg @ref LL_TIM_BKIN_SOURCE_DF1BK
* @retval None
*/
@@ -3754,8 +3762,12 @@
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether
* or not a timer instance allows for break input selection.
* @rmtoll AF1 BKINE LL_TIM_DisableBreakInputSource\n
+ * AF1 BKCMP1E LL_TIM_DisableBreakInputSource\n
+ * AF1 BKCMP2E LL_TIM_DisableBreakInputSource\n
* AF1 BKDF1BK0E LL_TIM_DisableBreakInputSource\n
* AF2 BK2INE LL_TIM_DisableBreakInputSource\n
+ * AF2 BK2CMP1E LL_TIM_DisableBreakInputSource\n
+ * AF2 BK2CMP2E LL_TIM_DisableBreakInputSource\n
* AF2 BK2DF1BK1E LL_TIM_DisableBreakInputSource
* @param TIMx Timer instance
* @param BreakInput This parameter can be one of the following values:
@@ -3763,6 +3775,8 @@
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2
* @param Source This parameter can be one of the following values:
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2
* @arg @ref LL_TIM_BKIN_SOURCE_DF1BK
* @retval None
*/
@@ -3777,14 +3791,19 @@
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether
* or not a timer instance allows for break input selection.
* @rmtoll AF1 BKINP LL_TIM_SetBreakInputSourcePolarity\n
+ * AF1 BKCMP1P LL_TIM_SetBreakInputSourcePolarity\n
+ * AF1 BKCMP2P LL_TIM_SetBreakInputSourcePolarity\n
* AF2 BK2INP LL_TIM_SetBreakInputSourcePolarity\n
+ * AF2 BK2CMP1P LL_TIM_SetBreakInputSourcePolarity\n
+ * AF2 BK2CMP2P LL_TIM_SetBreakInputSourcePolarity
* @param TIMx Timer instance
* @param BreakInput This parameter can be one of the following values:
* @arg @ref LL_TIM_BREAK_INPUT_BKIN
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2
* @param Source This parameter can be one of the following values:
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN
- * @arg @ref LL_TIM_BKIN_SOURCE_DF1BK
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1
+ * @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2
* @param Polarity This parameter can be one of the following values:
* @arg @ref LL_TIM_BKIN_POLARITY_LOW
* @arg @ref LL_TIM_BKIN_POLARITY_HIGH
--- Arduino_Core_STM32/system/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim_ex.c
+++ STM32Cube/Repository/STM32Cube_FW_MP1_V1.1.0/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim_ex.c
@@ -1826,6 +1826,24 @@
bkin_polarity_bitpos = TIM1_AF1_BKINP_Pos;
break;
}
+#if defined(COMP1) && defined(COMP2)
+ case TIM_BREAKINPUTSOURCE_COMP1:
+ {
+ bkin_enable_mask = TIM1_AF1_BKCMP1E;
+ bkin_enable_bitpos = TIM1_AF1_BKCMP1E_Pos;
+ bkin_polarity_mask = TIM1_AF1_BKCMP1P;
+ bkin_polarity_bitpos = TIM1_AF1_BKCMP1P_Pos;
+ break;
+ }
+ case TIM_BREAKINPUTSOURCE_COMP2:
+ {
+ bkin_enable_mask = TIM1_AF1_BKCMP2E;
+ bkin_enable_bitpos = TIM1_AF1_BKCMP2E_Pos;
+ bkin_polarity_mask = TIM1_AF1_BKCMP2P;
+ bkin_polarity_bitpos = TIM1_AF1_BKCMP2P_Pos;
+ break;
+ }
+#endif /* COMP1 && COMP2 */
default:
{
|
I think I found the issue they made some update after GitHub release 1.1.0: That's fine. |
Summary
This PR adds STM32CubeMP1 package. In detail this adds the following:
I'm currently working on STM32MP157 Discovery boards port. While the work is pretty much done and I will make a new PR for it soon (hopefully in this week), for now I would like to make a separate PR that just adds a STM32CubeMP1 package so that it will reduce excessive noises in the next PR.
I pulled STM32CubeMP1 v1.1.0 from its Github release directly.
This change is