Skip to content

Linux build instructions

Paul Warren edited this page Jan 3, 2017 · 6 revisions

Get Eclipse going

  • Install gcc-arm-none-eabi: sudo apt-get install gcc-arm-none-eabi, or download from https://launchpad.net/gcc-arm-embedded/4.7
  • Install OpenOCD: sudo apt-get install openocd
  • Download the latest Eclipse for C/C++ dev from https://eclipse.org/downloads/packages/
  • Once installed go to the Help -> Eclipse Marketplace and search for Gnu Arm
  • Install the Gnu Arm package, accepting the unsigned contents
  • Restart eclipse
  • Again from the marketplace, install Egit
  • Go to the github URL: https://github.com/MichaelRColton/PSDR and fork the project
  • File -> import -> Git and add the git URL for your forked repo (May be more to do here, will check in a few hours)
  • Now you can hit "Build All"

You should end up with PSDR/Source/Debug/PSDR.hex which is the firmware to load

Get ST-Link going

To load it we need to install ST-Link

    git clone https://github.com/texane/stlink.git
    cd stlink
    mkdir build; cd build; cmake ../
    make -j4
    sudo make install
    sudo ldconfig

Loading firmware

Then you can load the firmware to the PSDR by connecting up the ST-Link v2 dongle as specified in Kickstarter Update #29:

Connect the PSDR programming header (the 5 pins near the speaker) starting from the left when the PSDR is facing you,

  • The first pin (+) connects to pin 8 on the ST-Link,
  • The next pin (CLK) connects to pin 6,
  • The next (-) to pin 4,
  • And the fourth (IO) connect to pin 2.

The fifth pin on the PSDR, and all the other pins on the ST-Link do not need to be connected.

Now you can flash it with:

st-flash --format ihex write ~/workspace/PSDR/Debug/PSDR.hex

Other notes

I've not been able to install the Zylin Embedded CDT into eclipse, it's not in the marketplace, and the current version as at 2016-12-31 doesn't work with the latest eclipse. I think that's for when you need to run GDB over the running code directly on the PSDR. It's not needed to compile a working firmware.