Zu 1: Der Arduino UNO SMD R2 läuft auch mit 16mhz.

Zu 2: Da hab ich wohl etwas übersehen. Leider bekomme ich immer noch einen Fehler, wenn ich es genauso wie beschrieben mache.

Code:
whiteapple:myCProject jan$ /Users/jan/haikuVM/bin/haikulink -v --Config arduino -o BlinkWithThread.hex /Users/jan/haikuVM/examples/src/main/java/arduino/tutorial/BlinkWithThread
#
#
#
#############################################################
# generating c files
#############################################################
included; haiku.avr.lib.arduino.HaikuMicroKernelEx.main([Ljava/lang/String;)V
included:   haiku.avr.lib.arduino.ArduinoLib.init()V
included:     haiku.avr.AVRDefines.sei()V
included#       haiku.avr.AVRDefines.<clinit>()V
included:     haiku.avr.AVRDefines._BV(I)I
included:   haiku.vm.MicroKernel.clinitHaikuMagic()V
included:   haiku.avr.lib.arduino.HaikuMicroKernelEx.init()V
included:   arduino.tutorial.BlinkWithThread.main([Ljava/lang/String;)V
included:     haiku.avr.lib.arduino.WProgram.pinMode(BB)V
included:     arduino.tutorial.BlinkWithThread.<init>()V
virtual :     start()V
included#     arduino.tutorial.BlinkWithThread.<clinit>()V
included#       java.lang.Thread.start()V
included:       java.lang.Thread.fork()I
virtual :       run()V
virtual :       stop()V
included#       java.lang.Thread.run()V
included#       java.lang.Thread.stop()V
included:       java.lang.Thread.setStateAndSwitch(I)I
virtual :   toString()Ljava/lang/String;
included#     java.lang.Throwable.toString()Ljava/lang/String;
virtual :   println(Ljava/lang/String;)V
included#     java.io.PrintStream.println(Ljava/lang/String;)V
virtual :     print(Ljava/lang/String;)V
virtual :     print(C)V
included#     java.io.PrintStream.print(C)V
virtual :     write(I)V
included:   java.lang.Thread.currentThread()Ljava/lang/Thread;
included# java.lang.String.toString()Ljava/lang/String;
#### rescan because new virtuals where found
included:   haiku.avr.lib.arduino.HaikuMicroKernelEx$1.<init>()V
included:     java.io.OutputStream.<init>()V
included#     haiku.avr.lib.arduino.HaikuMicroKernelEx$1.write(I)V
included:   java.io.PrintStream.<init>(Ljava/io/OutputStream;)V
included:   haiku.avr.lib.arduino.HaikuMicroKernelEx$2.<init>()V
included:     java.io.InputStream.<init>()V
included:       java.lang.Object.<init>()V
included#   java.lang.Object.toString()Ljava/lang/String;
included:   java.lang.System.identityHashCode(Ljava/lang/Object;)I
included:     java.lang.System.getDataAddress(Ljava/lang/Object;)I
included:   java.lang.StringBuilder.<init>(Ljava/lang/String;)V
included:     java.lang.StringBuilder.<init>()V
virtual :     append(Ljava/lang/String;)Ljava/lang/StringBuilder;
included#     java.lang.StringBuilder.toString()Ljava/lang/String;
included:     java.lang.String.<init>([C)V
included#     java.lang.StringBuilder.append(Ljava/lang/String;)Ljava/lang/StringBuilder;
virtual :   append(I)Ljava/lang/StringBuilder;
included:   java.lang.Thread.<init>()V
included#   arduino.tutorial.BlinkWithThread.run()V
included:   haiku.avr.lib.arduino.WProgram.digitalWrite(BB)V
included:   haiku.avr.lib.arduino.WProgram.delay(J)V
included:   java.lang.Thread.nap(J)V
included:   java.lang.System.currentTimeMillis()J
included#   java.io.PrintStream.print(Ljava/lang/String;)V
virtual :   charAt(I)C
virtual :   length()I
included#   java.lang.String.length()I
included#   java.lang.String.charAt(I)C
#### rescan because new virtuals where found
included#   java.lang.StringBuilder.append(I)Ljava/lang/StringBuilder;
included:   java.lang.String.valueOf(I)Ljava/lang/String;
#### rescan because new virtuals where found
included:   java.lang.String.valueOf(C)Ljava/lang/String;
#### rescan because new virtuals where found
included:   java.lang.String.<init>(C)V
#### rescan because new virtuals where found
#################### closure complete!


Effective configuration for 'arduino':
  Target = atmega328p
  MemorySize = 1540
  InitialMainThreadStackSize = 142
  InitialOtherThreadStackSize = 45
  Mode = HAIKU_16_32
  Char = HAIKU_CHAR_8
  InternalExceptionEnable = NullPointerException | NoSuchMethodError | OutOfMemoryError | ClassCastException | VirtualMachineError
  InternalExceptionThrow = 0
  Threads = 1
  Extension = hex
  Clock = 16000000
  APP_NAME = BlinkWithThread
  VM_BASE = ../../haikuVM
  APP_BASE = /Users/jan/haikuVM/myCProject/.
  CC_OPT = $(HAIKU_CFLAGS) -Wall -Os -fpack-struct -fshort-enums -std=gnu99 -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -mmcu=$(HAIKU_TARGET) -DF_CPU=$(HAIKU_CLOCK)UL -MMD -MP
  Upload = avrdude -pm328p -cstk500v1 -P$(HAIKU_PORT) -b115200 -F -Uflash:w:$(HAIKU_OUTPUT):a
  MicroKernel = haiku.avr.lib.arduino.HaikuMicroKernelEx
  Config = arduino
  IncrementalGCSlice = 10
  Extends = AVR
  GC = HAIKU_StopTheWorldGC
  Output = BlinkWithThread.hex
  CFLAGS = 
  Port = /dev/tty.usbmodem1d171
  CLIBS = 
  HAIKUVM4C = ./haikuVM
  LDFLAGS = 

link > haiku/avr/lib/arduino/HaikuMicroKernelEx from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
getProperty('InvokeShort')returned null
  const class_t haiku_avr_lib_arduino_HaikuMicroKernelEx__class PROGMEM = {
	& haiku_vm_MicroKernel__class,
	sizeof(haiku_avr_lib_arduino_HaikuMicroKernelEx),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino/HaikuMicroKernelEx.c

link > haiku/vm/MicroKernel from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_vm_MicroKernel__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(haiku_vm_MicroKernel),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/vm/MicroKernel.c

link > java/lang/Object from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_Object__class PROGMEM = {
	NULL,
	sizeof(java_lang_Object),
	1,
	{
		{MSG_toString___Ljava_lang_String, (ByteCode *)(&java_lang_Object_toString_Ljava_lang_String)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/Object.c

link > java/lang/System from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_System__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_System),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/System.c

link > java/io/PrintStream from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_io_PrintStream__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_io_PrintStream),
	3,
	{
		{MSG_print__C_V, (ByteCode *)(&java_io_PrintStream_print_CV)},
		{MSG_print__Ljava_lang_String__V, (ByteCode *)(&java_io_PrintStream_print_Ljava_lang_String_V)},
		{MSG_println__Ljava_lang_String__V, (ByteCode *)(&java_io_PrintStream_println_Ljava_lang_String_V)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/io/PrintStream.c

link > java/lang/String from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_String__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_String),
	3,
	{
		{MSG_charAt__I_C, (ByteCode *)(&java_lang_String_charAt_IC)},
		{MSG_length___I, (ByteCode *)(&java_lang_String_length_I)},
		{MSG_toString___Ljava_lang_String, (ByteCode *)(&java_lang_String_toString_Ljava_lang_String)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/String.c

link > java/lang/StringBuilder from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_StringBuilder__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_StringBuilder),
	3,
	{
		{MSG_append__I_Ljava_lang_StringBuilder, (ByteCode *)(&java_lang_StringBuilder_append_ILjava_lang_StringBuilder)},
		{MSG_append__Ljava_lang_String__Ljava_lang_StringBuilder, (ByteCode *)(&java_lang_StringBuilder_append_Ljava_lang_String_Ljava_lang_StringBuilder)},
		{MSG_toString___Ljava_lang_String, (ByteCode *)(&java_lang_StringBuilder_toString_Ljava_lang_String)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/StringBuilder.c

link > java/io/OutputStream from /Users/jan/haikuVM/bin/../lib/nxt/classes.jar
  const class_t java_io_OutputStream__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_io_OutputStream),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/io/OutputStream.c

link > java/io/IOException from /Users/jan/haikuVM/bin/../lib/nxt/classes.jar
  const class_t java_io_IOException__class PROGMEM = {
	& java_lang_Exception__class,
	sizeof(java_io_IOException),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/io/IOException.c

link > java/lang/Exception from /Users/jan/haikuVM/bin/../lib/nxt/classes.jar
  const class_t java_lang_Exception__class PROGMEM = {
	& java_lang_Throwable__class,
	sizeof(java_lang_Exception),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/Exception.c

link > java/lang/Throwable from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_Throwable__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_Throwable),
	1,
	{
		{MSG_toString___Ljava_lang_String, (ByteCode *)(&java_lang_Throwable_toString_Ljava_lang_String)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/Throwable.c

  PREPROCESSING haikuReleaseLock: java.lang.Thread.haikuReleaseLock(Ljava/lang/Object;)V
link > java/lang/Thread from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_lang_Thread__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_Thread),
	3,
	{
		{MSG_run___V, (ByteCode *)(&java_lang_Thread_run_V)},
		{MSG_start___V, (ByteCode *)(&java_lang_Thread_start_V)},
		{MSG_stop___V, (ByteCode *)(&java_lang_Thread_stop_V)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/Thread.c

link > java/lang/Runnable from /Users/jan/haikuVM/bin/../lib/nxt/classes.jar
  const class_t java_lang_Runnable__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_lang_Runnable),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/lang/Runnable.c

link > haiku/avr/lib/arduino/HaikuMicroKernelEx$1 from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_avr_lib_arduino_HaikuMicroKernelEx_1__class PROGMEM = {
	& java_io_OutputStream__class,
	sizeof(haiku_avr_lib_arduino_HaikuMicroKernelEx_1),
	1,
	{
		{MSG_write__I_V, (ByteCode *)(&haiku_avr_lib_arduino_HaikuMicroKernelEx_1_write_IV)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino/HaikuMicroKernelEx$1.c

link > haiku/avr/lib/arduino/HaikuMicroKernelEx$2 from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_avr_lib_arduino_HaikuMicroKernelEx_2__class PROGMEM = {
	& java_io_InputStream__class,
	sizeof(haiku_avr_lib_arduino_HaikuMicroKernelEx_2),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino/HaikuMicroKernelEx$2.c

link > java/io/InputStream from /Users/jan/haikuVM/bin/../lib/haikuvm/haikuRT.jar
  const class_t java_io_InputStream__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(java_io_InputStream),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/java/io/InputStream.c

link > haiku/avr/lib/arduino/ArduinoLib from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_avr_lib_arduino_ArduinoLib__class PROGMEM = {
	& haiku_avr_AVRDefines__class,
	sizeof(haiku_avr_lib_arduino_ArduinoLib),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino/ArduinoLib.c

link > haiku/avr/AVRDefines from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_avr_AVRDefines__class PROGMEM = {
	& java_lang_Object__class,
	sizeof(haiku_avr_AVRDefines),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/AVRDefines.c

link > arduino/tutorial/BlinkWithThread from /Users/jan/haikuVM/examples/src/main/java//arduino/tutorial/BlinkWithThread.class
  const class_t arduino_tutorial_BlinkWithThread__class PROGMEM = {
	& java_lang_Thread__class,
	sizeof(arduino_tutorial_BlinkWithThread),
	1,
	{
		{MSG_run___V, (ByteCode *)(&arduino_tutorial_BlinkWithThread_run_V)},
	}
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/arduino/tutorial/BlinkWithThread.c

link > haiku/avr/lib/arduino/WProgram from /Users/jan/haikuVM/bin/../lib/haikuvm/bootstrap.jar
  const class_t haiku_avr_lib_arduino_WProgram__class PROGMEM = {
	& haiku_avr_lib_arduino_ArduinoLib__class,
	sizeof(haiku_avr_lib_arduino_WProgram),
	0,
  };
into   /Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino/WProgram.c

#### rescan because new virtuals where found
#################### closure complete!


#### rescan because new virtuals where found
#################### closure complete!


totalMethods=      49
totalBClength=     1050
totalConstLength=  260
totalClassesLength=216
/Users/jan/haikuVM/myCProject/./haikuC
/Users/jan/haikuVM/myCProject/./haikuJava/arduino/tutorial
/Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr/lib/arduino
/Users/jan/haikuVM/myCProject/./haikuJava/haiku/avr
/Users/jan/haikuVM/myCProject/./haikuJava/haiku/vm
/Users/jan/haikuVM/myCProject/./haikuJava/java/io
/Users/jan/haikuVM/myCProject/./haikuJava/java/lang
/Users/jan/haikuVM/myCProject/./haikuVM/native/haiku/vm
/Users/jan/haikuVM/myCProject/./haikuVM/native/java/lang
/Users/jan/haikuVM/myCProject/./haikuVM
#############################################################
# generated c files
#############################################################
#
#
#
#############################################################
# cross compiling
#############################################################
#
#
#
Building file: ../../haikuC/haikuConfig.c
Invoking: AVR Compiler
avr-gcc   -Wall -Os -fpack-struct -fshort-enums -std=gnu99 -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -MMD -MP -I"/Users/jan/haikuVM/myCProject/." -I"../../haikuVM" -MF"haikuC/haikuConfig.d" -MT"haikuC/haikuConfig.d" -c -o"haikuC/haikuConfig.o" "../../haikuC/haikuConfig.c"
In file included from /Users/jan/haikuVM/myCProject/./haikuC/haikuConfig.h:1:0,
                 from ../../haikuC/haikuConfig.c:1:
../../haikuVM/haikuJ2C.h:355:20: error: expected declaration specifiers or '...' before '*' token
../../haikuVM/haikuJ2C.h:359:2: error: unknown type name 'BytecodeFoo'
../../haikuVM/haikuJ2C.h:364:9: error: unknown type name 'BytecodeFoo'
../../haikuVM/haikuJ2C.h:601:1: error: unknown type name 'BytecodeFoo'
In file included from ../../haikuC/haikuConfig.c:2:0:
../../haikuVM/Bytecodes.h: In function 'OPF_ANEWARRAY':
../../haikuVM/Bytecodes.h:107:10: warning: assignment from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_CHECKCAST':
../../haikuVM/Bytecodes.h:256:19: warning: comparison between pointer and integer [enabled by default]
../../haikuVM/Bytecodes.h:257:3: warning: passing argument 2 of 'throwException' makes integer from pointer without a cast [enabled by default]
../../haikuVM/haikuJ2C.h:547:13: note: expected 'jint' but argument is of type 'jclass'
../../haikuVM/Bytecodes.h: In function 'OPF_IFNONNULL':
../../haikuVM/Bytecodes.h:1409:2: warning: passing argument 1 of 'compare' makes integer from pointer without a cast [enabled by default]
../../haikuVM/haikuJ2C.h:534:13: note: expected 'jint' but argument is of type 'jobject'
../../haikuVM/Bytecodes.h: In function 'OPF_IFNULL':
../../haikuVM/Bytecodes.h:1419:2: warning: passing argument 1 of 'compare' makes integer from pointer without a cast [enabled by default]
../../haikuVM/haikuJ2C.h:534:13: note: expected 'jint' but argument is of type 'jobject'
../../haikuVM/Bytecodes.h: In function 'OPF_IINC':
../../haikuVM/Bytecodes.h:1429:17: warning: initialization from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_IINC1':
../../haikuVM/Bytecodes.h:1439:17: warning: initialization from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_INSTANCEOF':
../../haikuVM/Bytecodes.h:1517:2: warning: passing argument 2 of 'instanceOf' makes pointer from integer without a cast [enabled by default]
../../haikuVM/haikuJ2C.h:554:13: note: expected 'jclass' but argument is of type 'int16_t'
../../haikuVM/Bytecodes.h: In function 'OPF_INVOKEINTERFACE':
../../haikuVM/Bytecodes.h:1529:18: warning: assignment from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h:1529:38: warning: assignment from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h:1531:2: warning: passing argument 1 of 'getMethod' from incompatible pointer type [enabled by default]
../../haikuVM/haikuJ2C.h:538:15: note: expected 'jobject' but argument is of type 'unsigned char *'
../../haikuVM/Bytecodes.h:1532:2: warning: implicit declaration of function 'invoke' [-Wimplicit-function-declaration]
../../haikuVM/Bytecodes.h: In function 'OPF_LDC_C':
../../haikuVM/Bytecodes.h:1847:10: warning: assignment makes pointer from integer without a cast [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_LOOKUPSWITCH':
../../haikuVM/Bytecodes.h:2039:6: warning: assignment makes pointer from integer without a cast [enabled by default]
../../haikuVM/Bytecodes.h:2043:8: warning: assignment makes pointer from integer without a cast [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_MULTIANEWARRAY':
../../haikuVM/Bytecodes.h:2221:2: warning: passing argument 1 of 'multiArray' from incompatible pointer type [enabled by default]
../../haikuVM/haikuJ2C.h:537:13: note: expected 'struct <anonymous> **' but argument is of type 'struct heap_t **'
../../haikuVM/Bytecodes.h: In function 'OPF_NEWARRAY':
../../haikuVM/Bytecodes.h:2242:10: warning: assignment from incompatible pointer type [enabled by default]
../../haikuVM/Bytecodes.h: In function 'OPF_TABLESWITCH':
../../haikuVM/Bytecodes.h:2473:8: warning: assignment makes pointer from integer without a cast [enabled by default]
../../haikuVM/Bytecodes.h:2478:5: warning: assignment makes pointer from integer without a cast [enabled by default]
In file included from ../../haikuC/haikuConfig.c:2:0:
../../haikuVM/Bytecodes.h: In function 'OPF_WIINC':
../../haikuVM/Bytecodes.h:2499:17: warning: initialization from incompatible pointer type [enabled by default]
../../haikuC/haikuConfig.c: At top level:
../../haikuC/haikuConfig.c:590:2: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
../../haikuC/haikuConfig.c:591:2: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
../../haikuC/haikuConfig.c:650:18: error: variable 'functionTable' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
make: *** [haikuC/haikuConfig.o] Error 1
#############################################################
# error while cross compiling
#############################################################
whiteapple:myCProject jan$
Wenn du irgendwelche Dateien wie haikuConfig haben möchtest, musst du es sagen, weil ich nicht so richtig weiß was wichtig ist.

Zu 3: Momentan läuft der Arduino als Slave und ich möchte dies auch weiter so beibehalten.

@kaijoe So eine ähnliche Ausgabe habe ich auch einmal bekommen. Nach dem Aufruf von dos2unix hat sich dies aber erledigt. Da du aber Windows benutzt kann ich nicht sagen, ob es bei dir auch so funktioniert.