Skip to content

hardware_xosc: Hardcoded frequency range in xosc_init() prevents using >15MHz crystals on RP2350 without modifying the SDK #3074

Description

@Vesek

When trying to configure pico-sdk to use a 32MHz crystal as the clock source for XOSC I found that xosc_init() in xosc.c hardcodes the XOSC CTRL register to XOSC_CTRL_FREQ_RANGE_VALUE_1_15MHZ. This cannot be overridden without modifying the SDK code.

It would be incredibly helpful if the frequency range in xosc_init() could be made configurable via a preprocessor definition, similar to other clock configurations in the SDK.

For example, introducing a define like:

#ifndef PICO_XOSC_FREQ_RANGE
#define PICO_XOSC_FREQ_RANGE XOSC_CTRL_FREQ_RANGE_VALUE_1_15MHZ
#endif

so developers can override this behavior in their board.h files.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions