2018-12-19 10:30 PM
Hi,
I am using version 1.9.0 of the STM32F0 package in cube.
I have chosen DMA1CH4 for USART1TX and the following line was autogenerated as expected:
LL_SYSCFG_SetRemapDMA_USART(LL_SYSCFG_USART1TX_RMP_DMA1CH4);
However, the following line is missing:
LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_SYSCFG);
My code is heavily amended, so there is a small chance I have inadvertently removed the line - I am fairly certain though that this is a bug. If so, please fix it?
Kind regards,
Lloyd
2018-12-25 02:24 AM
Hello @Community member ,
Did you generate code using CubeMX? Which version ?
Kind Regards,
Imen
2018-12-26 10:48 PM
Hi Imen,
As stated in the original post, I am using version 1.9.0 of the STM32F0 package in cube.
Kind regards,
Lloyd
2018-12-28 02:25 AM
Hello @Community member ,
Could you please provide us the ioc file or source code to check more this behavior.
After check, using STM32CubeF0 V1.9.0 and STM32CubeMx V5.0, I have chosen DMA1CH4 for USART1TX and the following lines was autogenerated:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_SYSCFG);
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
Kind Regards,
Imen
2018-12-28 02:52 AM
Hi Imen,
I have generated the code any made no modification.
Although I still don't see those lines, I see that the equivalent is called in HAL_MspInit() as __HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
When I was minimizing the code, Atollic took me to the __weak definition of HAL_MspInit(), so I removed the line. I see now that there is a strong definition in stm32f0xx_hal_msp.c .
I would rather not share
// THIS IS IN stm32f0xx_hal_msp.c
/**
* Initializes the Global MSP.
*/
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* SVC_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SVC_IRQn, 0, 0);
/* PendSV_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PendSV_IRQn, 3, 0);
/* SysTick_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SysTick_IRQn, 3, 0);
/* Peripheral interrupt init */
/* FLASH_IRQn interrupt configuration */
HAL_NVIC_SetPriority(FLASH_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(FLASH_IRQn);
/* RCC_IRQn interrupt configuration */
HAL_NVIC_SetPriority(RCC_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(RCC_IRQn);
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
// WHEREAS THIS SNIPPET IS IN stm32f0xx_hal.c
/**
* @brief Initializes the MSP.
* @retval None
*/
__weak void HAL_MspInit(void)
{
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_MspInit could be implemented in the user file
*/
}
I would rather not share anything proprietary, but I think you can generate the code I have by checking the option to generate separate .c and .h files for each peripheral and choosing advanced mode.
My apologies for the waste of your time!
Kind regards,
Lloyd
Kind regards,
Lloyd
2018-12-28 04:59 AM
Hi,
Thanks for sharing more details. I will check with Atollic IDE as I cannot reproduce the case with Keil.
Kind Regards,
Imen
2019-01-31 06:27 AM
Hi @Community member
After check, using STM32CubeF0 V1.9.0 and STM32CubeMx V5.0.1, i redid the same scénario: i have chosen DMA1CH4 for USART1TX and the following lines was autogenerated:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
So, could you please send me your ioc file to check the problem ?
2019-01-31 06:28 AM
Hi @Community member (Nortech International)
After check, using STM32CubeF0 V1.9.0 and STM32CubeMx V5.0.1, i redid the same scénario: i have chosen DMA1CH4 for USART1TX and the following lines was autogenerated:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
So, could you please send me your ioc file to check the problem ?
Regards,
Nesrine.