Setting up a complete SDK
WORK IN PROGRESS
- Basic understanding of the command line
- Basic understanding of compilation/linking procedures and programming
- Some experience with compiling and installing software on unix-likes
- Knowing how to use your package manager
- A little experience using cmake (optional but very useful later on, and highly recommended for building your own software)
A little warning
This WILL NOT COMPILE SOFTWARE THAT WAS WRITTEN FOR THE VANILLA CASIO SDK. You can only compile things using third-party libraries that do not depend on the original headers or library, such as MonochromeLib or Revolution-fx.
To build software for the CASIO fx-9860G series, you need various tools:
- A compiler
- A library containing implementations of various functions (sort of like the standard C library, but it doesn't implement the whole C standard, and it adds some functions specific to the calculator)
- A tool that will turn the code that has been compiled and linked to the library from a universal format (like ELF, which we will be using) to an addin
fxSDK-ng is an attempt to provide the latter: the library and the addin tool. This tutorial will explain how to set up a complete set of tools, however, including the compiler.
If you have any trouble with any of the steps here, feel free to contact me. I appreciate any info as to what might go wrong so that I can improve this tutorial for future users :)
The process requires quite a few pieces of additional software. Here's a quick convenient list of everything:
Standard compilation tools, as found in the build-essential package on ubuntu, for compilation steps everywhere flex - for crosstool-ng bison - for crosstool-ng gawk - for crosstool-ng ncurses - for crosstool-ng automake - for crosstool-ng gperf - for crosstool-ng libtool - for crosstool-ng git - for various downloads cmake - for G1A wrapper and libfxsys
One-liner to install all this crap on ubuntu:
sudo apt-get install build-essential flex bison gawk libncurses5-dev automake gperf git cmake libtool
On other distros, use your friendly local package manager and its search function. They should all be included in most relatively complete distros.
I will remind you of the requirements in the sections about the individual components in case you prefer to install them as they are needed.
I used Crosstool-NG (CT-NG) to build my toolchain. CAREFUL: 1.9.3 is not the latest version! At the time of writing, 1.18.0 is (18 > 9) :).
You will need:
flex bison gawk ncurses automake gperf
To compile and install CT-NG (once downloaded and unpacked, and CD'd to the appropriate directory):
./configure make sudo make install
Once you have installed CT-NG, you can start making your toolchain.
The actual toolchain
I'm still waiting to find out how I can get my configuration included in CT-NG. Meanwhile, you can put the following in a file called ".config" (in some directory where you want to put the configuration for the compiler toolchain:
CT_ARCH_BE=y CT_ARCH_sh=y CT_TARGET_VENDOR="casio" CT_LIBC_none=y
ct-ng menuconfig to adjust anything else that might interest you (careful with changing things! It may well break the build! The settings I have provided should work without modification). This may include the installation path (I do not recommend installing to /usr, /usr/local, and the like. The default is quite sensible if you're ok with it being on your home partition).
ct-ng build to download the sources, build the toolchain and install it to the prefix which you may have specified in the menuconfig stage. If you didn't specify one, it defaults to
You need to have the directory containing the executables (gcc, ld, ar, etc) in your PATH for building the library (and your own stuff). Add it using
export PATH=$PATH:$HOME/x-tools/sh3eb-casio-elf, substituting the correct path if necessary, of course. You may want to copy this line into your bashrc or into a script which you can quickly source so that you can add it quickly whenever you intend to program.
The G1A tool
This is probably the very simplest to build. You need only the omnipresent compiler (for your machine) and cmake.
git clone https://github.com/Anonymooseable/C-G1A-Wrapper.git cd C-G1A-Wrapper mkdir build cd build cmake .. make
At long last, building your projects
Compiling addins written for the original CASIO SDK is not yet possible, sorry. I'm waiting to hear from someone concerning a reimplementation of the standard library shipped with the original SDK from CASIO.
Compiling stuff basically comes down to this: http://sourceforge.net/apps/trac/fxsdk/wiki/UsingGCC . I will provide a sample project with a CMakeLists.txt soon.