roboforum.ru

Технический форум по робототехнике.

Контролер с Java

Правила форума
Правила раздела OpenRobotics

Re: Контролер с Java

Сообщение demoontz » 26 ноя 2012, 00:49

Ребят, а подскажите куда смотреть чтобы понять как запихнуть это чудо в наш контролер?( OR-AVR-M128-S. )
demoontz
 
Сообщения: 194
Зарегистрирован: 04 фев 2009, 20:06
Откуда: Kiev
Skype: demoontz

Re: Контролер с Java

Сообщение elmot » 26 ноя 2012, 01:14

в фскн. такое можно делать только под тяжелыми опиатами.
Аватара пользователя
elmot
 
Сообщения: 5691
Зарегистрирован: 10 ноя 2011, 12:02
Откуда: Turku, Finland
Skype: elmot73
прог. языки: Java и все-все=все
ФИО: Илья

Re: Контролер с Java

Сообщение Angel71 » 26 ноя 2012, 09:35

Make your own

To use uJ in your own project, you'll need to provide a few pieces of code. First, you'll want to figure out where to store the class files, and how to get them there. That part is completely up to you, though you can use uc_loader.c as an exaple of storing classes in the flash of the microcontroller and putting them there from the SD card. You are responsible for, at boot, calling ujInit() to initialize uJ. At this point you can inject your own native classes, if you so wish. This is where you provide access to your hardware to java. Feel free to use uc_main.c as an example of doing that. After this, you should start loading java classes. Call ujLoadClass() on each, and remember the ones that fail with UJ_ERR_DEPENDENCY_MISSING. Re-try them later - you may have just not yet loaded their dependencies. After you're all done with that, and all classes loaded without errors, it is time to initialize all classes. Use ujInitAllClasses() for this. Now you can start the VM. Create the main thread via a call to ujThreadCreate() and have it start running main, or whatever your entry point is via a call to ujThreadGoto(). As previously, uc_main.c can be used as an example of doing this. At this point everything is ready, and you can let the VM go. Code like this is what you need now: [while(ujCanRun() && EJ_ERR_NONE == (err = ujInstr()));]. If that loop ever exits, it means your code finished or an error occured. Examine the value of err for details. Of course you'll also need to implement ujReadClassByte() that actually reads bytes from whereever you store your class files.

The current state of the code can be had via a download from [HERE]
Аватара пользователя
Angel71
 
Сообщения: 10668
Зарегистрирован: 18 апр 2009, 22:18
Предупреждения: -1

Re: Контролер с Java

Сообщение Strijar » 11 дек 2012, 09:10

Немного не в тему, но для FPGA есть процессор который исполняет Java байт-код - http://www.jopdesign.com/ Работал с ним, очень не плохая штука. На Spartan-6 молотит на 93Мгц
Аватара пользователя
Strijar
 
Сообщения: 664
Зарегистрирован: 28 авг 2006, 17:09
Откуда: Всеволожск (СПб)
прог. языки: С, C++, Python, Lua, VHDL, Verilog, Forth
ФИО: Олег Белоусов

Пред.

Вернуться в Разработка модулей

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1