Embedded Objective-C
-
Upload
shotaro-uchida -
Category
Engineering
-
view
372 -
download
5
description
Transcript of Embedded Objective-C
Embedded Objective-CShotaro “Fantom” Uchida
Who am I?
• I am Java Enthusiast so far...– USB EHCI stack in Java– TCP/IP in Java– IEEE802.11 in Java– ZigBee in Java– OAuth 2.0 in Java– XModem in Java
• I do everything (Hardware/Software) for Java• 仕事下さい。よろしくお願いします。
But today...
Objective-C
#import "XYZPerson.h" @implementation XYZPerson- (void)sayHello { NSLog(@"Hello, World!");}@end
Arduino
#import "XYZPerson.h"
@implementation XYZPerson
- (void)sayHello {
NSLog(@"Hello, World!");
}
@end
If I could...
Existing Solutions
Language
Bare-Metal C
Arduino Java-like
mbed C++
JavaME JavaME
Tessel JavaScript
Why not Objective-C ???
Is ObjC Proprietary?
How different?
Java
Java
C++ RuntimeJVM
C++
C Runtime
CObjC Runtime
Smalltalk-like
C++ Objective-C
5 Reasons Why Objective-C is the Best
• C++ sucks.• You can use “Pure C” anytime anywhere.• It also means that you can use assembly
anytime.• Powerful object-oriented language, but still
faster than Java.• And C++ sucks.
Disadvantages
• Large memory footprint– Classes are loaded at init array calls.– No “class-loader” system.– Needs to manage all method symbols i.e.
selectors.
• Message lookup
“Big 3” ObjC Runtime
Compiler Modern-ObjC Cons
Apple Clang Yes iOS/OSX only
libobjc GCC, Clang No Out-datedNo “Foundation”
GNUStep GCC, Clang Yes (w/ Clang) Out-datedHuge
Another newer runtime “ObjFW”
• Lightweight– < 1MB
• Portable– Multi-platform includes Apple devices– Works with PSP, Wii, and NintendoDS !
• Modern-ObjC• Clang supported
– -fobjc-runtime=objfw– Don't stop the support of ObjFW!! Plz!!
• Github– https://github.com/Midar/objfw
Requirements to run ObjFW
• Still, you need 1MB+ RAM– External RAM, typically– Bootloader
• 1MB+ Flash• “Fast enough” processor
Silabs EFM32 Wonder Gecko
• Cortex-M4F@48MHz• External Bus Interface
– Up to 4x256MB– Support code execution via I/D bus
• Ultra low power• SDK with big memory!
– 4MB PSRAM– 16MB Nor Flash
It works!!
• Ubuntu 14.04• Eclipse Kepler
– With debugging!!
• Clang/LLVM 3.5 (trunk)– Some nice major updates for ARM ;)
• ObjFW 0.8-dev• Need some workaround...
– Read my blog: http://xmaker.mx/archives/14
What's Next?
• Threading support– CMSIS-RTOS (RTX)– Free RTOS
• Socket support– lwIP
• File support• Hardware APIs
ObjCPowered
ObjArduino
Relese Date: When It's Done