Тёмный

[011] USB Debugging with sigrok 

OpenTechLab
Подписаться 29 тыс.
Просмотров 52 тыс.
50% 1

Advanced USB packet capture with logic analyzers and sigrok.
Show Notes: opentechlab.org.uk/videos:011...
Twitter: @OpenTechLabChan
Mastadon: @opentechlab@mstdn.io
SubscribeStar: www.subscribestar.com/opentec...
PayPal: www.paypal.me/opentechlab
Bitcoin: 18CU9LxwRuiLHy9HsuMj2vzobbW4J3QVC2

Наука

Опубликовано:

 

2 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 82   
@andrewchen6226
@andrewchen6226 6 лет назад
The Nyquist criteria applies to the frequency of the signal, not the bitrate. In theory you only need 10MSPS for a 10mbit/s signal, since a 10mbit/s stream of alternating 1s and 0s is actually only a 5Mhz square wave. But then again it's always a good idea to have a much higher sample rate than the absolute minimum.
@OpenTechLab
@OpenTechLab 6 лет назад
+Andrew Chen You're quite right. I've been aware of the error for a while. It's about time I issued a correction
@HalfLife2Beta
@HalfLife2Beta 5 лет назад
A 5 MHz square wave will have a much higher bandwidth than 5 MHz depending on the fall and rise time, and so will resquire much more than 10 MSPS. If we count only 5 first harmonics, the bandwidth is 25 MHz and so the minimum required sampling rate is 50 MSPS : upload.wikimedia.org/wikipedia/commons/5/50/Square_wave_frequency_spectrum_animation.gif
@user-xj8oh6fo2f
@user-xj8oh6fo2f 4 года назад
And you forget keyword “Analog”. But here we deal with digital 1/0. And it’s only matter of edges rise/fall time to be good enough for analyzer inputs to understand the input correctly.
@svideodotorg
@svideodotorg 4 года назад
@@HalfLife2Beta Both of these answers are correct on their own but neither are fully applicable to logic analyzers. While it's true you could get away with 10MSPS, you could only do so with perfect clocking (or using the clock signal on the DUT as a trigger). As soon as the clock of the DUT and your analyzer get a little out of sync, your capture is messed up. The reason we want to oversample with a logic analyzer isn't about the nyquist frequency (which is purely concerned with the analog domain), but rather to make sure we can deal with mis-matched clocks when we don't have a clock signal (or haven't identified it yet) or don't have a way to utilize the DUT clock signal with our analyzer (typical of cheap logic analyzers).
@malgailany
@malgailany 6 лет назад
I really enjoy watching debugging techniques videos. Thanks a lot.
@jenskapmeyer2579
@jenskapmeyer2579 2 года назад
Thank you for letting us have a look over the the shoulder of a real professional. High value content.
@pepperm16
@pepperm16 6 лет назад
Fantastic, well prepared and presented videos. I now want to get Sigrok and play. Thank you.
@adithyayuri
@adithyayuri 6 лет назад
As usual ......informative, detailed ,well thought out video and debugging thought process. Thanks for the video.
@aronszlavik4660
@aronszlavik4660 4 года назад
This is really an eye opening video for hobbyist I think. Thanks a lot! Please make more debugging tutorials with logic analyzer.
@dungtrananh1522
@dungtrananh1522 4 года назад
Greatest explanation I have ever seen about USB debugging. Much appreciated!!!
@simonandrews9629
@simonandrews9629 2 года назад
Brilliant Tutorial , very interesting to see the use of the signal bits moved about the code to narrow down the issue. very neat. An eye openning video from the perspective of someone just considering to use a logic analyser for USB development on a micro controller. usefull in so many ways, from explaining the D+ D- traces , using the decoders right up to the probem solving with the control signals. Thanks very much,
@mounirorfi
@mounirorfi 6 лет назад
Very informative, thanks for taking the time to make this video !
@OpenTechLab
@OpenTechLab 6 лет назад
Thanks for watching!
@rfdave3980
@rfdave3980 6 лет назад
Wow learning so much. Thank you for your channel.
@MrRob176
@MrRob176 4 года назад
Very instructive. I have had lots of issues debugging USB stacks in the past, and using the signal analyser for this task didn't come to my mind. Especially useful with USB parsing 😁
@gabiold
@gabiold 5 лет назад
I have just found your channel and I immediately subscribed after the first video I whatched. Absolutely professional content! All the detail you put in, the easy to follow workflow, progression, the fluid, distraction-free talk is absolutely professional. Keep making videos, you should be at the popularity level of The Signal Path, Marco Reps, LiveOverflow, EEVblog and all the bests I may missed here!
@lmamakos
@lmamakos Год назад
Very nicely presented! I had to chuckle to myself when the debugging process begins as you're explaining how this can't possibly be broken! See, even after I remove my code it's broken 🙂! It's usually this step when the obvious error is exposed, and only the process of explaining exposes it. Here, you found a really interesting problem elsewhere. I really do enjoy watching the "directed problem solving" approach and demonstrating how that's much more effective than just randomly changing things and hoping for the best.. As much as anything else, that's the core lesson to take away when watching this. I found myself here trying to learn how to use sigrok and pulseview, and it was great to see this toolset "used in anger" rather than a contrived demo. Thanks for sharing that.
@programorprogrammed
@programorprogrammed 6 лет назад
Excellent video buddy.
@HeadphoneTarnish
@HeadphoneTarnish 4 года назад
wow, what a fantastic explanation. Loving this channel
@jamesalberi6609
@jamesalberi6609 6 лет назад
Very nice video. Shows the power of debugging software races through hardware techniques when you're close to the hardware. On larger systems where I've worked you're forced into debuggers or worse yet debugging through compilers (printf ugh!) . Heisenbugs become inevitable. Regards jla
@victorpreuss
@victorpreuss 6 лет назад
Excelent video! Really awesome to see the power of open source software, scripts and command line in your videos, thanks
@OpenTechLab
@OpenTechLab 6 лет назад
That's the plan. I think FOSS is way under appreciated for what it can do - which is one of the reasons I started the channel.
@victorpreuss
@victorpreuss 6 лет назад
Very nice initiative. I recently started working more "professionally" with embedded applications and the dependence on complex IDEs and proprietary tools was really starting to bother me. This type of video, for me, is really inspiring :)
@chrisgreece52
@chrisgreece52 6 лет назад
Amazing videos you gained a subscriber i love your videos :)
@rjordans
@rjordans 6 лет назад
Nice to see you using libopencm3, I've started playing around with that myself as well. When setup correctly you can also run 'make flash' directly and have it call openocd directly for you, that should save you a few terminal sessions.
@iforce2d
@iforce2d 3 года назад
Now I know what Neo felt like in the Matrix when he had the training programs downloaded straight into his brain. I enjoyed this immensely, thanks!
@naveenchaudhary8287
@naveenchaudhary8287 Год назад
This is extremely valuable content. I am really sad here because the channel seems dead. Please resume uploading such valuable content.
@AKkarol7
@AKkarol7 2 года назад
High quality content. Thanks !
@mcflapper7591
@mcflapper7591 6 лет назад
Thanks for sharing. I quite like your toolset (esp. tmux and vi ;)
@josemesquita603
@josemesquita603 3 года назад
Nice debug! Thanks for sharing
@itmemo8617
@itmemo8617 6 лет назад
Great video
@QuietWatcherObserving
@QuietWatcherObserving 4 года назад
Another great video, thank you. :)
@chinmoytahbildar3278
@chinmoytahbildar3278 2 года назад
Excellent video sir.. love from India
@renefuller9241
@renefuller9241 Год назад
In the datasheet of the chip there is a timing diagram. Looks exactly like the output of the logic analyzer, the one with the slanted edges. There are time limits on by when you have to have your data ready to send it. And time limits by when you have to have your next bit ready to send. The same goes for getting ready to write the next bit... They are usually written out on the clock pulse, but the data has to be ready a little before. If you (or the code) get it wrong, the state becomes undefined and the Chip kills all communication. All serial communication Chips have the same necessary timing needs, always defined in the datasheet. There is a better way of explaining that I am sure, but that's the gist of it. You were pretty much right on the money with your timing conclusion. EEVblog has a great explanation in one of his videos.
@nicoladellino8124
@nicoladellino8124 2 года назад
Very nice video, TNX.
@user-zp3tc1zx9b
@user-zp3tc1zx9b 9 месяцев назад
In your new printed circuit boards, in design you need to do all possible test points at once, further testing and debugging will become much easier, also in production it will allow you to test the entire circuit almost automatically. I always design two boards, the product itself and the response board with needles, also I often have another controller and the necessary peripherals on it to be able to automatically program and test my products. the same solutions are used by all serious electronics manufacturers.
@iuri.castro
@iuri.castro 6 лет назад
Awesome, as always! A topic suggestion would be to set up an open enviroment for developing with ST and others ARM microcontrollers, I mean, setting the toolchain (GCC), explaining the build process (GCC flags, make) and GDB.
@OpenTechLab
@OpenTechLab 6 лет назад
Certainly could do. If you need a basic project for a template, the demo firmware in the show notes might help. Also, the libopencm3-examples repository.
@iuri.castro
@iuri.castro 6 лет назад
My knowledge today is pretty solid, but it took me a long time digging in the web to find little pieces of information and gluing them together, a pretty demotivating factor for a new guy.
@Eletronicafg
@Eletronicafg 6 лет назад
One tip: With openocd you don't need to specify the absolute path for the cfg scripts, just use these relative short paths: -f interface/stlink-v2.cfg -f target/stm32f0x.cfg
@albertolopez7420
@albertolopez7420 3 года назад
Great video! By the way, what is the name of the multiscreen development environment you are using that allows you to simultaneously have pulseview, editors, etc onscreen?. Thank you
@tablatronix
@tablatronix 6 лет назад
I use nail lacquer and wire wrap wire for secure bodge wires, you can easily remove it with acetone.
@bimmerboard
@bimmerboard 6 лет назад
Terrific work! Can you do a USB tutorial?
@donk8589
@donk8589 3 года назад
really great videos! off topic but how do you display a gui in a tmux pane?
@tolipwen1487
@tolipwen1487 6 лет назад
Nice video's! I like that you support HW I have. I like that you support BTC. ( I dabbled at mining back in the day ) I like that sigrok download page has links to Slackware build info!
@saidgusainov6252
@saidgusainov6252 5 лет назад
Hi, great lesson from you, please tell me how you started DSLogic-Plus in place with the Pulseview program? I downloaded from the official website of Pulseview for Windows 7 and it doesn’t work for me, but my native DSView_v0.9.9 program works fine, but I wanted to work with Pulseview, please tell me why Pulseview doesn’t see my logical analyzer DSLogic-Plus I have to do, thanks.
@klewisjohnson
@klewisjohnson Год назад
Hey where did u go? Really likedyour content
@Mr.Leeroy
@Mr.Leeroy 4 года назад
gold
@Vijayenthirans
@Vijayenthirans 6 лет назад
Amazing video as always? Is it possible to capture the USB packets with 24MHz fx-2 Chinese clones? Or you chose DSLogic Plus Logic Analyzer since it support higher bandwidth?
@OpenTechLab
@OpenTechLab 6 лет назад
+vijayenthiran subramaniam Thanks dude! Yeah 24MHz would be a cutting it a bit close on bandwidth. Also the FX2 logic analyzers are rather unreliable at max speed- they tend to halt if there's even a tiny amount of congestion on the bus
@stefanbruns6209
@stefanbruns6209 6 лет назад
If you stick to low speed (1.5MBps), it works. Full speed will likely not work, you need at least 2.5 oversampling (30 MS/s), better 4 (~50MS/s).
@bruhdabones
@bruhdabones 6 лет назад
how can I use a trigger with my cheap LA? Is it built into the software (PulseView)?
@kuro68000
@kuro68000 6 лет назад
What desktop and terminal is that? Looks nice and I've been wanting to try a tiling window manager.
@OpenTechLab
@OpenTechLab 6 лет назад
Just Linux Mint with tmux running inside gnome-shell, and oh-my-zsh. I never quite felt comfortable in a tiling WM.
@kuro68000
@kuro68000 6 лет назад
OpenTechLab thanks
@tablatronix
@tablatronix 6 лет назад
can sigrok filter? How can i check for non host packets without zooming around ( I cannot seem to zoom on osx with trackpad, it just goes all over place )
@n3r0z3r0
@n3r0z3r0 6 лет назад
Yet another question, what kind of tmux are you using? I quite familiar with terminal one, but you have gui version of it.... which looks fantastic!
@OpenTechLab
@OpenTechLab 6 лет назад
It's just normal tmux, with the PulseView window dragged over the top. If you want to do this "for real" check out some of the tiling window managers like i3. They can be quite complex to set up and learn to use, but they might offer what you want
@n3r0z3r0
@n3r0z3r0 6 лет назад
Smart :)
@salamdrik
@salamdrik 4 года назад
Can you tell me if i understood right or not. You can see packets send and received, but i cant have a device in between USB DEVICE and PC, to record captured packets and replay them to pc simulating me actually doing input on usb device, its not going to work as i cant just spam packets to pc and have same output as if i move mouse on pc or move Joystick ?
@n3r0z3r0
@n3r0z3r0 6 лет назад
Hi, Which IDE are you using under Linux which supports openocd and debugging? I found quite nice STM32Workbench.
@OpenTechLab
@OpenTechLab 6 лет назад
Not an IDE as such. Just tmux to make a split-screen terminal.
@n3r0z3r0
@n3r0z3r0 6 лет назад
Thanks for replying.
@Anonymouspock
@Anonymouspock 6 лет назад
Looks like you like vim. Check out neovim or the new vim 8 feature to multiplex terminals (both of them now have terminal buffers from what I can tell). You can get rid of tmux and be able to yank and paste to terminals which is awesome.
@chriswesley594
@chriswesley594 4 года назад
A gamne of chess, you say? Errr - no thank you. I'm busy. Hahahaha. Smart fellow. Excellent video. Thanks very much indeed.
@user-zp3tc1zx9b
@user-zp3tc1zx9b 9 месяцев назад
Before you start writing code for STM32, first of all you need to familiarize yourself with all the errata datasheet (or even better, familiarize yourself with these at the design stage of the device, otherwise it may cause a new design), on the chip itself and also on the libraries used. They have a lot of errors, sometimes it takes a lot of time to search, and the problem is already described in the documentation.
@boi1996
@boi1996 6 лет назад
Not being weird or anything but ummm i like your voice :)
@yasha8951
@yasha8951 6 лет назад
could please share with us the version of sigrok you are using, i've purchased a DSLogic and haven't be able to use it with sigrok
@OpenTechLab
@OpenTechLab 6 лет назад
+Yasha I've been using the unreleased git version of sigrok. Check the wiki for instructions on how to build from source, or if you're on Windows there's a nightly build
@yasha8951
@yasha8951 6 лет назад
thanks I'll try out that build
@AlexA-qm7pu
@AlexA-qm7pu 4 года назад
By the way, what vim font do you use? 38:49
@OpenTechLab
@OpenTechLab 4 года назад
Source Code Pro (Powerline version) - I've used it for years, and I still love it.
@joedempseysr.3376
@joedempseysr.3376 6 лет назад
Does the little board provide a JTAG interface?
@OpenTechLab
@OpenTechLab 6 лет назад
Just SWD, and they forgot to add a connector, hence why I had to hack it on there.
@IvanEng747
@IvanEng747 Год назад
Hello. I have flash ROM for ground power unit. Boar have microcontroller NXP MK70 family. Plus help me in screening ROM from microcontroller and pls disassembly ROM in usb flash.
@FrodorMov
@FrodorMov 6 лет назад
(WHAT IS THIS.. Just typed a very long reply, accidentally hit "previous page" now its all gone... Anyway, here goes again.....) So this is pretty interesting.. I've been having a seemingly similair issue with something I'm developing on a STM32F072.. Now it's not using libopencm, but ST's CUBE HAL libraries, and I've also added FreeRTOS.. The issue has appeared/disappeared, I thought I fixed it, then I didnt, etc.. You know how it is.. (So I don't recall if it was there before I added FreeRTOS, I think it was, anyway.) Overall I'm receiving data from the PC at about 25 Hz, and also sending at about 25 Hz.. I think the pipe error occured when I wasn't reading or trying to write at about 50 Hz, but did when I tried to make one of my loops actually 25 Hz.. It's been some time ago, so it's all pretty vague.. I kinda dismissed it all since it seemed like the issue wasn't present in the current firmware version. I thank you for this nice video, I can probably copy most of your steps trying to debug the issue in my case.. (Will see how well this'll work with my Logic analyzer, and equipment etc..) Looking at all the wires soldered onto your board, you probably should've added some more pads/things for debugging, no ? :p I've got 5 GPIO's routed to a connector on the board that are completely unused, though I have to admit, I will have to solder wires onto some USB data lines too... I will probably get back to you if I find out what is going on here.. But I don't see myself having anytime soon, unfortunately. Also, is that a 1.25mm to USB Type-A plug cable ? Darn, I need those! (with some strain relief..)
@OpenTechLab
@OpenTechLab 6 лет назад
Thanks for your message. Without having visibility of the USB comms, it's really hard to figure out what's going wrong. As for all the mod-wiring; unfortunately I didn't design the board, otherwise I would have added all that stuff. If you're adding an LA to USB keep the wires short, and maybe check the the LA doesn't cause signal integrity issues with a scope.
@FrodorMov
@FrodorMov 6 лет назад
Cheers. You know I was actually looking into buying a DSLogic but there's something weird going on.. Their website doesn't seem to be updated for ages, nothing official mentions the DSLogic Plus, ebay has some for various prices (looks like some don't have 256M but way less memory), different connectors (1 bar of pins, or an intermediate old iphone connector in between, and the new one).. Lack of official support should be alright given Sigrok as alternative, but its all strange. I was going to buy one of the cheap combo's on ebay with a DSLogic+Scope for about 80USD (which seems to have the newer DSLogic Plus in it, or atleast given the right seller, judging by the pictures)
@edgeeffect
@edgeeffect 6 лет назад
Hi Joel... I've just got hold of a wad of software that'd be brilliant if you covered it here. I've got hold of an AVR simulator ( github.com/buserror/simavr ) and a nice GUI for it to live in ( sourceforge.net/projects/simutron/ ) After taking a cursory glance it looks brilliant 'cus you can debug AVR code using GDB on Linux and not having to mess around with that nasty Windows stuff. But, even though I'm no stranger to GCC, I've shied away from the likes of GDB and QEMU and such like... So I'm here saying "looks nice but what the hell do I do". There looks like there's some coverage on RU-vid but, y'know, there's two kinds of RU-vid and there's more of "the other sort" than there is of "the good stuff".
Далее
[001] Sigrok and Logic Analyzers
1:12:06
Просмотров 213 тыс.
DO NOT Dunk Here ❌🏀
00:20
Просмотров 6 млн
I SIMULATED THIS EURO 2024 GAME.. 🤯
00:13
Просмотров 3,5 млн
[009] DSLogic Logic Analyzer Review and Teardown
46:09
[014] IcoBoard Software Defined Radio Project - Hardware
1:01:11
Logical Analyzer from Aliexpress, Saleae Logic Clone
9:57
USB low level debugging, feat. sigrok and OpenVizsla
20:46
Michael Ossmann: Simple RF Circuit Design
1:06:21
Просмотров 251 тыс.
[008] Prototype Enclosures with FreeCAD & OpenSCAD
43:14