renesas / fsp

Flexible Software Package (FSP) for Renesas RA MCU Family
https://renesas.github.io/fsp/
Other
192 stars 82 forks source link

A bug in bsp_clocks.c #274

Closed clint-k closed 1 year ago

clint-k commented 1 year ago

I think I found a bug in bsp_clocks.c, line 375.

#elif defined(BSP_CFG_SDADC_CLOCK_SOURCE) && (BSP_CFG_SDADC_CLOCK_SOURCE == BSP_CLOCKS_SOURCE_MAIN_OSC)
 #define BSP_PRV_MAIN_OSC_USED                    (1)
#else

The rhs of the macro equation should be BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC. ("CLOCK" was missing.) Currently, if the macro BSP_CFG_SDADC_CLOCK_SOURCE is defined with value 0, the equation asserts and BSP_PRV_MAIN_OSC_USED is defined with value 1. On RA2A1, this activates MOCO and makes impossible to use XTAL/EXTAL pins as GPIO or other peripheral function pins.

SeanMeng0509 commented 1 year ago

Hi @clint-k, thank you for reporting this issue. We will get it fixed in the next release.