Coder Social home page Coder Social logo

logicalnucleo's Introduction

LogicAlNucleo

A SUMP compatible Logical Analyser for the NucleoF401RE (STM32F4xx) almost up to 10MSPS, 8Ch, 32K samples memory.

This will turn any NucleoF401RE (will work with other boards but it was not tested) system into a Logical Analyser compatible with a subset of the SUMP protocol. It can be used with clients such as PulseView, sigrok-cli, and LogicSniffer. While it is not as feature complete as other products, such as the OLS, it can turn that STM32 board that is lying around into a no frills, bare to the bones, logic analyser.

Sampling rate up to 500KSPS should work on most platforms. Higher than that, only the F401RE, or other similar >84Mhz platform should provide results with accurate timing measurements up to 5MSPS. 10MSPS will be accepted but do not trust timing information as the board cannot really keep up with this speed. However this sampling rate can still be usefull. If you wish to add support for other platforms, please focus in creating the appropriate unrolled loops callibrated with an osciloscope.

PORTB is current used, and Pins PB_0 to PB_7 are reported. Unfortunately these pins are scattered over the board and are not contiguous. Check this diagram to find them.

This implementation was based in the mbed environment in order to increase its compatibility, as new targets are expected to be supported. The focus of this implementation is compatibility and extensibility, and not only performance.

Features

Supported

  • Configurable sampling rate up to 10Mhz on the F401RE platform
  • Basic parallel triggers
  • Generic compatibility with other platforms through the MBED API
  • Test mode where PWM signals from 1us to 500ms will be generated and then captured. You can use this mode to test the accuracy of each mode.

Planned

  • RLE support
  • Serial triggers (for speeds lower than 1MSPS)
  • Post trigger delay
  • External test modes

Limitations

  • Reaching 10MSPS requires the use of synchronous code (instead of a much better asynchronous, interrupt based approach, yet slower). If the sampling function is waiting for results or for a trigger, the board will be "stuck" waiting. Just push the reset and move on as nothing is wrong. The Green LED will be active if the board is waiting for the acquisition process to finish.

Screenshots

Just to prove it works and because screenshots are always nice.

alt text

Download

Get the source code from github and compile it using the ARM toolchain available from the Launchpad page. If you have the toolchain available, the Makefile will take care of all compilation and linking.

In alternative you can also use the code in mbed. Just load the code without the mbed directory.

Finally download the latest precompiled binary from the releases web page and flash it. The binary file suits the NUCLEO-F401RE board.

logicalnucleo's People

Contributors

jpbarraca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

logicalnucleo's Issues

Capture failed

Hi, @jpbarraca nice work on making the NucleoF401RE more useful :)

I'm having trouble with the capture on LogicSniffer and keep getting "Capture Failed". When I looked at your code, it seems that there's no function to return the captured value from inside Sampler.cpp. I later found this

        case SUMP_ARM: {
            sampler.start();
            break;

and changed sampler.start() to sampler.arm(), got it working once, but after that it failed to capture again. The board appears hung after I start capture. If I stop the capture and click Show Device matedata, it will fail. Using console showing that the board is not replying at all. Any idea where to look?

Why aren't you using DMA and timer for acquisition and instead timing by using nop?!

I got linked this by someone looking at F401RE-NUCLEO

I knew this was going to be a mess when files were ending with .cpp, but I was not prepared for the mess that I saw inside sampler.cpp.

Did you know pretty much every STM32 has GPIO DMA which can be triggered from a timer? You setup GPIOx->IDR as src, whatever memory buffer as dst, and each timer tick would transfer the data. With ACCURATE timing.

How to make PulseView work?

Hello, there, did you ever try this on PulseView?

I dont know what I am doing wrong but I am trying to make my STM32F407 be a logic analyzer, at first I tried flashing this on it but no usb2serial device was ever created ((I am using StmCubeIde, never used mbed so I dont realy know what I am doing with mbed (am on windows so I dont even have required toolchain to build this, so as a PoC it would probably be easier to do it on STMCube first

Then I found this: http://slemi.info/2018/03/26/stm32-logic-analyzer/

Which has some prebuilt firmware: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/logicdiscovery/LogicDiscovery.bin

But this is also using some wierd enviroment (its not importable into STMCubeIde), so again I cannot debug or tweak it

But at least this one showed as USB2serial device and was detected in PulseView, but then I got no logic trace (I did hit Run and stop multiple times but no dice), I tried every pin on PD io (PD1-16), and I tried to simulate logic with button press (connecting wire from eather PD1 to GND or 3V to simulate logic), but nothing, trace was always empty, so I am suspecting that I am not configuring my PulseView right

slika

So I am trying to get my baseline right but I guess I am failing somewhere but dont know where....

Also tried LogicSniffer: https://lxtreme.nl/projects/ols/

But this program doesnt even start on my windows machine

So the question is: if you have a working firmware (which I think I do, I cannot verify that),, how do you configure your SUMP client to see some logic (because right now I only see a blank trace)?

Thanks for Anwsering and Best Regards

mbed Project

Any chance you can share this in the mbed dev site? I would like to try it with the STM32F411RE and would be easier to just compile it online.

Thanks.

What about analog aquisition?

Hi JP, nice project!
would it be possible to also make it work as an analogue sampler?

I will keep watch this project progress!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.