Page 1 of 1

STM32 rccReset macro clears bits not in mask  Topic is solved

Posted: Wed Aug 16, 2017 2:13 pm
by FXCoder
Hi Giovanni,
All the Chibios STM32 rccReset macros clear the entire register after applying the reset bits specified by the mask (see example below).
In the event that some other independent (non Chibios) driver code has intentionally set a Reset bit in the rcc register then that other driver code expects the bit to remain set until it clears it.

Suggest all rccReset macros to use RCC->xxxxRSTR &= ~(mask);

Bob

Code: Select all

/**
 * @brief   Resets one or more peripheral on the APB1 bus.
 *
 * @param[in] mask      APB1 peripherals mask
 *
 * @api
 */
#define rccResetAPB1(mask) {                                                \
  RCC->APB1RSTR |= (mask);                                                  \
  RCC->APB1RSTR = 0;                                                        \
}

Re: STM32 rccReset macro clears bits not in mask

Posted: Sun May 27, 2018 9:09 am
by Giovanni
Moved in change request.

Giovanni

Re: STM32 rccReset macro clears bits not in mask

Posted: Sat Jul 07, 2018 9:29 am
by Giovanni
Hi,

Implemented in trunk and 18.2.x.

Giovanni