How to make register values in Peripheral->System Viewer be updated during debug? I use SEGGER J-Link with uVision 5.25.2.0 and experience such problem by working with NXP Kinetis MKL03F32V4 device. Actually, with any device in Kinetis KL0 series. Some register values are updated during step-by-step debug (e.g. LPTMR0), but some are not (e.g. MCG or SMC). If I copy register value into a variable and place it into Watch window, I see its update there. Previously with Keil version prior to 5.1 everything worked fine. Today I faced with the same problem by working with Kinetis K02 Cortex-M4 device. However, all System Viewer registers are updated for Kinetis K64F microcontroller. Very strange. Please advise how to fix it. Here is my code for modifying SMC. The System Viewer always shows their values as zeros.
SMC->PMPROT = SMC_PMPROT_AVLP_MASK; SMC->PMCTRL = SMC_PMCTRL_RUNM(2) | SMC_PMCTRL_STOPM(2);
When registers stick at zero you should make sure the peripherals clock is enabled.
Yes, I am very well aware of that and follow this rule. However, the modules for which I gave examples above (MCG and SMC) do not need any clock to be enabled in SIM to access their registers. But even for the modules that do need clock enabled (like I2C0 or SPI0), all their registers always show zeros in System Explorer, even if the communication works fine as reported by an external logic analyzer.
If you can dump the registers to a console from inside your application and they look different than the viewer, then you'll want to look at the file describing the register file to the debugger.
Yes, the register contents looks correct if I dump it to console. Thank you for the hint, but I have never modified the debugger files before. Is there any tutorial on that or at least where to find those files and what are their names?
There will be .SVD (XML) files under the PACK directories for your chosen parts.
Start by checking whether the "baseAddress" for your peripheral is at the correct location for the given device. They should describe the register layout from the reference manual in a machine readable XML format.
C:\Keil5xx\ARM\PACK\Keil\STM32F0xx_DFP\1.5.0\SVD\STM32F091x.svd (example adapt for NXP trees)
Thank you! OK, I found only .xml file, not .svd for my part. Anyway, the address of the SMC peripheral and all other related to it fields are correct there. Renamed this file to .svd and applied SVDConv.exe tool to generate the .SFR file and replaced the original one with it in ...\PACK\NXP\MKL03Z4_DFP\10.0.1 folder. Restarted Keil. Still no go - the System Viewer keeps showing 0s for the SMC registers. If I add SMC to Watch, the values of all its registers are shown correctly and updated in the coarse of debugging. This could be a workaround. But any other hints how to make System Viewer work properly?