Linux Uzebox how-to
Re: Linux Uzebox how-to
Well, 35$ is relatively cheap compared to programmers for other families of MCUs. And the AVRISP is perfect for Uzebox and Arduino and pretty much all projects using AVRs. It's a good investment IHMO.
-Uze
-Uze
- martinsustek
- Posts: 117
- Joined: Sat Apr 30, 2011 11:34 am
- Location: Ostrava, Czech Republic
Re: Linux Uzebox how-to
I use http://www.simpleavr.com/avr/vusbtiny, built on protoboard. It's cheapest programmer that I know (under 5 USD I think) and it's very simple to build. It uses USB which is more common on modern PC's than parallel port. It works with avrdude, I've programmed my Uzebox by it without problem (ok, there were some issues but not caused by this programmer).
The only trap is, that you must program that ATTiny (with another programmer), I've personally used my old DIY parallel programmer on my old computer, you may find some service to do it. Secondly it cannot do high voltage programming, so you must pay attention not to brick programmed chip by something like disabling reset pin or in system programming feature, because this programmer can't undone it (non of these setting is requred for Uzebox).
The only trap is, that you must program that ATTiny (with another programmer), I've personally used my old DIY parallel programmer on my old computer, you may find some service to do it. Secondly it cannot do high voltage programming, so you must pay attention not to brick programmed chip by something like disabling reset pin or in system programming feature, because this programmer can't undone it (non of these setting is requred for Uzebox).
Re: Linux Uzebox how-to
I'm an Ubuntu/Debian fan who has played with uzebox off and on over the past year. I upgraded to a new machine, loaded linux, and wanted to get the new uzebox kernal for development. While finding the equivalent packages in apt is not difficult, I thought I would post the adjusted procedure for the benefit of others.
Works like a champ.
Cheers!
Code: Select all
svn checkout http://uzebox.googlecode.com/svn/trunk/ uzebox-read-only
sudo apt-get install gcc-avr gdb-avr libsdl1.2-dev avrdude avr-libc
make
Cheers!
- nitrofurano
- Posts: 38
- Joined: Wed Apr 15, 2009 11:10 pm
- Location: Porto, Portugal
- Contact:
Re: Linux Uzebox how-to
awsome! you are saying you are compiling .c sources of Uzebox games on Linux? this is awesome! could you help sharing some tutorial (like at Uzebox wiki page), or some directions for how can we do that? really thanks a lot, you can't imagine how this can hugely help us all, Linux users!ror wrote:I'm an Ubuntu/Debian fan who has played with uzebox off and on over the past year. I upgraded to a new machine, loaded linux, and wanted to get the new uzebox kernal for development. While finding the equivalent packages in apt is not difficult, I thought I would post the adjusted procedure for the benefit of others.
Works like a champ.Code: Select all
svn checkout http://uzebox.googlecode.com/svn/trunk/ uzebox-read-only sudo apt-get install gcc-avr gdb-avr libsdl1.2-dev avrdude avr-libc make
Cheers!
Re: Linux Uzebox how-to
All the kernel, demos and tools makefiles are compatible, all you have to do is install the avr toolchain (avr-{binutils,gcc,libc} on archlinux), compile gconvert and packrom and copy the binaries to a directory that's in your PATH. All the rest should just compile using make.nitrofurano wrote:
awsome! you are saying you are compiling .c sources of Uzebox games on Linux? this is awesome! could you help sharing some tutorial (like at Uzebox wiki page), or some directions for how can we do that? really thanks a lot, you can't imagine how this can hugely help us all, Linux users!
Re: Linux Uzebox how-to
I cannot compile this sadly. I have installed build-essential, libsdl1.2-dev, avr-libc, binutils-avr, gcc-avr, gdb-avr and avrdude which is all I need as far as I know. In the terminal I ran:
This outputs:
Checking over the Makefile in tools/uzem I noticed the line that reads CC was set to g++. Switching this to avr-gcc results in:
I could not get the Makefile that was in this thread to work either.
Code: Select all
svn checkout https://github.com/Uzebox/uzebox/trunk
cd trunk
make
Code: Select all
make -C tools/uzem DEST_DIR=[redacted]
make debug
=================================
Building Debug...
Platform: Unix-LINUX
=================================
g++ -c uzem.cpp -o Debug/uzem.o -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DLINUX -D_GNU_SOURCE=1 -DGUI=1 -DJOY_ANALOG_DEADZONE=8192 -g -MD -MP -MF Debug/uzem.d -DUSE_PORT_PRINT=0 -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
In file included from avr8.h:34:0,
from uzem.cpp:25:
SDEmulator.h: In constructor ‘SDEmu::SDEmu()’:
SDEmulator.h:134:30: error: ‘memset’ was not declared in this scope
memset(&toc, 0, sizeof(toc));
^
In file included from uzem.cpp:25:0:
avr8.h: In constructor ‘avr8::avr8()’:
avr8.h:286:33: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sdImage(0),emulatedMBR(0)
^
uzem.cpp: In function ‘int main(int, char**)’:
uzem.cpp:61:59: warning: too many arguments for format [-Wformat-extra-args]
#define printerr(fmt,...) fprintf(stderr,fmt,##__VA_ARGS__)
^
uzem.cpp:181:13: note: in expansion of macro ‘printerr’
printerr("Error: HEX file already specified (too many arguments?).\n\n",heximage);
^
uzem.cpp:61:59: warning: too many arguments for format [-Wformat-extra-args]
#define printerr(fmt,...) fprintf(stderr,fmt,##__VA_ARGS__)
^
uzem.cpp:191:9: note: in expansion of macro ‘printerr’
printerr("Error: invalid port address.\n\n",uzebox.gdbPort);
^
make[2]: *** [Debug/uzem.o] Error 1
make[1]: *** [all] Error 2
make: *** [tools/uzem] Error 2
Code: Select all
make debug
=================================
Building Debug...
Platform: Unix-LINUX
=================================
avr-gcc -c uzem.cpp -o Debug/uzem.o -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DLINUX -D_GNU_SOURCE=1 -DGUI=1 -DJOY_ANALOG_DEADZONE=8192 -g -MD -MP -MF Debug/uzem.d -DUSE_PORT_PRINT=0 -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
In file included from uzem.cpp:25:0:
avr8.h:30:18: fatal error: vector: No such file or directory
#include <vector>
^
compilation terminated.
make[1]: *** [Debug/uzem.o] Error 1
make: *** [all] Error 2
Re: Linux Uzebox how-to
I can't help on linux alas. For sure you can't use avr-gcc to compile the tools.
Are you trying to compile everything? The tools (like uzem, gconvert, etc) with also need GCC for the intel target. So you need both tool chains. On Windows I use MinGW.
Are you trying to compile everything? The tools (like uzem, gconvert, etc) with also need GCC for the intel target. So you need both tool chains. On Windows I use MinGW.
Re: Linux Uzebox how-to
I've solved the problem. I will post the steps I took in case anyone else has problems. Uzem fails to compile because there's a file that needs an include. SDEmulator.h needs "#include <string.h>" in order to compile. It is also necessary to manually make a "bin" directory and a "roms" directory as the Makefile makes use of them, but they don't exist. These folders should be at the "root" of the project.
Re: Linux Uzebox how-to
I see. I will add the include to SDEmulator.h. Dunno why it does not work for you, seems to work fine on Windows. We should modify the makefile to create those directory. Are you good at makefile? If you can fix it I'll add it to the trunk.
Re: Linux Uzebox how-to
I looked online. It seems that the problem with SDEmulator.h is due to a change in GCC. It's my first time modifying a Makefile, but I tested it thoroughly and it works. I changed lines 60, 61, 109, 114, 126 through 129 and 141. I removed the "cleanall" target, as running "make help" did not even show it was an option. The way it was in the original all the "rom" files would be left behind.
The notice at the top might have to be changed slightly. For all I know, the way I did this might be considered horrible practice.
The notice at the top might have to be changed slightly. For all I know, the way I did this might be considered horrible practice.
- Attachments
-
- Makefile.zip
- Modified Makefile
- (1.41 KiB) Downloaded 734 times