Skip to content

Linux build instructions

Paul Warren edited this page Feb 1, 2021 · 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
  • Some distributions (notably Ubuntu 14.04) additionally need to install the libstdc++-arm-none-eabi package. For Ubuntu 14.04 it's available from http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libstdc++-arm-none-eabi/libstdc++-arm-none-eabi-newlib_4.9.3+svn227297-1+8_all.deb (Thanks to @sanamon)
  • 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 Eclipse Embedded
  • Install the Eclipse Embedded C/C++ package, accepting the license if you find it agreeable
  • Restart eclipse
  • 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 I had set my box up with git over SSH and using that URL just worked
  • Once it's imported, right click on the PSDR root in the Project Explorer, then Properties, expand out "C/C++ Build" and select "Tool Chain Editor". Update the "Current toolchain" to "Cross GCC" I had to untick and retick "Display compatible toolchains only" And leave the "Current builder" option as CDT Internal Builder. Click "Apply"
  • Now you can click the Hammer icon or "Project -> Build All" to build the project. It should build with 0 errors and a significant number of warnings.

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.