Giter Club home page Giter Club logo

spi-sniffer's Introduction

SPI sniffer project

  • Board: NUCLEO-L432KC, but should work on any STM32L4 board (and any STM32 with slight modifications)
  • Pins used:
    • PB4 (D12): SPI MISO
    • PB5 (D11): SPI MOSI
    • PB6 (D5): SPI CLK
    • PB7 (D4): SPI NSS
  • Serial baud rate: 2 000 000 bits/s

Project Purpose

This project is built to connect to an SPI network and process any data sent through it in a transparent way. It's useful for debugging SPI device issues.

Important Notes

  • Set your SPI speed to a really low one. Since a lot of data needs to be transferred via UART, decreasing the speed of your SPI network makes sure that all bits are caught in time.
  • This project currently supports SPI mode 0 (CPOL=0, CPHA=0).

Details

  • This project was built in STM32CubeMX for the Atollic TrueStudio IDE. If you load the project in STM32CubeMX, you can export it to use any other IDE of your choice.

  • This project sets the processor clock to 80 MHz, the highest one achievable, so that the SPI data can be processed as fast as possible.

  • The serial output contains colours. If your terminal doesn't support colours, you might see garbled characters.

  • USART2 is used to output the data. The NUCLEO board will automatically send this data over USB. Alternatively, you can connect an FTDI232 USB-to-Serial converter on pin PA2 to receive the data. Note that you have to use a converter that supports a baud rate of 2 Mbits/sec.

    The command I used to open the terminal on linux was:

    minicom -c on -R utf-8 -b 2000000 -D /dev/ttyACM1
  • The HAL driver is used, but all the necessary driver files are included in the Drivers folder.

Important files

  • Src/main.c: The source code of the project
  • spi-sniffer.ioc: Open this file inside STM32CubeMX to edit the project.

Screenshot

SPI Sniffer serial output screenshot

spi-sniffer's People

Contributors

kongr45gpen avatar

Watchers

 avatar  avatar

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.