- Notifications
You must be signed in to change notification settings - Fork1k
Script to update HAL drivers and CMSIS devices from the STM32Cube GitHub release#1026
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions.gitattributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,6 +3,7 @@ astyle.out | ||
boards.local.txt | ||
platform.local.txt | ||
path_config.json | ||
update_config.json | ||
# Backup | ||
*.bak | ||
26 changes: 26 additions & 0 deletionsCI/utils/patch/CMSIS/MP1/0001-MP1-Review-HAL-default-configuration.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 01b39c624995928905b99b3ce211482d27d0d1bc Mon Sep 17 00:00:00 2001 | ||
From: Bumsik Kim <k.bumsik@gmail.com> | ||
Date: Sat, 12 Oct 2019 21:50:30 +0900 | ||
Subject: [PATCH 1/1] [MP1] Review HAL default configuration | ||
--- | ||
.../Device/ST/STM32MP1xx/Include/stm32mp1xx.h | 6 +- | ||
.../STM32MP1xx/stm32mp1xx_hal_conf_default.h | 89 ++++++++++--------- | ||
2 files changed, 49 insertions(+), 46 deletions(-) | ||
diff --git a/system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp1xx.h b/system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp1xx.h | ||
index 10395b51..528b9b91 100644 | ||
--- a/system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp1xx.h | ||
+++ b/system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp1xx.h | ||
@@ -197,7 +197,7 @@ typedef enum | ||
*/ | ||
#if defined (USE_HAL_DRIVER) | ||
- #include "stm32mp1xx_hal_conf.h" | ||
+ #include "stm32mp1xx_hal.h" | ||
#endif /* USE_HAL_DRIVER */ | ||
-- | ||
2.25.1.windows.1 | ||
146 changes: 146 additions & 0 deletionsCI/utils/patch/HAL/F1/0001-F1-I2C-HAL-fix-generate-Start-only-once-Stop-is-fini.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
From 4aba75ec152a2d2c65d07c1912da9eb4ea08be2e Mon Sep 17 00:00:00 2001 | ||
From: Alexandre Bourdiol <alexandre.bourdiol@st.com> | ||
Date: Mon, 27 Jan 2020 18:23:15 +0100 | ||
Subject: [PATCH 1/1] [F1] I2C HAL fix: generate Start only once Stop is | ||
finished | ||
--- | ||
.../Src/stm32f1xx_hal_i2c.c | 87 ++++++++++++++++++- | ||
1 file changed, 86 insertions(+), 1 deletion(-) | ||
diff --git a/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c b/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c | ||
index 6e74e699..fc108e0b 100644 | ||
--- a/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c | ||
+++ b/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c | ||
@@ -3492,6 +3492,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3591,6 +3612,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3757,6 +3799,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_ | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3882,6 +3945,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -4565,7 +4649,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevA | ||
UNUSED(DevAddress); | ||
/* Abort Master transfer during Receive or Transmit process */ | ||
- if (hi2c->Mode == HAL_I2C_MODE_MASTER) | ||
+ if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET) && (hi2c->Mode == HAL_I2C_MODE_MASTER)) | ||
{ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -4596,6 +4680,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevA | ||
{ | ||
/* Wrong usage of abort function */ | ||
/* This function should be used only in case of abort monitored by master device */ | ||
+ /* Or periphal is not in busy state, mean there is no active sequence to be abort */ | ||
return HAL_ERROR; | ||
} | ||
} | ||
-- | ||
2.25.1.windows.1 | ||
146 changes: 146 additions & 0 deletionsCI/utils/patch/HAL/F2/0001-F2-I2C-HAL-fix-generate-Start-only-once-Stop-is-fini.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
From d5815c606105adc2d390f9bac704934c923ea674 Mon Sep 17 00:00:00 2001 | ||
From: Alexandre Bourdiol <alexandre.bourdiol@st.com> | ||
Date: Tue, 28 Jan 2020 09:37:52 +0100 | ||
Subject: [PATCH 1/1] [F2] I2C HAL fix: generate Start only once Stop is | ||
finished | ||
--- | ||
.../Src/stm32f2xx_hal_i2c.c | 87 ++++++++++++++++++- | ||
1 file changed, 86 insertions(+), 1 deletion(-) | ||
diff --git a/system/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c b/system/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c | ||
index a8bcf8c5..4c7b5483 100644 | ||
--- a/system/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c | ||
+++ b/system/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c | ||
@@ -3428,6 +3428,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3527,6 +3548,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3693,6 +3735,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_ | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -3818,6 +3881,27 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16 | ||
while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET); | ||
} | ||
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */ | ||
+ /* Wait until STOP flag is reset */ | ||
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U); | ||
+ do | ||
+ { | ||
+ count--; | ||
+ if (count == 0U) | ||
+ { | ||
+ hi2c->PreviousState = I2C_STATE_NONE; | ||
+ hi2c->State = HAL_I2C_STATE_READY; | ||
+ hi2c->Mode = HAL_I2C_MODE_NONE; | ||
+ hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; | ||
+ | ||
+ /* Process Unlocked */ | ||
+ __HAL_UNLOCK(hi2c); | ||
+ | ||
+ return HAL_ERROR; | ||
+ } | ||
+ } | ||
+ while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP); | ||
+ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -4501,7 +4585,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevA | ||
UNUSED(DevAddress); | ||
/* Abort Master transfer during Receive or Transmit process */ | ||
- if (hi2c->Mode == HAL_I2C_MODE_MASTER) | ||
+ if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET) && (hi2c->Mode == HAL_I2C_MODE_MASTER)) | ||
{ | ||
/* Process Locked */ | ||
__HAL_LOCK(hi2c); | ||
@@ -4532,6 +4616,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevA | ||
{ | ||
/* Wrong usage of abort function */ | ||
/* This function should be used only in case of abort monitored by master device */ | ||
+ /* Or periphal is not in busy state, mean there is no active sequence to be abort */ | ||
return HAL_ERROR; | ||
} | ||
} | ||
-- | ||
2.25.1.windows.1 | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.