[Cryptech-Commits] [sw/stm32] 02/04: Use default SysTick interrupt priority.

git at cryptech.is git at cryptech.is
Mon Apr 17 20:38:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch ksng
in repository sw/stm32.

commit 6c51d4438d84f34cce1a96834a5c91a2c71761ae
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Mon Apr 17 16:12:10 2017 -0400

    Use default SysTick interrupt priority.
    
    We really don't want SysTick_Handler, which runs the task scheduler, to
    run at a higher priority than SVC_Handler, which runs supposedly-atomic
    operations like mutex locking and unlocking. I've seen a mutex lock/unlock
    mismatch which I think is due to interrupting rt_mut_release at a
    particularly inopportune moment.
---
 .../TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_conf.h  |  2 +-
 .../TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_msp.c   | 10 ----------
 stm-init.c                                                     |  1 -
 3 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_conf.h
index 8a11b8b..50e70d5 100644
--- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_conf.h
+++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_conf.h
@@ -145,7 +145,7 @@
   * @brief This is the HAL system configuration section
   */     
 #define  VDD_VALUE                    ((uint32_t)3300) /*!< Value of VDD in mv */
-#define  TICK_INT_PRIORITY            ((uint32_t)0)    /*!< tick interrupt priority */
+#define  TICK_INT_PRIORITY            ((uint32_t)0x0F) /*!< tick interrupt priority */
 #define  USE_RTOS                     0
 #define  PREFETCH_ENABLE              1
 #define  INSTRUCTION_CACHE_ENABLE     1
diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_msp.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_msp.c
index 609c596..fa08bb5 100644
--- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_msp.c
+++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_hal_msp.c
@@ -44,16 +44,6 @@ void HAL_MspInit(void)
 
   /* USER CODE END MspInit 0 */
 
-  /* XXX
-   * Fredrik's HAL_MspInit sets this to NVIC_PRIORITYGROUP_4 (as just
-   * happened in HAL_Init), but then he resets it to NVIC_PRIORITYGROUP_0
-   * in stm_init. */
-  HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
-
-  /* System interrupt init*/
-  /* SysTick_IRQn interrupt configuration */
-  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
-
   /* USER CODE BEGIN MspInit 1 */
 
   /* USER CODE END MspInit 1 */
diff --git a/stm-init.c b/stm-init.c
index 0016e13..51b2ae7 100644
--- a/stm-init.c
+++ b/stm-init.c
@@ -78,7 +78,6 @@ void stm_init(void)
   /* System interrupt init*/
   /* Sets the priority grouping field */
   HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
-  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
 
   /* Initialize all configured peripherals */
 #ifdef HAL_GPIO_MODULE_ENABLED



More information about the Commits mailing list