I2C4 undefined stm_rxxh for STM32L4xx Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
lau
Posts: 4
Joined: Tue Sep 25, 2018 3:10 am
Been thanked: 1 time

I2C4 undefined stm_rxxh for STM32L4xx

Post by lau »

hi Sir,

i am using I2C4 due to DMA clash of I2C2 with my SPI2.

When I switch to I2C4 , the compiler complain that the rccResetI2C4 and rccEnableI2C4 is missing.
I check the library file and found that only I2C1 to I2C3 are defined but not I2C4.

KIndly advise it is intentional of there is specific reason to omit I2C4.

Best Regards
Lau
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: I2C4 undefined stm_rxxh for STM32L4xx

Post by Giovanni »

Moving in "bug reports".

Giovanni
lau
Posts: 4
Joined: Tue Sep 25, 2018 3:10 am
Been thanked: 1 time

Re: I2C4 undefined stm_rxxh for STM32L4xx

Post by lau »

Some update :

I added in the three line of macro in STM32/STM32L4xx/stm32_rcc.h files.
It work fine now. I read the datasheet , it mention that this feature is only availabe in STM32L496xx/4A6xx devices , this may explain why does not appear in the stm32_rcc.h file as it is suppose to be generic , and this feature is only for "specific" series.

in any case , we should update it or protect it with some preprocessor define.

just my 2 cent of thoughts.

/**
* @brief Enables the I2C4 peripheral clock.
*
* @param[in] lp low power enable flag
*
* @api
*/

#define rccEnableI2C4(lp) rccEnableAPB1R2(RCC_APB1ENR2_I2C4EN, lp)

/**
* @brief Disables the I2C4 peripheral clock.
*
* @api
*/
+#define rccDisableI2C4() rccDisableAPB1R1(RCC_APB1ENR2_I2C4EN)

/**
* @brief Resets the I2C4 peripheral.
*
* @api
*/
#define rccResetI2C4() rccResetAPB1R1(RCC_APB1RSTR2_I2C4RST)
/** @} */
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: I2C4 undefined stm_rxxh for STM32L4xx

Post by Giovanni »

Hi,

Fixed as bug #1036.

Giovanni
Post Reply