Hi all, I've got the firmware building and have been doing some minor tweaking on my own. Here are some instructions for others that may want to get this going:
Overview: There are two pieces of firmware, one for the AVR chip and one
for the STM32 chip. There is a program that combines these into a
single file that can be uploaded to the unit. If you take the stock
sources, you will need to have Eclipse, Visual Studio, and Atmel AVR
studio installed, along with GNU ARM toolchain, and gnu make. I've made a
fork of the repos that reduces the requirement to Eclipse, and the AVR
and ARM toolchains. My plans for this fork are mainly to tinker with the
code and try different things out.
1. Install Eclipse Juno CDT (You could install a later version, but this is the version I have working)
2. Install the Eclipse GNU ARM plugin. Go into the help menu, Install new Software, add a site:
http://gnuarmeclipse.sourceforge.net/updates. Then check the box to install that plugin.
3. Download and install the GCC ARM toolchain
https://launchpad.net/gcc-arm-embedded/+download4. Download and install gnu make:
http://gnuwin32.sourceforge.net/packages/make.htm5. Download and install Atmel AVR toolchain from
http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx (you don't need the headers package)
6. Ensure that the bin directory from 3, 4, and 5 are on the path. I
made a batch file that adds these 3 bin directories to my path and
launches eclipse.
7. Fetch the LXR sources from github. You can
either install git and do it the git way, or download a zip and unzip
it. The sonic potions git site is
https://github.com/SonicPotions/LXR or you can fetch from my repos
https://github.com/rudeog/LXR (my repos has some fixes that might save some effort, and I plan to
keep it synced with the other, or hopefully get my fixes merged into the
other, see below)
If you got the repos from rudeog, follow with these steps:
8. In Eclipse, create a workspace in root folder of whole tree that you unzipped (or git'd).
9. Add two project dirs mainboard\firmware\DrumSynth_FPU
and front\AVR to the workspace. To do this, use
File/Import/General/Existing projects into workspace. Then select root
directory and browse to these dirs. Do this step once for each of these
two dirs. You will end up with two projects in your workspace.
10. These should build. Eclipse is a bit squirrely, so you might need to
do a make clean first to create the first makefiles, or rebuild
indexes.
11. I've built the firmwareimagebuilder.exe in the \tools\bin folder. I've also put a batch file that launches it and copies
the binaries from the respective output directories to create
FIRMWARE.BIN in that same dir. If you don't trust the .EXE I built, you
will need to build it from tools\FirmwareImageBuilder\FirmwareImageBuilder.
As is you will need visual studio. If you don't have it, you can try to
install the free version, mingw, etc and compile the one file
FirmwareImageBuilder.cpp (I've fixed it so it should build with any
tool) and make your own exe and copy it to that dir.
12. Thats it, after running the batch file you will have your firmware file.
If you got the sources from SonicPotions, you will need to install AVR Studio for the AVR project. You can download this from
atmel.com.
It involves installing .net, and a few other things. At that point, you
will have the AVR project which you should be able to build. You will
need to recreate the Eclipse project for the mainboard (unless Julian
has added this project to his repos at some point). I won't get into how
to do this. You might want to grab 2 files from the rudeog repos which
are .cproject and .project in the DrumSynth_FPU folder and put them in
that location to save you some time. Then create an eclipse workspace
that has that project (see step 9 above but just do it for the
DrumSynth_FPU project). At this point you will need to build
FirmWareImageBuilder, and will need Visual Studio. Once built, Julian
has a bat file called makeFirmware.bat in the Debug dir which can be
run.
Comments
The most recent change I made was to change the note parameter to display actual note names (like C#) instead of a number. If you want to see how simple it was, look at this link. The green shows the additional code:
https://github.com/rudeog/LXR/commit/876255ba5f62f9929251b0d5d86176143f3da060
I'm currently in the middle of a big code mess due to a new feature.
When things are sorted out i'll try to include you additions.
thanks a lot for the fixes and the lengthy explanation!
It's been a while but I don't think there are special visual studio features used.
In the end it's just a little bit shuffling.
@julian The firmware image builder has some minor changes to make it work with gcc (remove the stdafx.h and change the tchar and tmain stuff to char and main).
@mokomo I believe the second dimension controls the characters on the line and the first dimension is for which line (0 or 1), so you might try something like this (I haven't tried this):
editDisplayBuffer[0][(activeParameter%4)*4] -= 32;
editDisplayBuffer[0][((activeParameter%4)*4)+1] -= 32;
editDisplayBuffer[0][((activeParameter%4)*4)+2] -= 32;
I think the inverted background color will be difficult (but not impossible) because the display unit itself is character based (that is to say you can only send characters, and you can't directly access pixels). I think the all uppercase letters is a good idea though, so I might try the above as well to see how it looks next time I burn a new one.
If you want to fork my repos and make the fixes (change slashes and case in the #include lines), and submit that as one commit, I will be happy to merge it into my repos.
Also, if you come up with a good full description of building on linux (I assume you are using ubuntu?) I'll be happy to add it to my description. Julian should be merging my stuff in soon, so we can eventually have an official repository which can compile on all platforms. Another user is trying to get it going on mac as well.
The mk files are automatically generated by eclipse, so probably best to not modify them. Once you get the eclipse build settings sorted out, it's all easy street. Eclipse is cool too because it speeds up the workflow with coding, compiling and checking errors etc. Although it might be good to have a pure makefile build to lower the barrier for people to get it compiling (less to install and configure). I think it should be able to sit alongside the eclipse stuff with no problem. We are not maintaining a file list in eclipse (and actually the files are all pretty much the same files now as when I started looking at this). That means it should be pretty easy to maintain a makefile as well as the eclipse workspace.