cancel
Showing results for 
Search instead for 
Did you mean: 

Several bugs in STM32U0x3

wijnen
Associate

For a project I am using the STM32U073 and for testing the development board with the STM32U083. I have encountered several issues in CubeMX and perhaps also in the hardware:

  1. The code that CubeMX generates for the low power timer contains a typo. Line 4214 says "tmpccmr2 = hlptim->Instance->CCMR1;", but it should read CCMR2 instead
  2. LCD_MspInit() should be called during startup (probably in MX_LCD_Init() in main.c), but that does not happen.
  3. __HAL_RCC_PWR_CLK_ENABLE() is not called at startup, but it needs to be.
  4. LCD_IRQHandler() in stm32u0xx_it.c does not call a weak function like every other interrupt handler, but requires code in the USER CODE BEGIN/END block in there.
  5. In stm32u0xx_hal_msp.c, at line 568, the alternate function of the timer pin needs to be set to enable a PWM on timer 2: GPIO_InitStruct.Alternate = 1;
  6. Finally, the encoder on low power timer 1 is behaving very weird.
    1. Apparently, even though this is not very clear from the reference manual, the "match" event happens when the value in the counter changes between the value in the channel register and the value above that. In other words, when counting up, it matches when it leaves the value, but when counting down it matches when it enters the value. This is not a problem, as long as it is well documented.
    2. When changing the channel value, the match can still happen even if the new value is completely different. In particular, I had a compare match on a value, the counter was on that value, then I changed the compare channel. I cleared all the interrupt flags and continued. Nothing happened. If I then (seconds later) turn the encoder to the next step (nowhere near the new value of the channel), it triggers the channel interrupt. I noticed this when counting up for low values (near 0) but not when counting down. For high values (just below 0), it happens when counting down, but not when counting up.
 
0 REPLIES 0