Skip to content

Commit e5ac1a4

Browse files
committed
[L1] Update STM32L1xx HAL Drivers to v1.4.2
Included in STM32CubeL1 FW v1.10.1 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent cbccfe4 commit e5ac1a4

File tree

5 files changed

+126
-49
lines changed

5 files changed

+126
-49
lines changed

system/Drivers/STM32L1xx_HAL_Driver/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ HAL Driver L1 | CMSIS Device L1 | CMSIS Core | Was delivered in the full MCU pac
4040
------------- | --------------- | ---------- | -------------------------------------
4141
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)
4242
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)
43+
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)
4344

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

system/Drivers/STM32L1xx_HAL_Driver/Release_Notes.html

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,35 @@ <h1 id="purpose">Purpose</h1>
4646
<div class="col-sm-12 col-lg-8">
4747
<h1 id="update-history">Update History</h1>
4848
<div class="collapse">
49-
<input type="checkbox" id="collapse-section12" checked aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V1.4.1 / 24-June-2020</label>
49+
<input type="checkbox" id="collapse-section13" aria-hidden="true"> <label for="collapse-section13" aria-hidden="true">V1.4.2 / 28-August-2020</label>
5050
<div>
5151
<h2 id="main-changes">Main Changes</h2>
5252
<h3 id="maintenance-release">Maintenance release</h3>
5353
<ul>
54+
<li>Patch release to fix issue in I2C HAL driver</li>
55+
</ul>
56+
<h2 id="contents">Contents</h2>
57+
<ul>
58+
<li><strong>HAL I2C</strong> driver
59+
<ul>
60+
<li>Update I2C_MasterReceiveRXNE() static API to avoid set the STOP bit again after the bit clearing by Hardware during the masking operation.
61+
<ul>
62+
<li>Add new API I2C_WaitOnSTOPRequestThroughIT() to wait for stop bit.</li>
63+
</ul></li>
64+
</ul></li>
65+
</ul>
66+
</div>
67+
</div>
68+
<div class="collapse">
69+
<input type="checkbox" id="collapse-section12" aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V1.4.1 / 24-June-2020</label>
70+
<div>
71+
<h2 id="main-changes-1">Main Changes</h2>
72+
<h3 id="maintenance-release-1">Maintenance release</h3>
73+
<ul>
5474
<li>Add new HAL EXTI driver</li>
5575
<li>General updates to fix known defects and enhancements implementation</li>
5676
</ul>
57-
<h2 id="contents">Contents</h2>
77+
<h2 id="contents-1">Contents</h2>
5878
<ul>
5979
<li><strong>HAL</strong> driver
6080
<ul>
@@ -247,14 +267,14 @@ <h2 id="contents">Contents</h2>
247267
<div class="collapse">
248268
<input type="checkbox" id="collapse-section11" aria-hidden="true"> <label for="collapse-section11" aria-hidden="true">V1.4.0 / 05-April-2019</label>
249269
<div>
250-
<h2 id="main-changes-1">Main Changes</h2>
251-
<h3 id="maintenance-release-1">Maintenance release</h3>
270+
<h2 id="main-changes-2">Main Changes</h2>
271+
<h3 id="maintenance-release-2">Maintenance release</h3>
252272
<ul>
253273
<li>Add support of <strong>HAL callback registration</strong> feature</li>
254274
<li>Add several enhancements implementation</li>
255275
<li>Fix known defects to be aligned with others STM32 series</li>
256276
</ul>
257-
<h2 id="contents-1">Contents</h2>
277+
<h2 id="contents-2">Contents</h2>
258278
<ul>
259279
<li><strong>HAL/LL</strong> generic
260280
<ul>
@@ -530,9 +550,9 @@ <h2 id="contents-1">Contents</h2>
530550
<div class="collapse">
531551
<input type="checkbox" id="collapse-section9" aria-hidden="true"> <label for="collapse-section9" aria-hidden="true">V1.3.1 / 25-August-2017</label>
532552
<div>
533-
<h2 id="main-changes-2">Main Changes</h2>
553+
<h2 id="main-changes-3">Main Changes</h2>
534554
<h3 id="patch-release">Patch release</h3>
535-
<h2 id="contents-2">Contents</h2>
555+
<h2 id="contents-3">Contents</h2>
536556
<ul>
537557
<li><strong>HAL/LL</strong> generic
538558
<ul>
@@ -545,9 +565,9 @@ <h2 id="contents-2">Contents</h2>
545565
<div class="collapse">
546566
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true">V1.3.0 / 21-April-2017</label>
547567
<div>
548-
<h2 id="main-changes-3">Main Changes</h2>
549-
<h3 id="maintenance-release-2">Maintenance release</h3>
550-
<h2 id="contents-3">Contents</h2>
568+
<h2 id="main-changes-4">Main Changes</h2>
569+
<h3 id="maintenance-release-3">Maintenance release</h3>
570+
<h2 id="contents-4">Contents</h2>
551571
<ul>
552572
<li><strong>HAL/LL</strong> generic
553573
<ul>
@@ -618,8 +638,8 @@ <h2 id="contents-3">Contents</h2>
618638
<div class="collapse">
619639
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V1.2.0 / 01-July-2016</label>
620640
<div>
621-
<h2 id="main-changes-4">Main Changes</h2>
622-
<h3 id="maintenance-release-3">Maintenance release</h3>
641+
<h2 id="main-changes-5">Main Changes</h2>
642+
<h3 id="maintenance-release-4">Maintenance release</h3>
623643
<ul>
624644
<li>First official release supporting the <strong>Low Level</strong> drivers for the <strong>STM32L1xx</strong> family:
625645
<ul>
@@ -628,7 +648,7 @@ <h3 id="maintenance-release-3">Maintenance release</h3>
628648
<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>
629649
</ul></li>
630650
</ul>
631-
<h2 id="contents-4">Contents</h2>
651+
<h2 id="contents-5">Contents</h2>
632652
<ul>
633653
<li><strong>Generic updates</strong>
634654
<ul>
@@ -723,9 +743,9 @@ <h2 id="contents-4">Contents</h2>
723743
<div class="collapse">
724744
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V1.1.3 / 04-March-2016</label>
725745
<div>
726-
<h2 id="main-changes-5">Main Changes</h2>
727-
<h3 id="maintenance-release-4">Maintenance release</h3>
728-
<h2 id="contents-5">Contents</h2>
746+
<h2 id="main-changes-6">Main Changes</h2>
747+
<h3 id="maintenance-release-5">Maintenance release</h3>
748+
<h2 id="contents-6">Contents</h2>
729749
<ul>
730750
<li><strong>Generic update</strong>
731751
<ul>
@@ -774,9 +794,9 @@ <h2 id="contents-5">Contents</h2>
774794
<div class="collapse">
775795
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V1.1.2 / 09-October-2015</label>
776796
<div>
777-
<h2 id="main-changes-6">Main Changes</h2>
778-
<h3 id="maintenance-release-5">Maintenance release</h3>
779-
<h2 id="contents-6">Contents</h2>
797+
<h2 id="main-changes-7">Main Changes</h2>
798+
<h3 id="maintenance-release-6">Maintenance release</h3>
799+
<h2 id="contents-7">Contents</h2>
780800
<ul>
781801
<li><strong>ADC</strong>
782802
<ul>
@@ -860,13 +880,13 @@ <h2 id="contents-6">Contents</h2>
860880
<div class="collapse">
861881
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 31-March-2015</label>
862882
<div>
863-
<h2 id="main-changes-7">Main Changes</h2>
864-
<h3 id="maintenance-release-6">Maintenance release</h3>
883+
<h2 id="main-changes-8">Main Changes</h2>
884+
<h3 id="maintenance-release-7">Maintenance release</h3>
865885
<ul>
866886
<li>Include path changes for compilation under Unix environment</li>
867887
<li>Update drivers to be C++ compliant</li>
868888
</ul>
869-
<h2 id="contents-7">Contents</h2>
889+
<h2 id="contents-8">Contents</h2>
870890
<ul>
871891
<li><strong>CORTEX</strong>
872892
<ul>
@@ -932,12 +952,12 @@ <h2 id="contents-7">Contents</h2>
932952
<div class="collapse">
933953
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 06-February-2015</label>
934954
<div>
935-
<h2 id="main-changes-8">Main Changes</h2>
936-
<h3 id="maintenance-release-7">Maintenance release</h3>
955+
<h2 id="main-changes-9">Main Changes</h2>
956+
<h3 id="maintenance-release-8">Maintenance release</h3>
937957
<ul>
938958
<li>Add support of new <strong>STM32L1 eXtended devices</strong> - <strong>STM32l151xDX, STM32l152xDX &amp; STM32l62xDX</strong></li>
939959
</ul>
940-
<h2 id="contents-8">Contents</h2>
960+
<h2 id="contents-9">Contents</h2>
941961
<ul>
942962
<li><strong>HAL</strong> generic
943963
<ul>
@@ -959,7 +979,7 @@ <h2 id="contents-8">Contents</h2>
959979
<div class="collapse">
960980
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 05-September-2014</label>
961981
<div>
962-
<h2 id="main-changes-9">Main Changes</h2>
982+
<h2 id="main-changes-10">Main Changes</h2>
963983
<h3 id="first-official-release">First official release</h3>
964984
</div>
965985
</div>

system/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
*/
5555

5656
/**
57-
* @brief STM32L1xx HAL Driver version number V1.4.1
57+
* @brief STM32L1xx HAL Driver version number V1.4.2
5858
*/
5959
#define __STM32L1xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
6060
#define __STM32L1xx_HAL_VERSION_SUB1 (0x04) /*!< [23:16] sub1 version */
61-
#define __STM32L1xx_HAL_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
61+
#define __STM32L1xx_HAL_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
6262
#define __STM32L1xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
6363
#define __STM32L1xx_HAL_VERSION ((__STM32L1xx_HAL_VERSION_MAIN << 24)\
6464
|(__STM32L1xx_HAL_VERSION_SUB1 << 16)\

system/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c

Lines changed: 76 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@
319319
*/
320320
#define I2C_TIMEOUT_FLAG 35U /*!< Timeout 35 ms */
321321
#define I2C_TIMEOUT_BUSY_FLAG 25U /*!< Timeout 25 ms */
322+
#define I2C_TIMEOUT_STOP_FLAG 5U /*!< Timeout 5 ms */
322323
#define I2C_NO_OPTION_FRAME 0xFFFF0000U /*!< XferOptions default value */
323324

324325
/* Private define for @ref PreviousState usage */
@@ -359,6 +360,7 @@ static HAL_StatusTypeDef I2C_WaitOnTXEFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
359360
static HAL_StatusTypeDef I2C_WaitOnBTFFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
360361
static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
361362
static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart);
363+
static HAL_StatusTypeDef I2C_WaitOnSTOPRequestThroughIT(I2C_HandleTypeDef *hi2c);
362364
static HAL_StatusTypeDef I2C_IsAcknowledgeFailed(I2C_HandleTypeDef *hi2c);
363365

364366
/* Private functions for I2C transfer IRQ handler */
@@ -5341,43 +5343,70 @@ static void I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c)
53415343
}
53425344
else if ((hi2c->XferOptions != I2C_FIRST_AND_NEXT_FRAME) && ((tmp == 1U) || (tmp == 0U)))
53435345
{
5344-
/* Disable Acknowledge */
5345-
CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);
5346+
if (I2C_WaitOnSTOPRequestThroughIT(hi2c) == HAL_OK)
5347+
{
5348+
/* Disable Acknowledge */
5349+
CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);
53465350

5347-
/* Disable EVT, BUF and ERR interrupt */
5348-
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);
5351+
/* Disable EVT, BUF and ERR interrupt */
5352+
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);
53495353

5350-
/* Read data from DR */
5351-
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;
5354+
/* Read data from DR */
5355+
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;
53525356

5353-
/* Increment Buffer pointer */
5354-
hi2c->pBuffPtr++;
5357+
/* Increment Buffer pointer */
5358+
hi2c->pBuffPtr++;
53555359

5356-
/* Update counter */
5357-
hi2c->XferCount--;
5360+
/* Update counter */
5361+
hi2c->XferCount--;
53585362

5359-
hi2c->State = HAL_I2C_STATE_READY;
5363+
hi2c->State = HAL_I2C_STATE_READY;
53605364

5361-
if (hi2c->Mode == HAL_I2C_MODE_MEM)
5362-
{
5363-
hi2c->Mode = HAL_I2C_MODE_NONE;
5364-
hi2c->PreviousState = I2C_STATE_NONE;
5365+
if (hi2c->Mode == HAL_I2C_MODE_MEM)
5366+
{
5367+
hi2c->Mode = HAL_I2C_MODE_NONE;
5368+
hi2c->PreviousState = I2C_STATE_NONE;
53655369

53665370
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
5367-
hi2c->MemRxCpltCallback(hi2c);
5371+
hi2c->MemRxCpltCallback(hi2c);
53685372
#else
5369-
HAL_I2C_MemRxCpltCallback(hi2c);
5373+
HAL_I2C_MemRxCpltCallback(hi2c);
53705374
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
5375+
}
5376+
else
5377+
{
5378+
hi2c->Mode = HAL_I2C_MODE_NONE;
5379+
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX;
5380+
5381+
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
5382+
hi2c->MasterRxCpltCallback(hi2c);
5383+
#else
5384+
HAL_I2C_MasterRxCpltCallback(hi2c);
5385+
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
5386+
}
53715387
}
53725388
else
53735389
{
5390+
/* Disable EVT, BUF and ERR interrupt */
5391+
__HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR);
5392+
5393+
/* Read data from DR */
5394+
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR;
5395+
5396+
/* Increment Buffer pointer */
5397+
hi2c->pBuffPtr++;
5398+
5399+
/* Update counter */
5400+
hi2c->XferCount--;
5401+
5402+
hi2c->State = HAL_I2C_STATE_READY;
53745403
hi2c->Mode = HAL_I2C_MODE_NONE;
5375-
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX;
53765404

5405+
/* Call user error callback */
53775406
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
5378-
hi2c->MasterRxCpltCallback(hi2c);
5407+
hi2c->ErrorCallback(hi2c);
53795408
#else
5380-
HAL_I2C_MasterRxCpltCallback(hi2c);
5409+
HAL_I2C_ErrorCallback(hi2c);
53815410
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
53825411
}
53835412
}
@@ -7147,6 +7176,33 @@ static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c,
71477176
return HAL_OK;
71487177
}
71497178

7179+
/**
7180+
* @brief This function handles I2C Communication Timeout for specific usage of STOP request through Interrupt.
7181+
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
7182+
* the configuration information for the specified I2C.
7183+
* @retval HAL status
7184+
*/
7185+
static HAL_StatusTypeDef I2C_WaitOnSTOPRequestThroughIT(I2C_HandleTypeDef *hi2c)
7186+
{
7187+
__IO uint32_t count = 0U;
7188+
7189+
/* Wait until STOP flag is reset */
7190+
count = I2C_TIMEOUT_STOP_FLAG * (SystemCoreClock / 25U / 1000U);
7191+
do
7192+
{
7193+
count--;
7194+
if (count == 0U)
7195+
{
7196+
hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT;
7197+
7198+
return HAL_ERROR;
7199+
}
7200+
}
7201+
while (READ_BIT(hi2c->Instance->CR1, I2C_CR1_STOP) == I2C_CR1_STOP);
7202+
7203+
return HAL_OK;
7204+
}
7205+
71507206
/**
71517207
* @brief This function handles I2C Communication Timeout for specific usage of RXNE flag.
71527208
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains

system/Drivers/STM32YYxx_HAL_Driver_version.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* STM32G4: 1.2.0
1111
* STM32H7: 1.9.0
1212
* STM32L0: 1.10.3
13-
* STM32L1: 1.4.1
13+
* STM32L1: 1.4.2
1414
* STM32L4: 1.12.0
1515
* STM32MP1: 1.2.0
1616
* STM32WB: 1.6.0

0 commit comments

Comments
 (0)