It is possible to use 64-bit parameters, such as formattings %llx and %lld with printf() on EFM32, with GCC's Base C Library (Nano C library does not support 64-bit arguments to printf()).
To select the base C library, right click on the project and go to Properties->C/C++ Build->Settings->Tool Settings->GNU ARM C Linker->General and set the [C library] dropdown to [Base C library]. Don't forget to do this for debug and release configurations, then apply and rebuild your project.
Note that the base C library will require more code space than the nano C library.
No matter how many breakpoints I set, they never stop the MCU while debugging. Why aren't the breakpoints working?
Answer
When in the Debug perspective of Simplicity Studio, one of the options in the Breakpoints window is to "Skip All Breakpoints." With this enabled, breakpoints will not stop the MCU. Make sure this is not set if you want to use breakpoints.
EM4 on the original Gecko MCU served as a kind of lowest power standby mode where the only wake-up options were power-cycling the device or asserting the RESETn pin. Giant Gecko enhanced this by providing periodic wake-up via the Backup Real Time Counter (BURTC) and alternate pin-based wake-up. While still causing resets, pin wake-ups are registered so that program flow can change depending on which pin caused the wake-up.
The expanded EM4 functionality is reflected in extensions to emlib's EMU functions, which permit configuration of various EM4-related operating parameters via the EMU_EM4Init function and its associated EMU_EM4Init_TypeDef structure.
So, when looking to use EM4 on the subsequent Zero Gecko device with the Cortex-M0+ core, some users have been confused by the EMU that looks radically different from the one on Giant Gecko or by the absence of the EM4-related emlib functionality.
Thankfully, the changes to EM4 functionality on Happy Gecko are due primarily to the absence of the BURTC on this device. The operation of the EMU_CTRL and EMU_LOCK registers remains the same, and the only change to the EMU_AUXCTRL register is the removal of the LFXO start-up current reduction bit (REDLFXOBOOST).
Knowing this, then, what is actually necessary to configure a Zero Gecko device for EM4 entry and wake-up? The procedure is quite simple:
Configure any I/O pins that will be used for wake-up as inputs. The supported pins on Happy Gecko are PA0, PC9, PF[2:1], and PE13.
Set these same pins to be wake-up sources via their respective enable bits in the GPIO_EM4WUEN register. Corresponding bits in the GPIO_EM4WUPOL register determine whether a given pin triggers wake-up on low or high levels.
Make sure any previous wake-up requests are cleared by setting the EM4WUCLR bit in the GPIO_CMD register.
Enable GPIO pin state retention by setting the EM4RET bit in the GPIO_CTRL register. This has the effect of retaining the output enable, output value, and pull enable states of all GPIO pins and is required in order to use pin-based wake-ups.
Consequently, any output pins capable of sourcing current should be disabled in order to achieve the 20 nA range current draw of which Zero Gecko are capable when in EM4.
Similarly, on-chip pull devices enabled on wake-up pins will also increase EM4 current, so consider using external pull-up resistors and wake upon falling edges.
Once setup is complete, drop into EM4 at any time by calling the emlib EMU_EnterEM4() function or by writing the designated bit sequence to the EM4CTRL field of the EMU_CTRL register. Wake-up will occur when a designated pin sees its specified level in addition to the usual RESETn assertion or power-cycling events.
To illustrate this, example Simplicity Studio projects are provided with this Knowledge Base article for the Zero Gecko STK3200 starter kit. Program flow is as follows:
After calling the CHIP_Init() function, the cause of the last reset is determined.
GPIO pins are configured for inputs or outputs as needed. LED0 is always turned on, and LED1 is turned on only if a pin wake-up from EM4 was responsible for the last reset.
The program makes sure that PC9, which is connected to PB1 on the Zero Gecko STK, is not still being held low from a previous wake-up event. It then waits for the pin to go low and high again.
Once PC9 goes high, it is configured for EM4 wake-up when low (all GPIO_EM4WUPOL bits left in their reset state of 0). Previous wake-up requests are cleared; pin retention is enabled as required (see above), which has the effect of keeping LED1 on when the device enters EM4. LED0 is turned off beforehand in order to illustrate the difference.
EMU_EnterEM4() is called, and the device goes into EM4 and remains in this mode until PC9 goes low (PB1 is pressed).
After downloading the example project, import it into Simplicity Studio as follows:
In the Simplicity Studio IDE, go the File menu (not the Project menu) and select Import…
Under General, select Existing Projects into Workspace, then click Next.
For Select archive file, locate the project .ZIP file and select it.
Make sure Copy projects into workspace is checked.
Click Finish.
Build the project, download it to the STK, and run it with the debugger. Note that when the MCU enters EM4, the debugger will lose its connection to the STK. Press the appropriate button to exit EM4 (LED0 will light up again) before attempting to restore the debugger connection.
In some of the documentation under the Soldering Information section it states, "Place as many and as small as possible vias underneath each of the solder patches under the ground pad," does this mean to put filled or covered vias?
Answer
The vias should be filled. If they are left open, the solder has the potential to wick into the holes and cause random fallout due to the part skewing on the PCB.
EM4 on the original Gecko MCU served as a kind of lowest power standby mode where the only wake-up options were power-cycling the device or asserting the RESETn pin. Giant Gecko enhanced this by providing periodic wake-up via the Backup Real Time Counter (BURTC) and alternate pin-based wake-up. While still causing resets, pin wake-ups are registered so that program flow can change depending on which pin caused the wake-up.
The expanded EM4 functionality is reflected in extensions to emlib's EMU functions, which permit configuration of various EM4-related operating parameters via the EMU_EM4Init function and its associated EMU_EM4Init_TypeDef structure.
So, when looking to use EM4 on the subsequent Happy Gecko device with the Cortex-M0+ core, some users have been confused by the EMU that looks radically different from the one on Giant Gecko or by the absence of the EM4-related emlib functionality.
Thankfully, the changes to EM4 functionality on Happy Gecko are due primarily to the absence of the BURTC on this device. The operation of the EMU_CTRL and EMU_LOCK registers remains the same, and the only change to the EMU_AUXCTRL register is the removal of the LFXO start-up current reduction bit (REDLFXOBOOST).
Knowing this, then, what is actually necessary to configure a Happy Gecko device for EM4 entry and wake-up? The procedure is quite simple:
Configure any I/O pins that will be used for wake-up as inputs. The supported pins on Happy Gecko are PA0, PC9, PF[2:1], PE13, and PC4.
Set these same pins to be wake-up sources via their respective enable bits in the GPIO_EM4WUEN register. Corresponding bits in the GPIO_EM4WUPOL register determine whether a given pin triggers wake-up on low or high levels.
Make sure any previous wake-up requests are cleared by setting the EM4WUCLR bit in the GPIO_CMD register.
Enable GPIO pin state retention by setting the EM4RET bit in the GPIO_CTRL register. This has the effect of retaining the output enable, output value, and pull enable states of all GPIO pins and is required in order to use pin-based wake-ups.
Consequently, any output pins capable of sourcing current should be disabled in order to achieve the 20 nA range current draw of which Happy is capable when in EM4.
Similarly, on-chip pull devices enabled on wake-up pins will also increase EM4 current, so consider using external pull-up resistors and wake upon falling edges.
Once setup is complete, drop into EM4 at any time by calling the emlib EMU_EnterEM4() function or by writing the designated bit sequence to the EM4CTRL field of the EMU_CTRL register. Wake-up will occur when a designated pin sees its specified level in addition to the usual RESETn assertion or power-cycling events.
To illustrate this, an example Simplicity Studio v3 project is provided with this Knowledge Base article for the Happy Gecko SLSTK3400A starter kit. Program flow is as follows:
After calling the CHIP_Init() function, the cause of the last reset is determined.
GPIO pins are configured for inputs or outputs as needed. LED0 is always turned on, and LED1 is turned on only if a pin wake-up from EM4 was responsible for the last reset.
The program makes sure that PC9, which is connected to PB0 on the Happy Gecko STK, is not still being held low from a previous wake-up event. It then waits for the pin to go low and high again.
Once PC9 goes high, it is configured for EM4 wake-up when low (all GPIO_EM4WUPOL bits left in their reset state of 0). Previous wake-up requests are cleared; pin retention is enabled as required (see above), which has the effect of keeping LED1 on when the device enters EM4. LED0 is turned off beforehand in order to illustrate the difference.
EMU_EnterEM4() is called, and the device goes into EM4 and remains in this mode until PC9 goes low (PB0 is pressed).
After downloading the example project, import it into Simplicity Studio as follows:
In the Simplicity Studio IDE, go the File menu (not the Project menu) and select Import…
Under General, select Existing Projects into Workspace, then click Next.
For Select archive file, locate the project .ZIP file and select it.
Make sure Copy projects into workspace is checked.
Click Finish.
Build the project, download it to the STK, and run it with the debugger. Note that when the MCU enters EM4, the debugger will lose its connection to the STK. Press the appropriate button to exit EM4 (LED0 will light up again) before attempting to restore the debugger connection.
How can I adjust the performance of the EFM32 DAC?
Answer
The performance of the DAC can be adjusted by changing the calibration register, DACn_CAL. The GAIN field adjusts the gain, and the CH0OFFSET and CH1OFFSET fields adjust the offset of each DAC channel. The reset value of these registers will vary from device to device based on calibration.
If the DAC output is ringing, the capacitance on the output pin can be increased. This value should be at least 2 nF.
The PROD_REV field in the DI page is the production revision, which indicates the version of the production test program used to calibrate the device. This does not indicate the silicon revision and could change within the same silicon revision or even remain the same across multiple silicon revisions.
Generally you would not want to compare PROD_REV equality with a fixed value. Also there is no guarantee that the PROD_REV is incremented sequentially for each production test revision. Comparisons with PROD_REV should only be performed when indicated in specific errata conditions. See the device errata history and latest errata for complete details.
See Section 3.6 Device Revision in the GG RM for details on how to identify which MCU silicon revision (ie Rev E) is being used.
32-bit Knowledge Base
printf() with 64-bit parameters
Keil uVision v5 support for SiM3
Breakpoints
Using EM4 on Zero Gecko
Layout and Soldering Information
Using EM4 on Happy Gecko
EFM32 DAC performance
What is PROD_REV for EFM32 devices?
在EFM32和EZR32微控制器的硬件设计时要关注什么?
在不使用调试器(debugger)的情况下通过UART来把固件写入EFM32设备