Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions system/Drivers/STM32L1xx_HAL_Driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ HAL Driver L1 | CMSIS Device L1 | CMSIS Core | Was delivered in the full MCU pac
------------- | --------------- | ---------- | -------------------------------------
Tag v1.4.0 | Tag v2.3.0 | Tag v5.4.0_cm3 | Tag v1.9.0 (and following, if any, till next new tag)
Tag v1.4.1 | Tag v2.3.1 | Tag v5.4.0_cm3 | Tag v1.10.0 (and following, if any, till next new tag)
Tag v1.4.2 | Tag v2.3.1 | Tag v5.4.0_cm3 | Tag v1.10.1 (and following, if any, till next new tag)

The full **STM32CubeL1** MCU package is available [here](https://github.com/STMicroelectronics/STM32CubeL1).

Expand Down
72 changes: 46 additions & 26 deletions system/Drivers/STM32L1xx_HAL_Driver/Release_Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,35 @@ <h1 id="purpose">Purpose</h1>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section12" checked aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V1.4.1 / 24-June-2020</label>
<input type="checkbox" id="collapse-section13" aria-hidden="true"> <label for="collapse-section13" aria-hidden="true">V1.4.2 / 28-August-2020</label>
<div>
<h2 id="main-changes">Main Changes</h2>
<h3 id="maintenance-release">Maintenance release</h3>
<ul>
<li>Patch release to fix issue in I2C HAL driver</li>
</ul>
<h2 id="contents">Contents</h2>
<ul>
<li><strong>HAL I2C</strong> driver
<ul>
<li>Update I2C_MasterReceiveRXNE() static API to avoid set the STOP bit again after the bit clearing by Hardware during the masking operation.
<ul>
<li>Add new API I2C_WaitOnSTOPRequestThroughIT() to wait for stop bit.</li>
</ul></li>
</ul></li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section12" aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V1.4.1 / 24-June-2020</label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<h3 id="maintenance-release-1">Maintenance release</h3>
<ul>
<li>Add new HAL EXTI driver</li>
<li>General updates to fix known defects and enhancements implementation</li>
</ul>
<h2 id="contents">Contents</h2>
<h2 id="contents-1">Contents</h2>
<ul>
<li><strong>HAL</strong> driver
<ul>
Expand Down Expand Up @@ -247,14 +267,14 @@ <h2 id="contents">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section11" aria-hidden="true"> <label for="collapse-section11" aria-hidden="true">V1.4.0 / 05-April-2019</label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<h3 id="maintenance-release-1">Maintenance release</h3>
<h2 id="main-changes-2">Main Changes</h2>
<h3 id="maintenance-release-2">Maintenance release</h3>
<ul>
<li>Add support of <strong>HAL callback registration</strong> feature</li>
<li>Add several enhancements implementation</li>
<li>Fix known defects to be aligned with others STM32 series</li>
</ul>
<h2 id="contents-1">Contents</h2>
<h2 id="contents-2">Contents</h2>
<ul>
<li><strong>HAL/LL</strong> generic
<ul>
Expand Down Expand Up @@ -530,9 +550,9 @@ <h2 id="contents-1">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section9" aria-hidden="true"> <label for="collapse-section9" aria-hidden="true">V1.3.1 / 25-August-2017</label>
<div>
<h2 id="main-changes-2">Main Changes</h2>
<h2 id="main-changes-3">Main Changes</h2>
<h3 id="patch-release">Patch release</h3>
<h2 id="contents-2">Contents</h2>
<h2 id="contents-3">Contents</h2>
<ul>
<li><strong>HAL/LL</strong> generic
<ul>
Expand All @@ -545,9 +565,9 @@ <h2 id="contents-2">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true">V1.3.0 / 21-April-2017</label>
<div>
<h2 id="main-changes-3">Main Changes</h2>
<h3 id="maintenance-release-2">Maintenance release</h3>
<h2 id="contents-3">Contents</h2>
<h2 id="main-changes-4">Main Changes</h2>
<h3 id="maintenance-release-3">Maintenance release</h3>
<h2 id="contents-4">Contents</h2>
<ul>
<li><strong>HAL/LL</strong> generic
<ul>
Expand Down Expand Up @@ -618,8 +638,8 @@ <h2 id="contents-3">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V1.2.0 / 01-July-2016</label>
<div>
<h2 id="main-changes-4">Main Changes</h2>
<h3 id="maintenance-release-3">Maintenance release</h3>
<h2 id="main-changes-5">Main Changes</h2>
<h3 id="maintenance-release-4">Maintenance release</h3>
<ul>
<li>First official release supporting the <strong>Low Level</strong> drivers for the <strong>STM32L1xx</strong> family:
<ul>
Expand All @@ -628,7 +648,7 @@ <h3 id="maintenance-release-3">Maintenance release</h3>
<li>Low Layer drivers APIs are implemented as static inline function in new Inc/stm32l1xx_ll_ppp.h files for PPP peripherals, there is no configuration file and each stm32l1xx_ll_ppp.h file must be included in user code.</li>
</ul></li>
</ul>
<h2 id="contents-4">Contents</h2>
<h2 id="contents-5">Contents</h2>
<ul>
<li><strong>Generic updates</strong>
<ul>
Expand Down Expand Up @@ -723,9 +743,9 @@ <h2 id="contents-4">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V1.1.3 / 04-March-2016</label>
<div>
<h2 id="main-changes-5">Main Changes</h2>
<h3 id="maintenance-release-4">Maintenance release</h3>
<h2 id="contents-5">Contents</h2>
<h2 id="main-changes-6">Main Changes</h2>
<h3 id="maintenance-release-5">Maintenance release</h3>
<h2 id="contents-6">Contents</h2>
<ul>
<li><strong>Generic update</strong>
<ul>
Expand Down Expand Up @@ -774,9 +794,9 @@ <h2 id="contents-5">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V1.1.2 / 09-October-2015</label>
<div>
<h2 id="main-changes-6">Main Changes</h2>
<h3 id="maintenance-release-5">Maintenance release</h3>
<h2 id="contents-6">Contents</h2>
<h2 id="main-changes-7">Main Changes</h2>
<h3 id="maintenance-release-6">Maintenance release</h3>
<h2 id="contents-7">Contents</h2>
<ul>
<li><strong>ADC</strong>
<ul>
Expand Down Expand Up @@ -860,13 +880,13 @@ <h2 id="contents-6">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 31-March-2015</label>
<div>
<h2 id="main-changes-7">Main Changes</h2>
<h3 id="maintenance-release-6">Maintenance release</h3>
<h2 id="main-changes-8">Main Changes</h2>
<h3 id="maintenance-release-7">Maintenance release</h3>
<ul>
<li>Include path changes for compilation under Unix environment</li>
<li>Update drivers to be C++ compliant</li>
</ul>
<h2 id="contents-7">Contents</h2>
<h2 id="contents-8">Contents</h2>
<ul>
<li><strong>CORTEX</strong>
<ul>
Expand Down Expand Up @@ -932,12 +952,12 @@ <h2 id="contents-7">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 06-February-2015</label>
<div>
<h2 id="main-changes-8">Main Changes</h2>
<h3 id="maintenance-release-7">Maintenance release</h3>
<h2 id="main-changes-9">Main Changes</h2>
<h3 id="maintenance-release-8">Maintenance release</h3>
<ul>
<li>Add support of new <strong>STM32L1 eXtended devices</strong> - <strong>STM32l151xDX, STM32l152xDX &amp; STM32l62xDX</strong></li>
</ul>
<h2 id="contents-8">Contents</h2>
<h2 id="contents-9">Contents</h2>
<ul>
<li><strong>HAL</strong> generic
<ul>
Expand All @@ -959,7 +979,7 @@ <h2 id="contents-8">Contents</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 05-September-2014</label>
<div>
<h2 id="main-changes-9">Main Changes</h2>
<h2 id="main-changes-10">Main Changes</h2>
<h3 id="first-official-release">First official release</h3>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions system/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
*/

/**
* @brief STM32L1xx HAL Driver version number V1.4.1
* @brief STM32L1xx HAL Driver version number V1.4.2
*/
#define __STM32L1xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
#define __STM32L1xx_HAL_VERSION_SUB1 (0x04) /*!< [23:16] sub1 version */
#define __STM32L1xx_HAL_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
#define __STM32L1xx_HAL_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
#define __STM32L1xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32L1xx_HAL_VERSION ((__STM32L1xx_HAL_VERSION_MAIN << 24)\
|(__STM32L1xx_HAL_VERSION_SUB1 << 16)\
Expand Down
96 changes: 76 additions & 20 deletions system/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@
*/
#define I2C_TIMEOUT_FLAG 35U /*!< Timeout 35 ms */
#define I2C_TIMEOUT_BUSY_FLAG 25U /*!< Timeout 25 ms */
#define I2C_TIMEOUT_STOP_FLAG 5U /*!< Timeout 5 ms */
#define I2C_NO_OPTION_FRAME 0xFFFF0000U /*!< XferOptions default value */

/* Private define for @ref PreviousState usage */
Expand Down Expand Up @@ -359,6 +360,7 @@ static HAL_StatusTypeDef I2C_WaitOnTXEFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
static HAL_StatusTypeDef I2C_WaitOnBTFFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
static HAL_StatusTypeDef I2C_WaitOnSTOPRequestThroughIT(I2C_HandleTypeDef *hi2c);
static HAL_StatusTypeDef I2C_IsAcknowledgeFailed(I2C_HandleTypeDef *hi2c);

/* Private functions for I2C transfer IRQ handler */
Expand Down Expand Up @@ -5341,43 +5343,70 @@ static void I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c)
}
else if ((hi2c->XferOptions != I2C_FIRST_AND_NEXT_FRAME) && ((tmp == 1U) || (tmp == 0U)))
{
/* Disable Acknowledge */
CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);
if (I2C_WaitOnSTOPRequestThroughIT(hi2c) == HAL_OK)
{
/* Disable Acknowledge */
CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);

/* Disable EVT, BUF and ERR interrupt */
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);
/* Disable EVT, BUF and ERR interrupt */
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);

/* Read data from DR */
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;
/* Read data from DR */
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;

/* Increment Buffer pointer */
hi2c->pBuffPtr++;
/* Increment Buffer pointer */
hi2c->pBuffPtr++;

/* Update counter */
hi2c->XferCount--;
/* Update counter */
hi2c->XferCount--;

hi2c->State = HAL_I2C_STATE_READY;
hi2c->State = HAL_I2C_STATE_READY;

if (hi2c->Mode == HAL_I2C_MODE_MEM)
{
hi2c->Mode = HAL_I2C_MODE_NONE;
hi2c->PreviousState = I2C_STATE_NONE;
if (hi2c->Mode == HAL_I2C_MODE_MEM)
{
hi2c->Mode = HAL_I2C_MODE_NONE;
hi2c->PreviousState = I2C_STATE_NONE;

#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
hi2c->MemRxCpltCallback(hi2c);
hi2c->MemRxCpltCallback(hi2c);
#else
HAL_I2C_MemRxCpltCallback(hi2c);
HAL_I2C_MemRxCpltCallback(hi2c);
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
}
else
{
hi2c->Mode = HAL_I2C_MODE_NONE;
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX;

#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
hi2c->MasterRxCpltCallback(hi2c);
#else
HAL_I2C_MasterRxCpltCallback(hi2c);
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
}
}
else
{
/* Disable EVT, BUF and ERR interrupt */
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);

/* Read data from DR */
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;

/* Increment Buffer pointer */
hi2c->pBuffPtr++;

/* Update counter */
hi2c->XferCount--;

hi2c->State = HAL_I2C_STATE_READY;
hi2c->Mode = HAL_I2C_MODE_NONE;
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX;

/* Call user error callback */
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
hi2c->MasterRxCpltCallback(hi2c);
hi2c->ErrorCallback(hi2c);
#else
HAL_I2C_MasterRxCpltCallback(hi2c);
HAL_I2C_ErrorCallback(hi2c);
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
}
}
Expand Down Expand Up @@ -7147,6 +7176,33 @@ static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
return HAL_OK;
}

/**
* @brief This function handles I2C Communication Timeout for specific usage of STOP request through Interrupt.
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
* the configuration information for the specified I2C.
* @retval HAL status
*/
static HAL_StatusTypeDef I2C_WaitOnSTOPRequestThroughIT(I2C_HandleTypeDef *hi2c)
{
__IO uint32_t count = 0U;

/* Wait until STOP flag is reset */
count = I2C_TIMEOUT_STOP_FLAG * (SystemCoreClock / 25U / 1000U);
do
{
count--;
if (count == 0U)
{
hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT;

return HAL_ERROR;
}
}
while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP);

return HAL_OK;
}

/**
* @brief This function handles I2C Communication Timeout for specific usage of RXNE flag.
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
Expand Down
2 changes: 1 addition & 1 deletion system/Drivers/STM32YYxx_HAL_Driver_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* STM32G4: 1.2.0
* STM32H7: 1.9.0
* STM32L0: 1.10.3
* STM32L1: 1.4.1
* STM32L1: 1.4.2
* STM32L4: 1.12.0
* STM32MP1: 1.2.0
* STM32WB: 1.6.0
Expand Down