Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSP_CFG_HOCO_FREQUENCY is only used if there is FLL #344

Open
metebalci opened this issue Jan 21, 2024 · 2 comments
Open

BSP_CFG_HOCO_FREQUENCY is only used if there is FLL #344

metebalci opened this issue Jan 21, 2024 · 2 comments
Labels

Comments

@metebalci
Copy link

I am trying the new Arduino R4 board which has RA4M1. While dumping clock related registers after restart, I realized HOCOCR2 is 0 (24 MHz) although BSP_CFG_HOCO_FREQUENCY is defined as 4 (48 Mhz). Looking at startup codes, as far as I can see BSP_CFG_HOCO_FREQUENCY is only used if BSP_PRV_HOCO_USE_FLL is set, and this is set only if BSP_FEATURE_CGC_HAS_FLL, BSP_CFG_FLL_ENABLE and BSP_CLOCK_CFG_SUBCLOCK_POPULATED is set. However, BSP_FEATURE_CGC_HAS_FLL is set to 0 in ra4m1/bsp_feature.h, thus, I think, BSP_CFG_HOCO_FREQUENCY has no effect so HOCO frequency is not correctly updated during startup. I think the CLKOUT pin is not exposed in this board, so I cannot verify the actual HOCO frequency. Am I missing something or HOCOCR2 should be set to BSP_CFG_HOCO_FREQUENCY during startup ?

(side not: HOCOCR2 is not defined in R_SYSTEM, #343)

@renesas-brandon-hussey
Copy link
Collaborator

This is being internally tracked using FSPRA-2363.

@renesas-colin-hines
Copy link

@metebalci:

  1. Can you please provide the version of FSP and/or Arduino library that you are using?
  2. Can you confirm the address that you are checking for HOCOCR2. Please note that the address given in the current Hardware Manual (r01uh0887ej0110) - 0x4001E000 - is NOT correct. The correct address is 0x4001E037, as indicated in the Technical Note adding it originally: https://www.renesas.com/us/en/document/tcu/addition-hococr2-register-hoco-clock-control
  3. Please note that the FLL relationship you were seeing in code is not how FSP configures the HOCO frequency; it is for configuring the FLL functionality. The HOCO frequency is configured via the OFS1 register in ROM and HOCOCR2 will be initialized to match that setting at power on reset. See https://github.com/renesas/fsp/blob/master/ra/fsp/src/bsp/mcu/all/bsp_rom_registers.c#L32
  4. Lastly, please check the hex file contents for your program and provide the value located at 0x0404 - 0x0407. This should be the contents of the OFS1 value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants