Reply
Posts: 8
Registered: ‎03-18-2016
Accepted Solution

Bug in the Configurator for configure of HFRCO for EFM32

I make progect for EFM32TG210F32 without HFXO (HFXO is not enable and its pin is disable) with internal HFRCO osc

When I generate InitDavice.c in this file in the function

CMU_enter_DefaultMode_from_RESET

not commented called of function

 

CMU_OscillatorEnable(cmuOsc_HFXO, true, true);

 

and osc RCO not started after init. If I comment it function

 

// CMU_OscillatorEnable(cmuOsc_HFXO, true, true);

 

all is OK RCO is started

Posts: 2,108
Registered: ‎10-14-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

I did not reproduce your issue here.

I created a new configurator project and enable the HFXO and then disable it. I did not see the routine

CMU_OscillatorEnable(cmuOsc_HFXO, true, true);

was called in the generated InitDevice.c file.

My views are my own and do not necessarily represent the views of Silicon Labs

 

WeiguoLu
Posts: 8
Registered: ‎03-18-2016

Re: Bug in the Configurator for configure of HFRCO for EFM32

Part of my InitDevice.c for EFM32TG210F32

//================================================================================
// CMU_enter_DefaultMode_from_RESET
//================================================================================
extern void CMU_enter_DefaultMode_from_RESET(void) {

// $[LFXO enable]
CMU_OscillatorEnable(cmuOsc_LFXO, true, true);
// [LFXO enable]$

// $[HFXO enable]
CMU_OscillatorEnable(cmuOsc_HFXO, true, true);
// [HFXO enable]$

// $[LFACLK Setup]
// [LFACLK Setup]$

// $[High Frequency Clock select]
/* Using HFRCO at 14MHz as high frequency clock, HFCLK */
CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO);

/* Enable peripheral clock */
CMU_ClockEnable(cmuClock_HFPER, true);

// [High Frequency Clock select]$

// $[LF clock tree setup]
/* Enable LF clocks */
CMU_ClockEnable(cmuClock_CORELE, true);
CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO);
// [LF clock tree setup]$
// $[Peripheral Clock enables]
/* Enable clock for LEUART0 */
CMU_ClockEnable(cmuClock_LEUART0, true);

/* Enable clock for USART0 */
CMU_ClockEnable(cmuClock_USART0, true);

/* Enable clock for USART1 */
CMU_ClockEnable(cmuClock_USART1, true);

/* Enable clock for GPIO by default */
CMU_ClockEnable(cmuClock_GPIO, true);

// [Peripheral Clock enables]$

}

 

Posts: 2,108
Registered: ‎10-14-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

My automatically generated code

//==============================================================================
// enter_DefaultMode_from_RESET
//==============================================================================
extern void enter_DefaultMode_from_RESET(void) {
	// $[Config Calls]
	CMU_enter_DefaultMode_from_RESET();
	PORTIO_enter_DefaultMode_from_RESET();
	// [Config Calls]$

}

//================================================================================
// HFXO_enter_DefaultMode_from_RESET
//================================================================================
extern void HFXO_enter_DefaultMode_from_RESET(void) {

	// $[HFXO]
	// [HFXO]$

}

 

WeiguoLu
Posts: 8
Registered: ‎03-18-2016

Re: Bug in the Configurator for configure of HFRCO for EFM32

my autogenerated file InitDevice.c  (look at string 79 for function CMU_enter_DefaultMode_from_RESET)

 

	CMU_OscillatorEnable(cmuOsc_HFXO, true, true);

 

//=========================================================
// src/InitDevice.c: generated by Hardware Configurator
//
// This file will be regenerated when saving a document.
// leave the sections inside the "$[...]" comment tags alone
// or they will be overwritten!
//=========================================================

// USER INCLUDES
#include "InitDevice.h"

// USER PROTOTYPES
// USER FUNCTIONS

// $[Library includes]
#include "em_system.h"
#include "em_emu.h"
#include "em_cmu.h"
#include "em_device.h"
#include "em_chip.h"
#include "em_gpio.h"
#include "em_leuart.h"
#include "em_usart.h"
// [Library includes]$

//==============================================================================
// enter_DefaultMode_from_RESET
//==============================================================================
extern void enter_DefaultMode_from_RESET(void) {
	// $[Config Calls]
	LFXO_enter_DefaultMode_from_RESET();
	CMU_enter_DefaultMode_from_RESET();
	USART0_enter_DefaultMode_from_RESET();
	LEUART0_enter_DefaultMode_from_RESET();
	PORTIO_enter_DefaultMode_from_RESET();
	// [Config Calls]$

}

//================================================================================
// HFXO_enter_DefaultMode_from_RESET
//================================================================================
extern void HFXO_enter_DefaultMode_from_RESET(void) {

	// $[HFXO]
	// [HFXO]$

}

//================================================================================
// LFXO_enter_DefaultMode_from_RESET
//================================================================================
extern void LFXO_enter_DefaultMode_from_RESET(void) {

	// $[Use oscillator source]
	CMU->CTRL = (CMU->CTRL & ~_CMU_CTRL_LFXOMODE_MASK) | CMU_CTRL_LFXOMODE_XTAL;
	// [Use oscillator source]$

	// $[LFXO Boost Percent]
	CMU->CTRL = (CMU->CTRL & ~_CMU_CTRL_LFXOBOOST_MASK)
			| CMU_CTRL_LFXOBOOST_100PCENT;
	// [LFXO Boost Percent]$

	// $[REDLFXO Boost]
	// [REDLFXO Boost]$

}

//================================================================================
// CMU_enter_DefaultMode_from_RESET
//================================================================================
extern void CMU_enter_DefaultMode_from_RESET(void) {

	// $[LFXO enable]
	CMU_OscillatorEnable(cmuOsc_LFXO, true, true);
	// [LFXO enable]$

	// $[HFXO enable]
	CMU_OscillatorEnable(cmuOsc_HFXO, true, true);
	// [HFXO enable]$

	// $[LFACLK Setup]
	// [LFACLK Setup]$

	// $[High Frequency Clock select]
	/* Using HFRCO at 14MHz as high frequency clock, HFCLK */
	CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO);

	/* Enable peripheral clock */
	CMU_ClockEnable(cmuClock_HFPER, true);

	// [High Frequency Clock select]$

	// $[LF clock tree setup]
	/* Enable LF clocks */
	CMU_ClockEnable(cmuClock_CORELE, true);
	CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO);
	// [LF clock tree setup]$
	// $[Peripheral Clock enables]
	/* Enable clock for LEUART0 */
	CMU_ClockEnable(cmuClock_LEUART0, true);

	/* Enable clock for USART0 */
	CMU_ClockEnable(cmuClock_USART0, true);

	/* Enable clock for GPIO by default */
	CMU_ClockEnable(cmuClock_GPIO, true);

	// [Peripheral Clock enables]$

}
Posts: 8
Registered: ‎03-18-2016

Re: Bug in the Configurator for configure of HFRCO for EFM32

which chip you used

Posts: 2,108
Registered: ‎10-14-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

I created the configurator project based on EFM32TG840F32.

WeiguoLu
Posts: 2,108
Registered: ‎10-14-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

if possible could you attach the configurator file?
WeiguoLu
Posts: 8
Registered: ‎03-18-2016

Re: Bug in the Configurator for configure of HFRCO for EFM32

I attach the configurator file.

problem in the following

when I set in window DefaultModePeripherals in Clocking section mark in LFXO only (HFXO is not set)

in InitDevice.c I have code

//================================================================================
// CMU_enter_DefaultMode_from_RESET
//================================================================================
extern void CMU_enter_DefaultMode_from_RESET(void) {

	// $[LFXO enable]
	CMU_OscillatorEnable(cmuOsc_LFXO, true, true);
	// [LFXO enable]$

	// $[HFXO enable]
	CMU_OscillatorEnable(cmuOsc_HFXO, true, true);   //it is add automatically 
//I not set using HFXO oscillator!!! // [HFXO enable]$ // $[LFACLK Setup] // [LFACLK Setup]$ // $[High Frequency Clock select] /* Using HFRCO at 14MHz as high frequency clock, HFCLK */ CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO); /* Enable peripheral clock */ CMU_ClockEnable(cmuClock_HFPER, true); // [High Frequency Clock select]$ // $[LF clock tree setup] /* Enable LF clocks */ CMU_ClockEnable(cmuClock_CORELE, true); CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO); // [LF clock tree setup]$ // $[Peripheral Clock enables] /* Enable clock for LEUART0 */ CMU_ClockEnable(cmuClock_LEUART0, true); /* Enable clock for USART0 */ CMU_ClockEnable(cmuClock_USART0, true); /* Enable clock for GPIO by default */ CMU_ClockEnable(cmuClock_GPIO, true); // [Peripheral Clock enables]$ }

If no mark LFXO & HFXO

//================================================================================
// CMU_enter_DefaultMode_from_RESET
//================================================================================
extern void CMU_enter_DefaultMode_from_RESET(void) {

	// $[LFXO enable]
	// [LFXO enable]$

	// $[HFXO enable]
	// [HFXO enable]$

	// $[LFACLK Setup]
	// [LFACLK Setup]$

	// $[High Frequency Clock select]
	/* Using HFRCO at 14MHz as high frequency clock, HFCLK */
	CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO);

	/* Enable peripheral clock */
	CMU_ClockEnable(cmuClock_HFPER, true);

	// [High Frequency Clock select]$

	// $[LF clock tree setup]
	/* No LF peripherals enabled */
	// [LF clock tree setup]$
	// $[Peripheral Clock enables]
	/* Enable clock for GPIO by default */
	CMU_ClockEnable(cmuClock_GPIO, true);

	// [Peripheral Clock enables]$

}

Problem is  -  If I add ONLY LFXO !!!  -  HFXO add also automatically !!!

and chip strarted after only connent string

 

CMU_OscillatorEnable(cmuOsc_HFXO, true, true);

 

 

Highlighted
Posts: 74
Registered: ‎02-05-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

Hello,

 

although this thread is marked as solved (for the HFRCO question), the issue that the HFXO is enabled when you only select the LFXO to be active in the configurator is still present in the latest version of Simplicity Studio.

 

When I create a minimal project for the EFM32G222F64 and I only select the LFXO to be enabled, the generated code in the function 

CMU_enter_DefaultMode_from_RESET(void)

still tries to enable the HFXO:

 

	// $[LFXO enable]
	CMU_OscillatorEnable(cmuOsc_LFXO, true, true);
	// [LFXO enable]$

	// $[HFXO enable]
	CMU_OscillatorEnable(cmuOsc_HFXO, true, true);
	// [HFXO enable]$

Minimal configurator file attached. I can upload the complete project if required.

 

Should I open a new thread for this question or should I report this bug somewhere?

 

Best regards,

 Lieven.

Posts: 8
Registered: ‎03-18-2016

Re: Bug in the Configurator for configure of HFRCO for EFM32

Crate new thread.

SiLabs fast fix this bug

 

Best regards,

Vitaliy

Posts: 74
Registered: ‎02-05-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32

[ Edited ]

Hello @Vitaliy

 

the new thread is here.

 

Best regards,

 Lieven.

Posts: 74
Registered: ‎02-05-2014

Re: Bug in the Configurator for configure of HFRCO for EFM32