STM32 rccReset macro clears bits not in mask Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
User avatar
FXCoder
Posts: 90
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 19 times
Been thanked: 20 times

STM32 rccReset macro clears bits not in mask  Topic is solved

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

User avatar
Giovanni
Site Admin
Posts: 11033
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 356 times
Been thanked: 298 times
Contact:

Re: STM32 rccReset macro clears bits not in mask

Postby Giovanni » Sun May 27, 2018 9:09 am

Moved in change request.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 11033
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 356 times
Been thanked: 298 times
Contact:

Re: STM32 rccReset macro clears bits not in mask

Postby Giovanni » Sat Jul 07, 2018 9:29 am

Hi,

Implemented in trunk and 18.2.x.

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 1 guest