Giter Club home page Giter Club logo

addressintercept-example-uart-dma's Introduction

Address Intercept example UART-DMA

Habrahabr articles https://habr.com/ru/post/433504/ & https://habr.com/ru/post/434080/

This is an example of using AddressIntercept technology to control microcontroller periphery from a host PC. The example tunes periphery of microcontroller STM32F103C8 , namely, UART1, UART2, DMA and GPIO LED (PC13 pin). Then UART1 sends byte message and UART2 receives it using DMA. Also the led blinks. At the end, received and sent message are checked.

Here ​Standard Peripherals Library​ is applied for high-level interaction with MCU periphery. Thanks to AddressIntercept , we can use this MCU library on a host PC. There is nothing that can prevent linking any library from the host PC.

My test stand alt text

The green board is a Linux machine where OpenOCD server was ran. You can run an OpenOCD server on host PC if you use another local USB JTAG/SWD adapter (example st-link, jlink, etc) The blue board is a bluepill. I connected Tx UART1 (PA9 pin) with Rx UART2 (PA3 pin) using the white wire.

Let's build and run this example... My host PC is Ubuntu 16.04 64-bit and the test stand above (JTAG/SWD adapter and prepared STM32F103C8 (PA9 pin connected to PA3 pin).

А simple way:

  1. Download pintool v3.7
  2. Unpack archive
  3. cd pin-3.7-97619-g0d0c92f4f-gcc-linux/source/tools/
  4. git clone [email protected]:ser-mk/AddressIntercept.git
  5. cd AddressIntercept
  6. make TARGET=obj-ia32 # If you have 64-bit system, need to install some 32-bit packets
  7. git clone [email protected]:ser-mk/AddressIntercept-example-UART-DMA.git
  8. cd AddressIntercept-example-UART-DMA
  9. make
  10. cd - # to pin-3.7-97619-g0d0c92f4f-gcc-linux/source/tools/
  11. mkfifo in.fifo out.fifo
  12. python3.5m OCDclient.py -ip $IP_YOUR_OPENOCD_SERVER &
  13. ../../../pin -t obj-ia32/addrIntercept.so -- AddressIntercept-example-UART-DMA/test.elf

and we'll have: alt text

Article in Russian Language https://habr.com/post/434080/

addressintercept-example-uart-dma's People

Contributors

ser-mk 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.