Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Embedded Objective-C
Shotaro “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...
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++ Runtime
JVM
C++
C Runtime
C
ObjC 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 u...
Disadvantages
• Large memory footprint
– Classes are loaded at init array calls.
– No “class-loader” system.
– Needs to ma...
“Big 3” ObjC Runtime
Compiler Modern-ObjC Cons
Apple Clang Yes iOS/OSX only
libobjc GCC, Clang No Out-dated
No “Foundation...
Another newer runtime “ObjFW”
• Lightweight
– < 1MB
• Portable
– Multi-platform includes Apple devices
– Works with PSP, W...
Requirements to run ObjFW
• Still, you need 1MB+ RAM
– External RAM, typically
– Bootloader
• 1MB+ Flash
• “Fast enough” p...
Silabs EFM32 Wonder Gecko
• Cortex-M4F@48MHz
• External Bus Interface
– Up to 4x256MB
– Support code execution via I/D bus...
It works!!
• Ubuntu 14.04
• Eclipse Kepler
– With debugging!!
• Clang/LLVM 3.5 (trunk)
– Some nice major updates for ARM ;...
What's Next?
• Threading support
– CMSIS-RTOS (RTX)
– Free RTOS
• Socket support
– lwIP
• File support
• Hardware APIs
ObjC
Powered
ObjArduino
Relese Date: When It's Done
Embedded Objective-C
Embedded Objective-C
Upcoming SlideShare
Loading in …5
×

Embedded Objective-C

1,253 views

Published on

How to run Objective-C on Bare-metal ARM

Published in: Engineering
  • Be the first to comment

Embedded Objective-C

  1. 1. Embedded Objective-C Shotaro “Fantom” Uchida
  2. 2. 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...
  3. 3. Objective-C #import "XYZPerson.h" @implementation XYZPerson - (void)sayHello { NSLog(@"Hello, World!"); } @end
  4. 4. Arduino
  5. 5. #import "XYZPerson.h" @implementation XYZPerson - (void)sayHello { NSLog(@"Hello, World!"); } @end If I could...
  6. 6. Existing Solutions Language Bare-Metal C Arduino Java-like mbed C++ JavaME JavaME Tessel JavaScript Why not Objective-C ???
  7. 7. Is ObjC Proprietary?
  8. 8. How different? Java Java C++ Runtime JVM C++ C Runtime C ObjC Runtime Smalltalk-like C++ Objective-C
  9. 9. 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.
  10. 10. 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
  11. 11. “Big 3” ObjC Runtime Compiler Modern-ObjC Cons Apple Clang Yes iOS/OSX only libobjc GCC, Clang No Out-dated No “Foundation” GNUStep GCC, Clang Yes (w/ Clang) Out-dated Huge
  12. 12. 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
  13. 13. Requirements to run ObjFW • Still, you need 1MB+ RAM – External RAM, typically – Bootloader • 1MB+ Flash • “Fast enough” processor
  14. 14. 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
  15. 15. 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
  16. 16. What's Next? • Threading support – CMSIS-RTOS (RTX) – Free RTOS • Socket support – lwIP • File support • Hardware APIs
  17. 17. ObjC Powered ObjArduino Relese Date: When It's Done

×