Building firmware with gcc

UPDATE: It works. The build instructions are maintained on the DSO wiki: http://garden.seeedstudio.com/index.php?title=DSO_Nano (in the Developer’s corner).



Status: Compiling and linking works fine. However, nothing works when I try to run it :frowning: Anyway, for those who want to work on this and hopefully fix it, here are the steps to build APP and LIB. First of all make sure you have your ARM toolchain in your path. Then get the code and build the APP:
</s>git clone git://gitorious.org/dsonano/dso-firmware.git dso-firmware cd dso-firmware git fetch origin gcc # only needed on older git versions git checkout gcc cd DS0201_APP/project/gcc make<e>
Now comes a manual workaround until we have fixed the lib->app jump. First find the reset vector (start address) of the APP:
</s>hd dso-app.bin | head -1<e>
This list the start of the vector table, we are looking for the reset vector in bytes 5-8, written backwards, in my case:

00000000 00 50 00 20 91 18 01 08 d1 18 01 08 d1 18 01 08 |.P. …|

From the above, this would be 08011891. Now enter this address as APP_START (instead of 0800C121) in the LIB:
</s>cd ../../../DS0201_LIB/project/gcc vi ../../source/ASM_Function.s<e>
So it will look like this in my case:
</s>__APP_Start ;void __APP_Start(void) B 0x08011891<e>
Then compile the LIB:
</s>make<e>
Use the ST DFU File Manager / Demo program or the DfuSe-enhanced dfu-util to flash the LIB and APP binaries to your DSO.



To update your tree from the git repository at a later point, just run:
</s>git pull<e>