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 :(
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.
I use the evaluation version. I get my var data in the watch tab, but no trace data of the same var in the logic analyzer? If i write somesthin to the ITM Cell, printf via ITM Stimulus Port, then i receive the data without problems. Do you use the JLink or the JTrace? Could there be a difference?
I use JLINK and it is not working in my opinion with Logic Analyzer. It is sad because in Keil manual it is written it will work :(
Hi there,
meanwhile i have a full licence and checked again the Logic Analyzer.
I can say, YES it works, BUT the values are only updated if i enable the "Periodic Window Update". And the really poor behavior is, the values in the Logic Analyzer are only the sampled values of the "Periodic Window Update". So in the end the resolution depends on the sample time of the "Periodic Window Update". This is not acceptable in a real time application.
I know, that the SWO Trace is no full trace, but ITM Macros (printf) works fine and is sufficient, but why is that not possible with the Logic Analyzer?
If someone will change a ULink2 Adapter to my JLink, he can mail me. After some mails to segger with no response, i don't believe that there will be a solution in the next time... really sad..
Best regards
I have full license and Segger J-Link, but I wasnt able to make it work. Iv got globally declared volatile variable, trace turned on, uC clocked configured (in Trace option), turned on Periodic Sample, and so on just like on the pictures: img835.imageshack.us/.../72373182.gif img842.imageshack.us/.../42631512.gif
My code is:
volatile unsigned char logic=0; main() { while(1) { logic++; if( logic == 255 ) logic = 0; } }
All i get is constant random value (each time I restart the program it hangs on diffrent value) img692.imageshack.us/.../69582651.gif and it doesnt change. I know that variable will change rapidly, because of while(1), but even then there should be jitter value in logic analyzer, not constant value.
@Holger Fürstenberger Can You compare and tell me what Im doing wrong? What type of J-Link you have? Mine is V8 (non-trace).
Best regards, Maciej Andrzejewski.