This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Question about Logic analyzer with STlink and Ulinkpro

Dear All,

I have a ST-LINK/V2 debugger and I tried to use Logic Analyzer (LA) feature of µVision. I would like to convert analog signals and put them to IIR type filter to remove unwanted contents of the signals. I would like to watch the signals and their filtered forms in a graph like in the video whose links given below.

https://www.youtube.com/watch?v=xo1D2Rm2BQ4&feature=emb_logo (It is long video and have look at 17:00)

ADCs convert analog data every ~40us and some calculations and scaling are applied before putting the signals to low pass IIR type filter. I use filtered signal for other calculation so on.

I realized that ST-Link is not enough for this kind of debug feature. To be honest I made my first test to visualize a counter value which increases every 1ms (Case:1) and ST-Link made good job and I didn't think carefully at that time. However, when the counter increases every 40us (Case:2) in ADC interrupt subroutine, LA cannot visualize the counter. I read some documents about LA and Trace feature/debug options etc. but nothing solved. µVision gives SW Buffer Overrun error message for Case:2. However it works fine for Case:1. I would like to observe SWO pin with a scope and I realized that data comes continually for Case:2. There is no gap between two frames. There is a gap between two frames for Case:1. Please find the screenshots of LA and the scope for both cases. I also added Target Driver Setup screenshot.  I already ordered Ulinkpro D but it will take one week to have it. I would like to evaluate time until Ulinkpro D will be received. I have to two questions as follows: 

1-      I don’t know how trace features works. However, if there is a way to reduce data on SWO bus, it may help to overcome this problem temporarily. I made a test and I removed everything in watch window and LA and also closed them. However, data comes continuously on SWO pin and nothing changed or I cannot observe the change. I thought that if I can reduce useless data for me on SWO, I may observe at least one ADC result on LA, but I didn’t find a way to do it. 2 MHz is not enough for all coming data.

2-      As I mentioned that I ordered Ulinkpro D and I am not sure if it is capable to show at least two signals at the same time on LA with SWO. Ulinkpro D Serial wire trace capturing capability reaches up to 100 Mbit/sec which is 50 times faster than ST-Link. However, I am not sure if it is enough or not. Previous projects, I used JTAG port for TI DSPs and it was enough to observe two signals at the same time. If SWO is not enough for that, shall I change SWO interface to for example JTAG. JTAG is slower and I guess same DATA/Clock pin counts are used with serial wire trace. However, If it is the case, I need to change PCB as well and I may evaluate time to change PCB design waiting Ulinkpro D. 

Thank you very much in advance for your kind help.

Best Regard

Parents Reply Children
  • Dear Andy

    Maybe LA in Keil is not capable for that purpose but I would like to debug my code. I don't want to use as DAQ. Actually,  I am developing a kind of data aqusition system. However I need to see if ADC converts waveform correctly or not. If the filter works well or not etc. (IIR filter is implemented in C code and result is stored one of floating type variable. Also 12 bits ADC result is stored one of floating variables after scaling with a floating number. All variables are global variables. I would like to visualise these variables.)

    Let me explain how we do for Texas Instrument microcontroller and you may give an idea to me.

    In TI code, we define an array with a size of let say 500. If the grid voltage frequency is 50Hz, the array contains one complete cycle. (One period of grid voltage is 1/50Hz = 20ms and  (40us sampling period*500 array size) = 20 ms ) TI graphical viewer visualize the buffer on the screen in debug mode over JTAG connection.

    One example screenshot is given above. The video which is made by KEIL shows similar screen in debug mode:

    https://www.youtube.com/watch?v=xo1D2Rm2BQ4&feature=emb_logo ( have look at 17th minutes) 

    I want to use debugger as like scope not for DAQ. It can be refresh about every 100ms or 200 ms it doesn't matter but I need to see graphs.  I don't want to store also. I don't need complete and continous data.

    This feature is a must for me. If I can't achieve in somehow, I have to change my desing with TI.

    Thank you

    Regards

  • Dear All,

    I made some tests. I generated a sine waveform from a lookup table with a sampling rates of 40us, 80us, 120us,.... 320us... If the sampling period is less then 320us, LA cannot capture the signal correctly. When the sampling rate is 3,125kHz (1/320us), LA can captures enough data to show correctly. I can guess the required communication speed is about 16 Mbit/sec for one signal with a sampling period of 40us. Because STLink SWO communication speed is 2MHz and and 320us is 8 times lower then the required sampling period.

    I need to see at least two signals at the same time. I can guess I need at least 32 Mbit/sec baud rate to capture two signals, one is ADC result and one is IIR filter result to compare both signals in same LA window. I hope Ulinkpro D will solve the problem, because its SWO output can reach up to 100MHz. 

    Regards,

  • Hello

    Some people sample their variables and then put these lower rate variables into the LA.  Obviously some information will be lost.

    A Keil ULINKplus also have very high speed SWO capabilities plus power measurement.

    Try turning off Interrupts - these can easily overload the SWO pin.

    An alternative - is to use a ULINKpro in ETM instruction trace mode - this gives you 4 bits data out rather than 1.  Your target processor must have the special 4 bit + clock ETM output port.  ULINKpro D is a ULINKpro without ETM trace.

    Bob Boys

  • Dear Bob,

    Some people sample their variables and then put these lower rate variables into the LA.  Obviously some information will be lost.

    This is not possible for my application, but thank you for offering such clever idea.

    Try turning off Interrupts - these can easily overload the SWO pin.

    This is one of good advise. I should keep in my mind. Again it is not possible in this application. However it is good to know. If I have to see someting  and if I don't have any other options, I will disable interrupt and poll the flag in main loop. Thank you for that.

    An alternative - is to use a ULINKpro in ETM instruction trace mode - this gives you 4 bits data out rather than 1.  Your target processor must have the special 4 bit + clock ETM output port.  ULINKpro D is a ULINKpro without ETM trace

    I know it but i need to change design for that. I didn't bring the ETM pins to the connector. So, let me try Ulinkpro D using SWO first and if it won't be enough I may buy Ulinkpro and change PCB design or I may totaly change microcontroller.

    If I need to change design, I will design my own LA in hardware. I don't want to pay a lot for Ulinkpro debugger. it is quite expensive. I will use Ulinkpro D for many other issue and I will use DAC option of microcontroller to visualise internal signals with scope. It is much more trustable for me. I can control speed and other things. 

    Thank you very much such clever ideas.

    Regards

  • Dear All

    I got UlinkPro-D and I tested. I need to add some pull-up and pull-down resistors to the hardware and the result is as expected. LA works well up to 4 signals.  Here is one sample graph:

    Happy new year!

    Regards