Hi all!
I bought Segger J-Link JTAG and I wanted to make a try with Logic Analyzer. I have unlocked debug state of my STM32F107 as described in Keil Help, made a simple while loop with incrementation like shown below: lh4.ggpht.com/.../trace1.jpg
and after I have run my program for several seconds, stopped it and I found I didnt record any result. I start and stop for several times, and that are the only positions Logic Analyzer recorded: lh4.ggpht.com/.../trace2.jpg
As you can see my trace have NOT been overflowed, and my debug settings looks like this: lh4.ggpht.com/.../trace3.jpg
even if I set more trace ports it is always the same :(
Maybe:
www.keil.com/.../uv4_db_dbg_logicanalyzer_restrictions.htm
Iv read that document. My variable is a global one, inside main() function. I think those restrictions does not apply to my problem.
If it's inside any function, then it is local to that function; it is not global!
It looks like this:
int test; void main(void) { test = 0; while(1) { test++; if(test>50) test=0; } }
It is declared global, outside any function, imho. It is just changed inside main function. Or tell me Im wrong?
But it is not volatile, so the compiler can copy the variable contents into a register, and continue to run the loop with just a register value.
I dont have the hardware with me to check if this is correct.
Please tell me how to declare a variable to observe it in Logic Analyzer.
volatile int test; void main(void) { while(1) { test++; } }
Is that ok?
At the moment there is a problem with JLink and reading SWO, we are working on this.
BR, /th.
Having now seen your code, yes - that is correct.
But your initial description was unclear: you just said the variable was "in main" - which could easily be taken to mean that it was defined in main.
Just goes to show the importance of being clear & precise in your posts!
Thank you very much for your help! In the future Ill do my best to be as clear as possible.
Iv wrote program with global volatile variable but it still doesnt work, so it have to be a problem with uVision+JLINK+reading SWO.
Anyone who uses JLINK was able to work with Logic Analyzer?
Sorry for double post. @Thorsten de Buhr
"At the moment there is a problem with JLink and reading SWO, we are working on this." -At the moment... - so it means it never works?! Im using the newest Keil uVision 4.10, it should be written somewhere that Keil uVision does not fully cooperate with certain JTAGs so people can choose proper debuggers. :(
http://www.keil.com/support/man/docs/jlink/jLink_STM32F10xxx.htm
To use CoreSight trace functionalities, the STM32F10xxx device, the debugger adapter and connector, as well as µVision have to be configured properly:
www.keil.com/.../jLink_trace_la_window.htm
To display variables in the Logic Analyzer:
1. Enable Timestamps in the Target Driver Setup - Trace dialog, and select an appropriate Prescaler value to define the granularity of the timestamps. 2. Drag and drop variables you want to watch to the Logic Analyzer.
If you read my first post and clicked on third image you would know I read ALL the manuals and configured everything properly. It is pointless trying to help everyone by coping manuals into the threads. We read it!
At the moment it came up uVision is not compatible with J-Link.
I've given up and will order an USB logic analyzer!
you can get them for ~400US$
Cheers Thomas
Hello there,
Any news about the SWO Support? I'm having the same problems and can't get the Trace with SWO get working.
I'm using
IDE-Version: µVision V4.03q Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. IL, An ARM(R) Company
Tool Version Numbers: Toolchain: RealView MDK-ARM Version: 4.11 Toolchain Path: BIN40\ C Compiler: Armcc.Exe V4.0.0.728 [Evaluation] Assembler: Armasm.Exe V4.0.0.728 [Evaluation] Linker/Locator: ArmLink.Exe V4.0.0.728 [Evaluation] Librarian: ArmAr.Exe V4.0.0.728 [Evaluation] Hex Converter: FromElf.Exe V4.0.0.728 [Evaluation] CPU DLL: SARMCM3.DLL V4.11 Dialog DLL: DARMSTM.DLL V1.46 Target DLL: Segger\JL2CM3.dll V1.10 Dialog DLL: TARMSTM.DLL V1.43
I hope there are any answers about this prob.
best regards,
Holger
Hi,
Trace on SWO should work fine.
Trace on SWO is not a full Trace, you must choose a high divider for PC Sampling (1024 x ...) and enable PC sampling.
When you single Step in ASM (disassembly window) you may choose the lowest one, then you'll get nearly every instruction.
Trace with JTrace works fine.
. BR, /th.