RX e2studioのスマートコンフィグレータのクロック設定の発信源を外部発信入力にしE2liteでデバッグしようとすると無限ループします

RXをe2studioのスマートコンフィグレータのクロック設定で発信源を外部発信入力にしてコード生成し、E2liteでデバッグ実行するとPLLクロックのOSCOVFSRのチェック処理で無限ループします。

mcu_clocks.c 

/* Set the oscillation stabilization wait time of the main clock oscillator. */
#if BSP_CFG_MAIN_CLOCK_SOURCE == 0 /* Resonator */
SYSTEM.MOSCWTCR.BYTE = BSP_CFG_MOSC_WAIT_TIME;
#elif BSP_CFG_MAIN_CLOCK_SOURCE == 1 /* External oscillator input */
SYSTEM.MOSCWTCR.BYTE = 0x00;
#else
#error "Error! Invalid setting for BSP_CFG_MAIN_CLOCK_SOURCE in r_bsp_config.h"
#endif

/* Set the main clock to operating. */
SYSTEM.MOSCCR.BYTE = 0x00;

/* Dummy read and compare. cf."5. I/O Registers", "(2) Notes on writing to I/O registers" in User's manual.
This is done to ensure that the register has been written before the next register access. The RX has a
pipeline architecture so the next instruction could be executed before the previous write had finished.
*/
if(0x00 == SYSTEM.MOSCCR.BYTE)
{
R_BSP_NOP();
}

/* WAIT_LOOP */
while(0 == SYSTEM.OSCOVFSR.BIT.MOOVF)
{
/* The delay period needed is to make sure that the Main clock has stabilized.
If you use simulator, the flag is not set to 1, resulting in an infinite loop. */
R_BSP_NOP();
}

で無限ループします。

何か良い回避方法ありませんでしょうか?

  • Muraさん、こんにちは。NoMaYです。

    > (A) 発振子を繋いでいた
    > (B) マイコン外部にクロック生成回路/クロック生成器があってそのクロック生成回路/クロック生成器からクロックを入れていた

    > Muraさんの回路が(A)であったのにRXスマートコンフィグレータ上で外部クロック入力を選択していた、のであれば、

    > (A)になります。

    こちらの方だったわけですね。どうもリプライありがとうございました。