From e318dd27dbc386757c6c1648ee68a961bb6305f4 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sun, 3 Feb 2019 11:25:22 +0000 Subject: [PATCH 1/5] Fixed Bux #1006 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_18.2.x@12635 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/ex/ST/hts221.c | 14 ++++---------- os/ex/ST/hts221.h | 4 ++-- readme.txt | 2 ++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/os/ex/ST/hts221.c b/os/ex/ST/hts221.c index 59a0209260..92b518259b 100644 --- a/os/ex/ST/hts221.c +++ b/os/ex/ST/hts221.c @@ -114,19 +114,10 @@ static msg_t hts221Calibrate(HTS221Driver *devp) { uint8_t calib[16], H0_rH_x2, H1_rH_x2, msb; int16_t H0_T0_OUT, H1_T0_OUT, T0_degC_x8, T1_degC_x8, T0_OUT, T1_OUT; -#if HTS221_SHARED_I2C - i2cAcquireBus(devp->config->i2cp); - i2cStart(devp->config->i2cp, devp->config->i2ccfg); -#endif /* HTS221_SHARED_I2C */ - /* Retrieving rH values from Calibration registers */ msg = hts221I2CReadRegister(devp->config->i2cp, HTS221_AD_CALIB_0, calib, 16); -#if HTS221_SHARED_I2C - i2cReleaseBus(devp->config->i2cp); -#endif /* HTS221_SHARED_I2C */ - H0_rH_x2 = calib[0]; H1_rH_x2 = calib[1]; H0_T0_OUT = calib[6]; @@ -666,13 +657,16 @@ void hts221Start(HTS221Driver *devp, const HTS221Config *config) { i2cAcquireBus(devp->config->i2cp); #endif /* HTS221_SHARED_I2C */ + /* Intializing the I2C. */ i2cStart(devp->config->i2cp, devp->config->i2ccfg); + hts221Calibrate(devp); #if HTS221_SHARED_I2C - i2cReleaseBus(devp->config->i2cp); + i2cReleaseBus(devp->config->i2cp); #endif /* HTS221_SHARED_I2C */ + if(devp->config->hygrosensitivity == NULL) { devp->hygrosensitivity = devp->hygrofactorysensitivity; } diff --git a/os/ex/ST/hts221.h b/os/ex/ST/hts221.h index da2fa2d1d2..37e88a2a00 100644 --- a/os/ex/ST/hts221.h +++ b/os/ex/ST/hts221.h @@ -44,7 +44,7 @@ /** * @brief HTS221 driver version string. */ -#define EX_HTS221_VERSION "1.1.1" +#define EX_HTS221_VERSION "1.1.2" /** * @brief HTS221 driver version major number. @@ -59,7 +59,7 @@ /** * @brief HTS221 driver version patch number. */ -#define EX_HTS221_PATCH 1 +#define EX_HTS221_PATCH 2 /** @} */ /** diff --git a/readme.txt b/readme.txt index d3ac1983d0..466ed829df 100644 --- a/readme.txt +++ b/readme.txt @@ -95,6 +95,8 @@ - NEW: Added new functions to objects fifos: chFifoReturnObjectS(), chFifoSendObjectAheadI(), chFifoSendObjectAheadS() and chFifoSendObjectAhead(). +- EX: Fixed I2C Acquire bus called twice in the HTS221 initialization + (bug #1006) - HAL: Fixed invalid checks in STM32H7 HAL (bug #1000). - OTH: Fixed problem in STM32H743 GCC linker file (bug #998). - HAL: Fixed extra parenthesis in STM32F4 registry (bug #997). From 28f7490a0a6f524d7e9c52be1cba9fa2927d9d3e Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sun, 3 Feb 2019 11:39:13 +0000 Subject: [PATCH 2/5] Fixed Bux #1008 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_18.2.x@12636 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- readme.txt | 2 + testex/STM32/STM32F4xx/SPI-LIS302DL/mcuconf.h | 40 +++++++++---------- testex/STM32/STM32F4xx/SPI-LIS3DSH/mcuconf.h | 40 +++++++++---------- 3 files changed, 40 insertions(+), 42 deletions(-) diff --git a/readme.txt b/readme.txt index 466ed829df..5956575fb1 100644 --- a/readme.txt +++ b/readme.txt @@ -95,6 +95,8 @@ - NEW: Added new functions to objects fifos: chFifoReturnObjectS(), chFifoSendObjectAheadI(), chFifoSendObjectAheadS() and chFifoSendObjectAhead(). +- FIX: Fixed wrong mcuconf.h in some testex demos related to STM32F407 + (bug #1008). - EX: Fixed I2C Acquire bus called twice in the HTS221 initialization (bug #1006) - HAL: Fixed invalid checks in STM32H7 HAL (bug #1000). diff --git a/testex/STM32/STM32F4xx/SPI-LIS302DL/mcuconf.h b/testex/STM32/STM32F4xx/SPI-LIS302DL/mcuconf.h index 6797acebea..acf7aab930 100644 --- a/testex/STM32/STM32F4xx/SPI-LIS302DL/mcuconf.h +++ b/testex/STM32/STM32F4xx/SPI-LIS302DL/mcuconf.h @@ -64,6 +64,24 @@ #define STM32_PLS STM32_PLS_LEV0 #define STM32_BKPRAM_ENABLE FALSE +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI16_PRIORITY 6 +#define STM32_IRQ_EXTI17_PRIORITY 15 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_PRIORITY 6 +#define STM32_IRQ_EXTI21_PRIORITY 15 +#define STM32_IRQ_EXTI22_PRIORITY 15 + /* * ADC driver system settings. */ @@ -103,24 +121,6 @@ #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI22_IRQ_PRIORITY 15 - /* * GPT driver system settings. */ @@ -264,8 +264,8 @@ * SPI driver system settings. */ #define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 TRUE -#define STM32_SPI_USE_SPI3 TRUE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) diff --git a/testex/STM32/STM32F4xx/SPI-LIS3DSH/mcuconf.h b/testex/STM32/STM32F4xx/SPI-LIS3DSH/mcuconf.h index dfa1c368a7..acf7aab930 100644 --- a/testex/STM32/STM32F4xx/SPI-LIS3DSH/mcuconf.h +++ b/testex/STM32/STM32F4xx/SPI-LIS3DSH/mcuconf.h @@ -44,11 +44,7 @@ #define STM32_CLOCK48_REQUIRED TRUE #define STM32_SW STM32_SW_PLL #define STM32_PLLSRC STM32_PLLSRC_HSE -#if defined(BOARD_ST_STM32F4_DISCOVERY) #define STM32_PLLM_VALUE 8 -#else -#define STM32_PLLM_VALUE 12 -#endif #define STM32_PLLN_VALUE 336 #define STM32_PLLP_VALUE 2 #define STM32_PLLQ_VALUE 7 @@ -68,6 +64,24 @@ #define STM32_PLS STM32_PLS_LEV0 #define STM32_BKPRAM_ENABLE FALSE +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI16_PRIORITY 6 +#define STM32_IRQ_EXTI17_PRIORITY 15 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_PRIORITY 6 +#define STM32_IRQ_EXTI21_PRIORITY 15 +#define STM32_IRQ_EXTI22_PRIORITY 15 + /* * ADC driver system settings. */ @@ -107,24 +121,6 @@ #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI22_IRQ_PRIORITY 15 - /* * GPT driver system settings. */ From 9077888f8d946c0eceee36e2bd94c941f0ed7307 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 9 Feb 2019 08:23:07 +0000 Subject: [PATCH 3/5] Fixed bug #1011. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_18.2.x@12650 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/nil/include/ch.h | 2 +- readme.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/os/nil/include/ch.h b/os/nil/include/ch.h index 3cd33324cf..a84cb6ec09 100644 --- a/os/nil/include/ch.h +++ b/os/nil/include/ch.h @@ -424,7 +424,7 @@ #if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \ (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \ - (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) + (CH_LICENSE_FEATURES != CH_FEATURES_BASIC) #error "invalid CH_LICENSE_FEATURES setting" #endif diff --git a/readme.txt b/readme.txt index 5956575fb1..be2f934748 100644 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,9 @@ *** Releases and Change Log *** ***************************************************************************** +*** 18.2.3 *** +- FIX: Fixed wrong license restriction check in Nil (bug #1011). + *** 18.2.2 *** - NEW: Added analog watchdog functionality to STM32 ADCv2 driver. - NEW: Added a termination check to the shell. From 5b8695ccbd8388b7ac880d57fb1fdbc9a0d4c6ca Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 10 Feb 2019 17:34:43 +0000 Subject: [PATCH 4/5] Missing initialization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_18.2.x@12657 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- demos/STM32/RT-STM32F303-DISCOVERY/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demos/STM32/RT-STM32F303-DISCOVERY/main.c b/demos/STM32/RT-STM32F303-DISCOVERY/main.c index 1231cd2750..e3f2517890 100644 --- a/demos/STM32/RT-STM32F303-DISCOVERY/main.c +++ b/demos/STM32/RT-STM32F303-DISCOVERY/main.c @@ -81,6 +81,8 @@ int main(void) { * Activates the serial driver 1 using the driver default configuration. */ sdStart(&SD1, NULL); + palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7)); /* USART1 TX. */ + palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7)); /* USART1 RX. */ /* * Creates the example threads. From 0b5e6bb0e06cd8665f375b1e372e31d312fa9fb6 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 16 Mar 2019 16:17:28 +0000 Subject: [PATCH 5/5] Fixed bug #1021. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_18.2.x@12700 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/common/oslib/include/chfifo.h | 2 +- os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c | 2 +- os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c | 36 ++++++++++ os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h | 78 ++++++++-------------- os/hal/ports/STM32/STM32H7xx/hal_lld.c | 2 +- os/hal/ports/STM32/STM32H7xx/hal_lld.h | 54 +++++++-------- os/rt/include/chtime.h | 36 +--------- readme.txt | 6 ++ 8 files changed, 101 insertions(+), 115 deletions(-) diff --git a/os/common/oslib/include/chfifo.h b/os/common/oslib/include/chfifo.h index 88d2fff8e8..adc1023b63 100644 --- a/os/common/oslib/include/chfifo.h +++ b/os/common/oslib/include/chfifo.h @@ -123,7 +123,7 @@ extern "C" { * @param[in] objalign required objects alignment * @param[in] objbuf pointer to the buffer of objects, it must be able * to hold @p objn objects of @p objsize size with - * @p objealign alignment + * @p objalign alignment * @param[in] msgbuf pointer to the buffer of messages, it must be able * to hold @p objn messages * diff --git a/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c b/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c index c0bf010f51..f7a41552ab 100644 --- a/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c +++ b/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c @@ -488,7 +488,7 @@ void adc_lld_init(void) { #if defined(ADC3_4_COMMON) ADCD3.adcc = ADC3_4_COMMON; #elif defined(ADC123_COMMON) - ADCD1.adcc = ADC123_COMMON; + ADCD3.adcc = ADC123_COMMON; #else ADCD3.adcc = ADC3_COMMON; #endif diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c index d18bbdc818..b58d6ff417 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c +++ b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c @@ -39,6 +39,12 @@ #endif #if STM32_ST_USE_TIMER == 2 +#if !STM32_HAS_TIM2 +#error "TIM2 not present in the selected device" +#endif +#if defined(STM32_TIM2_IS_USED) +#error "ST requires TIM2 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM2_IS_32BITS #error "TIM2 is not a 32bits timer" #endif @@ -58,6 +64,12 @@ #endif #elif STM32_ST_USE_TIMER == 3 +#if !STM32_HAS_TIM3 +#error "TIM3 not present in the selected device" +#endif +#if defined(STM32_TIM3_IS_USED) +#error "ST requires TIM3 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM3_IS_32BITS #error "TIM3 is not a 32bits timer" #endif @@ -77,6 +89,12 @@ #endif #elif STM32_ST_USE_TIMER == 4 +#if !STM32_HAS_TIM4 +#error "TIM4 not present in the selected device" +#endif +#if defined(STM32_TIM4_IS_USED) +#error "ST requires TIM4 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM4_IS_32BITS #error "TIM4 is not a 32bits timer" #endif @@ -96,6 +114,12 @@ #endif #elif STM32_ST_USE_TIMER == 5 +#if !STM32_HAS_TIM5 +#error "TIM5 not present in the selected device" +#endif +#if defined(STM32_TIM5_IS_USED) +#error "ST requires TIM5 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM5_IS_32BITS #error "TIM5 is not a 32bits timer" #endif @@ -115,6 +139,12 @@ #endif #elif STM32_ST_USE_TIMER == 21 +#if !STM32_HAS_TIM21 +#error "TIM21 not present in the selected device" +#endif +#if defined(STM32_TIM21_IS_USED) +#error "ST requires TIM21 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM21_IS_32BITS #error "TIM21 is not a 32bits timer" #endif @@ -126,6 +156,12 @@ #define ST_ENABLE_STOP() DBGMCU->APB1FZ |= DBGMCU_APB2_FZ_DBG_TIM21_STOP #elif STM32_ST_USE_TIMER == 22 +#if !STM32_HAS_TIM22 +#error "TIM22 not present in the selected device" +#endif +#if defined(STM32_TIM22_IS_USED) +#error "ST requires TIM22 but the timer is already used" +#endif #if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM22_IS_32BITS #error "TIM21 is not a 32bits timer" #endif diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h index f401fb0fca..c2828bb1cf 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h +++ b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h @@ -65,71 +65,47 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -#if STM32_ST_USE_TIMER == 2 -#if !STM32_HAS_TIM2 -#error "TIM2 not present in the selected device" +#if !defined(STM32_HAS_TIM2) +#define STM32_HAS_TIM2 FALSE #endif -#if defined(STM32_TIM2_IS_USED) -#error "ST requires TIM2 but the timer is already used" -#else -#define STM32_TIM2_IS_USED + +#if !defined(STM32_HAS_TIM3) +#define STM32_HAS_TIM3 FALSE #endif -#define STM32_ST_TIM STM32_TIM2 -#elif STM32_ST_USE_TIMER == 3 -#if !STM32_HAS_TIM3 -#error "TIM3 not present in the selected device" +#if !defined(STM32_HAS_TIM4) +#define STM32_HAS_TIM4 FALSE #endif -#if defined(STM32_TIM3_IS_USED) -#error "ST requires TIM3 but the timer is already used" -#else -#define STM32_TIM3_IS_USED + +#if !defined(STM32_HAS_TIM5) +#define STM32_HAS_TIM5 FALSE #endif -#define STM32_ST_TIM STM32_TIM3 -#elif STM32_ST_USE_TIMER == 4 -#if !STM32_HAS_TIM4 -#error "TIM4 not present in the selected device" +#if !defined(STM32_HAS_TIM21) +#define STM32_HAS_TIM21 FALSE #endif -#if defined(STM32_TIM4_IS_USED) -#error "ST requires TIM4 but the timer is already used" -#else -#define STM32_TIM4_IS_USED + +#if !defined(STM32_HAS_TIM22) +#define STM32_HAS_TIM22 FALSE #endif -#define STM32_ST_TIM STM32_TIM4 + +#if STM32_ST_USE_TIMER == 2 +#define STM32_ST_TIM STM32_TIM2 + +#elif STM32_ST_USE_TIMER == 3 +#define STM32_ST_TIM STM32_TIM3 + +#elif STM32_ST_USE_TIMER == 4 +#define STM32_ST_TIM STM32_TIM4 #elif STM32_ST_USE_TIMER == 5 -#if !STM32_HAS_TIM5 -#error "TIM5 not present in the selected device" -#endif -#if defined(STM32_TIM5_IS_USED) -#error "ST requires TIM5 but the timer is already used" -#else -#define STM32_TIM5_IS_USED -#endif -#define STM32_ST_TIM STM32_TIM5 +#define STM32_ST_TIM STM32_TIM5 #elif STM32_ST_USE_TIMER == 21 -#if !STM32_HAS_TIM21 -#error "TIM21 not present in the selected device" -#endif -#if defined(STM32_TIM21_IS_USED) -#error "ST requires TIM21 but the timer is already used" -#else -#define STM32_TIM21_IS_USED -#endif -#define STM32_ST_TIM STM32_TIM21 +#define STM32_ST_TIM STM32_TIM21 #elif STM32_ST_USE_TIMER == 22 -#if !STM32_HAS_TIM22 -#error "TIM22 not present in the selected device" -#endif -#if defined(STM32_TIM22_IS_USED) -#error "ST requires TIM22 but the timer is already used" -#else -#define STM32_TIM22_IS_USED -#endif -#define STM32_ST_TIM STM32_TIM22 +#define STM32_ST_TIM STM32_TIM22 #else #error "STM32_ST_USE_TIMER specifies an unsupported timer" diff --git a/os/hal/ports/STM32/STM32H7xx/hal_lld.c b/os/hal/ports/STM32/STM32H7xx/hal_lld.c index bb79a429bd..2855fcec18 100644 --- a/os/hal/ports/STM32/STM32H7xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32H7xx/hal_lld.c @@ -206,7 +206,7 @@ void stm32_clock_init(void) { /* Fix for errata 2.2.15: Reading from AXI SRAM might lead to data read corruption. AXI->TARG7_FN_MOD.*/ - *((volatile uint32_t *)0x51000000 + 0x1108 + 0x7000) = 0x00000001U; + *((volatile uint32_t *)(0x51000000 + 0x1108 + 0x7000)) = 0x00000001U; #endif /* PWR initialization.*/ diff --git a/os/hal/ports/STM32/STM32H7xx/hal_lld.h b/os/hal/ports/STM32/STM32H7xx/hal_lld.h index 8e853680af..c582df182d 100644 --- a/os/hal/ports/STM32/STM32H7xx/hal_lld.h +++ b/os/hal/ports/STM32/STM32H7xx/hal_lld.h @@ -494,9 +494,9 @@ #define STM32_SAI4ASEL_PER_CK RCC_D3CCIPR_SAI4ASEL_VALUE(4U) #define STM32_ADCSEL_PLL2_P_CK RCC_D3CCIPR_ADCSEL_VALUE(0U) -#define STM32_ADCSEL_PLL3_R_CK RCC_D3CCIPR_ADCSEL_VALUE(0U) -#define STM32_ADCSEL_PER_CK RCC_D3CCIPR_ADCSEL_VALUE(0U) -#define STM32_ADCSEL_DISABLE RCC_D3CCIPR_ADCSEL_VALUE(0U) +#define STM32_ADCSEL_PLL3_R_CK RCC_D3CCIPR_ADCSEL_VALUE(1U) +#define STM32_ADCSEL_PER_CK RCC_D3CCIPR_ADCSEL_VALUE(2U) +#define STM32_ADCSEL_DISABLE RCC_D3CCIPR_ADCSEL_VALUE(3U) #define STM32_LPTIM345SEL_PCLK4 RCC_D3CCIPR_LPTIM345SEL_VALUE(0U) #define STM32_LPTIM345SEL_PLL2_P_CK RCC_D3CCIPR_LPTIM345SEL_VALUE(1U) @@ -2427,58 +2427,58 @@ /** * @brief USART4 clock. */ -#define STM32_USART4CLK STM32_PCLK1 +#define STM32_UART4CLK STM32_PCLK1 /** * @brief USART5 clock. */ -#define STM32_USART5CLK STM32_PCLK1 +#define STM32_UART5CLK STM32_PCLK1 /** * @brief USART7 clock. */ -#define STM32_USART7CLK STM32_PCLK1 +#define STM32_UART7CLK STM32_PCLK1 /** * @brief USART8 clock. */ -#define STM32_USART8CLK STM32_PCLK2 +#define STM32_UART8CLK STM32_PCLK1 #elif STM32_USART234578SEL == STM32_USART234578SEL_PLL2_Q_CK #define STM32_USART2CLK STM32_PLL2_Q_CK #define STM32_USART3CLK STM32_PLL2_Q_CK -#define STM32_USART4CLK STM32_PLL2_Q_CK -#define STM32_USART5CLK STM32_PLL2_Q_CK -#define STM32_USART7CLK STM32_PLL2_Q_CK -#define STM32_USART8CLK STM32_PLL2_Q_CK +#define STM32_UART4CLK STM32_PLL2_Q_CK +#define STM32_UART5CLK STM32_PLL2_Q_CK +#define STM32_UART7CLK STM32_PLL2_Q_CK +#define STM32_UART8CLK STM32_PLL2_Q_CK #elif STM32_USART234578SEL == STM32_USART234578SEL_PLL3_Q_CK #define STM32_USART2CLK STM32_PLL3_Q_CK #define STM32_USART3CLK STM32_PLL3_Q_CK -#define STM32_USART4CLK STM32_PLL3_Q_CK -#define STM32_USART5CLK STM32_PLL3_Q_CK -#define STM32_USART7CLK STM32_PLL3_Q_CK -#define STM32_USART8CLK STM32_PLL3_Q_CK +#define STM32_UART4CLK STM32_PLL3_Q_CK +#define STM32_UART5CLK STM32_PLL3_Q_CK +#define STM32_UART7CLK STM32_PLL3_Q_CK +#define STM32_UART8CLK STM32_PLL3_Q_CK #elif STM32_USART234578SEL == STM32_USART234578SEL_HSI_KER_CK #define STM32_USART2CLK STM32_HSI_CK #define STM32_USART3CLK STM32_HSI_CK -#define STM32_USART4CLK STM32_HSI_CK -#define STM32_USART5CLK STM32_HSI_CK -#define STM32_USART7CLK STM32_HSI_CK -#define STM32_USART8CLK STM32_HSI_CK +#define STM32_UART4CLK STM32_HSI_CK +#define STM32_UART5CLK STM32_HSI_CK +#define STM32_UART7CLK STM32_HSI_CK +#define STM32_UART8CLK STM32_HSI_CK #elif STM32_USART234578SEL == STM32_USART234578SEL_CSI_KER_CK #define STM32_USART2CLK STM32_CSI_CK #define STM32_USART3CLK STM32_CSI_CK -#define STM32_USART4CLK STM32_CSI_CK -#define STM32_USART5CLK STM32_CSI_CK -#define STM32_USART7CLK STM32_CSI_CK -#define STM32_USART8CLK STM32_CSI_CK +#define STM32_UART4CLK STM32_CSI_CK +#define STM32_UART5CLK STM32_CSI_CK +#define STM32_UART7CLK STM32_CSI_CK +#define STM32_UART8CLK STM32_CSI_CK #elif STM32_USART234578SEL == STM32_USART234578SEL_LSE_CK #define STM32_USART2CLK STM32_LSE_CK #define STM32_USART3CLK STM32_LSE_CK -#define STM32_USART4CLK STM32_LSE_CK -#define STM32_USART6CLK STM32_LSE_CK -#define STM32_USART7CLK STM32_LSE_CK -#define STM32_USART8CLK STM32_LSE_CK +#define STM32_UART4CLK STM32_LSE_CK +#define STM32_UART6CLK STM32_LSE_CK +#define STM32_UART7CLK STM32_LSE_CK +#define STM32_UART8CLK STM32_LSE_CK #else #error "invalid source selected for STM32_USART234578SEL clock" #endif diff --git a/os/rt/include/chtime.h b/os/rt/include/chtime.h index c975d104b4..b5ae93afde 100644 --- a/os/rt/include/chtime.h +++ b/os/rt/include/chtime.h @@ -67,39 +67,6 @@ /* Module pre-compile time settings. */ /*===========================================================================*/ -/** - * @brief System time counter resolution. - * @note Allowed values are 16, 32 or 64 bits. - */ -#if !defined(CH_CFG_ST_RESOLUTION) || defined(__DOXYGEN__) -#define CH_CFG_ST_RESOLUTION 32 -#endif - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#if !defined(CH_CFG_ST_FREQUENCY) || defined(__DOXYGEN__) -#define CH_CFG_ST_FREQUENCY 1000 -#endif - -/** - * @brief Time intervals data size. - * @note Allowed values are 16, 32 or 64 bits. - */ -#if !defined(CH_CFG_INTERVALS_SIZE) || defined(__DOXYGEN__) -#define CH_CFG_INTERVALS_SIZE 32 -#endif - -/** - * @brief Time types data size. - * @note Allowed values are 16 or 32 bits. - */ -#if !defined(CH_CFG_TIME_TYPES_SIZE) || defined(__DOXYGEN__) -#define CH_CFG_TIME_TYPES_SIZE 32 -#endif - /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ @@ -513,7 +480,8 @@ static inline bool chTimeIsInRangeX(systime_t time, systime_t start, systime_t end) { - return (bool)((time - start) < (end - start)); + return (bool)((systime_t)((systime_t)time - (systime_t)start) < + (systime_t)((systime_t)end - (systime_t)start)); } /** @} */ diff --git a/readme.txt b/readme.txt index be2f934748..110f316f9b 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,12 @@ ***************************************************************************** *** 18.2.3 *** +- NEW: Extra timer checks in STM32 ST driver. +- FIX: Fixed various UART clock naming errors in STM32H7 HAL (bug #1021). +- FIX: Fixed wrong ADCSEL definitions in STM32H7 HAL (bug #1016). +- FIX: Fixed chTimeIsInRangeX() failing under some configurations (bug #1015). +- FIX: Fixed invalid AXI errata fix for STM32H7xx (bug #1014). +- FIX: Fixed invalid ADCD3 initialization in STM32 ADCv3 driver (bug #1013). - FIX: Fixed wrong license restriction check in Nil (bug #1011). *** 18.2.2 ***