Giter VIP home page Giter VIP logo

opendnp3msp432's Introduction

OpenDNP3 on TI MSP432

This project tries to run OpenDNP3 on a Texas Instruments MSP432P401R Launchpad acting as an outstation. This merely a test, but the code is shared here in response to this issue.

How to build

CMake is used to generate the makefile this project. The project uses the GCC compiler, because I couldn't make it compile with TI's compiler. Since it involves cross-compiling, it is a bit more complicated to use. Follow these steps and you should be fine.

  1. Download and install the latest GCC Package for the MSP432 from TI's website. Be sure to download the MSP432 package, not the MSP430.
  2. Download the latest GNU ARM Embedded Toolchain and extract it in the arm_compiler directory inside the TI package directory.
  3. Clone this repository using git clone --recursive https://github.com/emgre/opendnp3msp432.git. The recursive flag is mandatory in order to download OpenDNP3.
  4. Create a build directory, cd into it, then run cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="../msp432-toolchain.cmake" -DTI_INSTALL_DIR="/path/to/TI/msp432_gcc/" .. where you change the path to the TI folder for the appropriate one, and change the generator according to your platform (this code was only tested on a Windows machine, that's why the generator is a MingW makefile. On a Unix system, "Unix Makefiles" should be the right generator). If CMake complains about not finding the make program (if you haven't set it in your PATH variables), you can specify it by adding -DCMAKE_MAKE_PROGRAM="path/to/make".
  5. Run the make in the build directory to compile the executable.

Debugging

To debug, follow the steps in the doc file available from TI. Briefly, it involes doing:

  1. Installing the required drivers for the MSP432 Launchpad.
  2. Connecting the MSP432 Launchpad to the computer.
  3. Run gdb_agent_console -f MSP432 xds110_msp432_jtag.dat from INSTALL_DIR/emulation/common/uscif.
  4. Run arm-none-eabi-gdb "path/to/OpenDNP3.out".
  5. In GDB, run target remote :55000, load (this takes a while...), monitor reset. Then, you're good to go. The standard GDB commands are available.

Note that the GDB agent made by TI does not specify the memory map. Therefore, placing breakpoints will fail because the code is executed from the Flash and GDB tries to insert software breakpoints. In order to force it using hardware breakpoints, you can do mem 0 0 ro to specify that all the memory is read-only. A proper memory map could help you modify variables at runtime.

How to run

Simply build and flash the MSP432, then connect a master DNP3 on serial port COMx (mine is COM3) with a baudrate of 9600 and standard UART settings. The master link layer address is 1 and the outstation link layer address is 1024. I personnaly used the master demo of OpenDNP3 and modified 2-3 lines to get it running with the desired settings.

opendnp3msp432's People

Contributors

emgre avatar

Stargazers

 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.