psherman42 / riscv-easy-as-pi

Getting started with RISC-V
Other
10 stars 0 forks source link

prci_hfxoscrdy function checks incorrect address #1

Open BEforlin opened 1 year ago

BEforlin commented 1 year ago

Hello,

In the clock.c file, function prci_hfrosccfg() evaluates the address of prci_hfrosccfg:

#define prci_hfxoscrdy() ( ((prci_hfrosccfg >> 31) & 0x1) )

Instead of evaluating the offset address prci_hfxosccfg:

#define prci_hfxoscrdy() ( ((prci_hfxosccfg >> 31) & 0x1) )

This causes the program to infinitely loop on clock_init() when PRCI_EXT_DIR is selected as clk_mode.

As this is an extremely didactic project, and as this is not mentioned anywhere I imagine it's a typo.

Thank you for releasing this!

psherman42 commented 1 year ago

Done. Many, many, many thanks @BEforlin !