cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7: Keil Logic Analyzer

Luca Sevà
Associate
Posted on June 17, 2017 at 22:41

Hi everyone,

I decide to start a discussion about the use of the Keil (v5) logic analyzer with the STM32F7 MCU.

For example: in the STM32F7 cube examples there is an interesting example about the ADC capability of the F767ZI board. The value are stored in the memory of the MCU itself and it follow that the value can't be visualized in the tool. In the Keil's documentation is clearly wrote that the registry value and other type can't be added as trace. Arguing with a couple of colleagues they've told me that doing some 'tricks' like copy the registry value in a global variable(that I'm sure that can be added as a trace) is a solution.

What do you think about ?

Can you give useful tips ?

Thanks in advance

#keil #stm32-keil-cubemx #logic-analyzer #stm32
1 REPLY 1
Bob Boys
Senior
Posted on June 18, 2017 at 03:09

Hello

If by 'registry' you really mean the CPU registers - these cannot be read by any debugger without interrupting the CPU.

If you mean peripheral registers, it is possible to read these while the program runs by either putting the register name in the LA or the raw physical address such as *((unsigned long *)0x20000000). There must normally be a write to this address and this does not work with all such registers.

Creating another variable (global or static) to mirror a hidden register is an appropriate technique. In cases where SWV get overloaded by many writes to the LA, sample the target variable with another variable. Each element entered in the LA event driven as as such can easily overload SWV. Using a Keil ULINKpro helps with high SWV traffic.

The uVision Logic Analyzer uses Serial Wire Viewer (SWV) to obtain the data values.

This means that Cortex-M0/M0+ cannot use Logic Analyser as they have no SWV. Cortex-M3/M4/M7/M23/M33 all have SWV. (AFAIK)

LA can display global and static variables, structures and anything in memory - anything that sticks around. A local does not as these are normally in a CPU register.

The attached document might be interesting.

Keil has something new called Event Recorder. This uses DAP read/write technology (same as Watch, Memory and peripheral windows) and can be used with any Cortex-M processor including M0/M0+. This can be used to instrument your code.

http://www.keil.com/pack/doc/compiler/EventRecorder/html/index.html

If you are having trouble figuring out the CPU speed check out:

http://www.keil.com/appnotes/docs/apnt_asp

Bob Boys

ARM

________________

Attachments :

StLink_3.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hybv&d=%2Fa%2F0X0000000bA3%2FkJ0caGbHwB8P2LYYCTp0cVUXrF9Uv1zl9bW1HfC49VM&asPdf=false