STM32 rccReset macro clears bits not in mask

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
FXCoder
Posts: 56
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 10 times
Been thanked: 12 times

STM32 rccReset macro clears bits not in mask

Postby FXCoder » Wed Aug 16, 2017 2:13 pm

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;                                                        \
}

Return to “Bug Reports”

Who is online

Users browsing this forum: Korken and 2 guests