Author Topic: Converting embedded firmware to Java: why?  (Read 4418 times)

0 Members and 1 Guest are viewing this topic.

Offline LabSpokaneTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: us
Converting embedded firmware to Java: why?
« on: October 10, 2014, 01:15:55 am »
I ran across a job posting for a software engineer locally and one of the listed duties was converting embedded C into Java, which strikes me as a really odd procedure. Other than for "field engineering", why would this be a desirable migration path?  I suppose if one were swapping microcontrollers for Beaglebones, OK.  Otherwise, I don't understand the value in saddling a microcontroller with an RTOS and a Java interpreter.

Thoughts from the experienced...?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Converting embedded firmware to Java: why?
« Reply #1 on: October 10, 2014, 01:21:30 am »
Many embedded applications run on Java. Actually when Java was introduced its biggest selling point was to run embedded applications - think of all the cable boxes for example.

Makes perfect sense to me.
================================
https://dannyelectronics.wordpress.com/
 

Offline nuhamind2

  • Regular Contributor
  • *
  • Posts: 138
  • Country: id
Re: Converting embedded firmware to Java: why?
« Reply #2 on: October 10, 2014, 01:26:04 am »
not an expert but probably because easier to find a java developer instead embedded engineer.
on a side note, I work as an embedded engineer (at least in the name) surrounded by a bunch of java programmer.
 

Offline LabSpokaneTopic starter

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: us
Re: Converting embedded firmware to Java: why?
« Reply #3 on: October 10, 2014, 01:26:55 am »
I just thought that Java would be ridiculously slow. Obviously it must be better on a uC. Is there a good way to play with this on an ARM or AT328?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4242
  • Country: us
Re: Converting embedded firmware to Java: why?
« Reply #4 on: October 10, 2014, 02:13:57 am »
Java theoretically has run-time checking for a lot of the errors/conditions/etc that cause highly-publicized bugs in C programs.  (Use a language with String support for an application that uses strings extensively in its user interface?  What a concept!)  At a cost, of course.  It might be particularly worthwhile for boxes that have a user-interaction mode that is seldom used.  Configuration of a router, for instance.  Who cares if it runs slow and momentarily reduces system performance, if it only gets executed 5 minutes/week, and makes the UI more secure?

Quote
if one were swapping microcontrollers for Beaglebones
Could be.  That sort of thing isn't as silly a suggestion as it once was...

And of course, "Embedded C" could mean "cable box running linux" or "teller machine running windows" in the first place.
 

Offline logictom

  • Supporter
  • ****
  • Posts: 336
  • Country: au
Re: Converting embedded firmware to Java: why?
« Reply #5 on: October 10, 2014, 02:29:53 am »
A saw a job advert that peaked my interest, it was for a company looking for an electronics and software engineer but from the job description it is asking for Java, database, raspberry pi programming and mobile apps - not sure where the electronics comes into it. I would be fairly tempted but I haven't touched Java and I once did a module on iOS and it was nothing but a pain in the backside - I'm assuming it would be Android with them asking for Java but I can imagine it would be even worse with 101 different phone/tablet platforms to consider.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4092
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Converting embedded firmware to Java: why?
« Reply #6 on: October 10, 2014, 05:37:52 am »
I just thought that Java would be ridiculously slow.
You can compile java for microcontrollers, and the above is true. Look around and see the success of java on the highly embedded market it was initially developed for.
If instead you're running a higher level of embedding, such as with Windows CE or a linux, java is a real candidate together with C#.
Both have extensive cross platform options, making it easier to develop off-target in simulations.
« Last Edit: October 10, 2014, 05:39:29 am by Jeroen3 »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27405
  • Country: nl
    • NCT Developments
Re: Converting embedded firmware to Java: why?
« Reply #7 on: October 10, 2014, 07:59:49 pm »
Have you ever used C# on a non-Windows platform? I have witnessed such a project and the programmer kept running into Windows CE limitations. Basically only a subset of C# was/is supported in Windows CE. The same probably goes for Java. You need the embedded version which can be a bitch to compile and even then you probably can't use a lot of stuff which is available on the 'desktop' version of Java.

A customer of mine is using C + Lua on a Linux platform and that seems to work much better. There is no cut-down or embedded version of Linux; only a limit in memory and performance. In my own experience whatever works on x386 Linux also works on Linux running on ARM.
« Last Edit: October 10, 2014, 08:03:31 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2906
  • Country: gb
Re: Converting embedded firmware to Java: why?
« Reply #8 on: October 10, 2014, 08:16:49 pm »
I ran across a job posting for a software engineer locally and one of the listed duties was converting embedded C into Java, which strikes me as a really odd procedure. Other than for "field engineering", why would this be a desirable migration path?  I suppose if one were swapping microcontrollers for Beaglebones, OK.  Otherwise, I don't understand the value in saddling a microcontroller with an RTOS and a Java interpreter.

Thoughts from the experienced...?
Mmmm, my experience of Java on "embedded" platforms - building an SNMP agent to hold a large MIB using the JMDK is a little out of date (about 2001) but the scars still feel fresh.

If you know what you're doing and are careful Java is OK, if not it can quickly grow to consume all of your memory and all of your CPU before coming back for much, much more.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6508
  • Country: nl
Re: Converting embedded firmware to Java: why?
« Reply #9 on: October 10, 2014, 08:24:20 pm »
Just a thought. The only valid reason I can think of is if the company would need to let 3rd parties (OEM clients, installers but not end customers) run their code on the devices.
If you give a C code API you can get into problems since the 3rd party developers could easily crash your device, blaming your company and you can go search for the cause.
You can only give access to your devices if the code and allowed memory to use is fully contained, so think virtual machine. You don't want C pointers to any memory location and allowing others to overwrite their and your buffers. Or even worse, read out your valuable firmware code  ;) No you want and need proper limited access and AFAIK a JVM might be able to do just that
.
If you are wondering what the applications are, besides the well known apps on iOS and android where you do not want a developer to crash the entire device with their faulty app, well sometimes you have trust issues where two or more companies in multiple domains meet eachother.  For instance in an office building where one company regulates the HVAC another company does the shutters for the windows another company controls the AV equipment and yet another company controls the lighting. You eventually want the user to be able to control all these devices with one device or controller but the companies want to sell their controller (software).
Not one of those companies want to open up their interface so another company can take advantage and control it fully.
So there is where often these weird constructions are created.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27405
  • Country: nl
    • NCT Developments
Re: Converting embedded firmware to Java: why?
« Reply #10 on: October 10, 2014, 08:55:00 pm »
Those kind of problems are usually solved by offering some form of scripting.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Zeta

  • Contributor
  • Posts: 49
Re: Converting embedded firmware to Java: why?
« Reply #11 on: October 10, 2014, 09:11:48 pm »
A saw a job advert that peaked my interest, it was for a company looking for an electronics and software engineer but from the job description it is asking for Java, database, raspberry pi programming and mobile apps - not sure where the electronics comes into it. I would be fairly tempted but I haven't touched Java and I once did a module on iOS and it was nothing but a pain in the backside - I'm assuming it would be Android with them asking for Java but I can imagine it would be even worse with 101 different phone/tablet platforms to consider.
Are you sure it was job position in a real company ? maybe it was actually a job advert posted by an "inventor"?  :palm: those are the guys looking for electronic engineers with 5+years of raspberry pi and arduino programming experience  :-DD  :-DD
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4092
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Converting embedded firmware to Java: why?
« Reply #12 on: October 10, 2014, 09:55:13 pm »
Nearly all payment terminals (those on the counters) made by a company I forgot the name of, run C# on a linux variant.
Thats like asking a Ferrari dealer if he can sell you a Porsche, but for some reason they use this. And it seems to work fine.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf