Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have been looking into micro-controllers and was wondering if the majority of them are C/C++ based? I am quite proficient in java and want to ask you guys if anyone knows of a good cost efficient, java-based micro-controller I could look into.
All answers are appreciated!
The difference between a language like java (or c#) and a lower level language like c or c++ is the fact that they have a virtual machine.
This has many advantages, like making the application platform-independent. But it also means that each platform has to have the vm for it.
Now, microcontrollers are not uniform and vary in power, memory, and many other features. So adopting the JVM (java's virtual machine) for them is not easy even when possible.
Most of the time its just impossible - most of the uc have very low memory capacity (part of what makes them cheap) - this would make fitting any general-purpose JVM there impossible, not to mention also with the application code.
I am aware of some partial-implementations of java for microcontrollers. For example "java-based" sim cards (which have a very small controller inside) are there, but they have a very limited version of java.
So basically I think your best bet to write "embedded java" (especially if you're a novice) is to work on top of microcontrolers that are basically a small fully functioning computer, that runs a proper OS that already has a JVM. Just look into one of the new "micro computer" open source projects like raspberry pi or beaglebone. Both cost around 2x of an arduino and are much more powerful.
Hope I helped.
Have a look at the Java-ready STM32 microcontrollers or Renesas RX.
As an alternative, you can run a stripped-down JVM on AVR/Arduino using Haiku-VM, NanoVM or uJ.
You can also write Arduino sketches in Java and cross-compile them to C using VBB.
JArduino might be a good starting point for you, as it would allow you to write Java programs that interact with an Arduino board. The Java API provided by JArduino is fully aligned with the Arduino API. Then, once you get used to the Java API, it should be easy to switch to plain Arduino programming (as pointed out, the C/C++ -based Arduino is not that far from Java, anyway). Be aware that with JArduino you do not really program the micro-controller itself (your main logic would run on your PC and the Arduino would simply be "controlled" without any advanced logic running on the board).
There are Java alternatives, but I think they are costly. For example ST Microelectronics has this java IDE based on eclipse:
Java SDK
I have no experience with java on microcontrollers, but Java have many similarities (C based language) to C++ (which is more supported with microcontrollers), but it is still C that is dominating. It should be possible to learn this quite fast if you already know Java.
Arduino uses C++ and are easy to use for people inexperience with C/C++.
I suggest you also try the STM32 Java forum to see if there are users already sharing their experiences:
STM32 Java forum
You can look at Java on a Chip (JoC Module) is the java programmable controller-module
JoC have a reference Board Javaino for easy development
Also Demmel iLCD product have the Java VM on board, it's a smart display with JVM
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
As a hobby project, I'd like to learn development on "bare metal" with Ada. It seems GNAT compiler has support for various development boards and provides a few different runtimes - zfp, ravenscar-sfp, ravenscar-full.
I'm not quite sure which MCU has better support and nicer to work with. I've been looking at:
TI "TMS570LC43x Hercules Development Kit". This has Cortex-R5F CPU, which looks quite interesting for learning hardware features required for hard real-time applications. But the board is somewhat expensive and there aren't any tutorials on how to use GNAT with this board.
ST "STM32F7 discovery kit". This has Cortex-M7 CPU. The board is much cheaper and there are quite a few tutorials that use STM32F boards with GNAT.
Both of these boards seem to be supported by GNAT bb-runtimes. Has anyone worked with either of them and could provide recommendations? How well do they work with GNAT runtimes and which one has better debug support or development features?
Based on the comments to my question, it seems that MCUs from STMicroelectronics would be easier to work with and have better support from GNAT Ada compiler. Most of their MCUs are based on ARM Cortex-M cores, which are more common than Cortex-R cores. There are also more resources (books, tutorials) on how to work with Cortex-M cores. MCUs bases on Cortex-R cores are probably more suited to people working with safety-critical systems.
I also just started to do bare metal programming with Ada. My board will probably be the STM32F4 discovery, which are much cheeper than the F7 boards I have seen. Second reason is, that for the F3 Dicovery board there is very good tutorial for bare metal programming with Rust on the Rust homepage which I tried with my F3 board.
For Ada, I have only checked the tool chain from AdaCore for that board so far, cross compilation seems to work very well. Unfortunately, the Ada Drivers Library doesn"t support the F3...
I have been using GNAT Ada on ST ARM boards for the last 6 years and use it on about 40 different boards. They have excellent support for the boards they directly support and I have added many others over the years to my collection. I would say go with the 429, 469 or 769 discovery board. I prefer the small footprint (sfp) versions and have fun. I just finished doing some casino games that run on the 429 Discovery board. I mostly use the 2017 version of GNAT ARM because that was their last year of support for win32 which I needed for other things but their new Aug 2020 free download has very nice support for many boards in addition to the ST boards.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need to compile C project for Attiny85 but not sure which compiler to use - free if possible. Is Atmel Studio a good choice?
Complier
Free and the best compiler for AVR is AVR-GCC (in Windows it's called WinAVR).
It supports ATTiny85 (here is the list of supported devices).
So you just need to pass this option to compiler:
-mmcu=attiny85
You can look here for Makefile example.
Flashing software
To upload your firmware to ATTiny85 chip, you can use AVRDude program. It's free and most popular application for flashing AVR chips. See this for usage example.
IDE
As for IDE, there are plenty of them out there, but IMHO two best choices would be:
Vim: if you prefer console applications. Especially good for Linux. I would recommend to use next plugins: cscope, CTags, OmniCompletion, NerdTree. Still, if you don't know vim yet, it would take a lot of time to learn it and configure it properly (I'm personally using vim).
Eclipse: if you prefer GUI applications. It's very flexible, free, cross-platform and extremely powerful. It's very easy to configure Eclipse for AVR development (to use AVR-GCC and AVRDude). There is Eclipse plugin for AVR. And you also can find a lot of tutorials in web about how to use Eclipse for AVR development.
If you are novice, I'd say -- go with Eclipse.
Debugger
For debugger I would recommend GDB. GDB is free and very powerful debugger software. It's easy to integrate GDB into Eclipse
Also you will need AVaRICE to connect GDB with JTAG.
Note
All software I mentioned is free, cross-platform and actually being used for professional embedded development, so you can use it without second thoughts. Actually, it's almost single choice you have out there, except for IDE (still, my colleagues at work use mostly Vim and Eclipse, 50/50, so I think there is not much choice here as well).
Another good thing is that it's very easy to migrate to another MCU (from AVR) if you stick to software I listed above. E.g., for MSP430 there is similar GCC toolchain and similar flash software, and GDB of course. So you can just configure Eclipse to use msp430-gcc instead of avr-gcc and develop for MSP430.
I googled a lot, and almost all users compile their codes with Atmel Studio, or they use Attiny along with Arduino. So I think Atmel studio is the best choice. It also includes gcc to compile c/c++
Atmel® Studio 6 includes the GCC C and C++ Compiler, assembler and a simulator, and interfaces seamlessly with in-system debuggers and programmers to make code development easier.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm still a newbie programmer and I am looking at some garbage collected languages that are suited for writing desktop GUI applications. The language must be available on Windows, OSX and Linux. I say "garbage collected" instead of high level since a language like D isn't quite high level (imo) but is garbage collected, compiles to native code and gives near C++ performance. However the most developed GUI toolkit for D is DWT, wich is a port of SWT. The few SWT apps I have used look ugly on every platform. If D had a Qt binding that would be great, but the only thing I could find was QtD which seems to be a dead project.
Languages I am aware of:
Java
Python
D
I'd rather not use C# with Mono and syntax-wise I prefer languages similar to C/C++.
Are there any others, and what would you suggest?
EDIT: The language doesn't have to compile to native code, compiling to bytecode and running in a VM is just fine.
Every programming language that I know, that has a compiler to the native code, uses some C or C++ GUI toolkit for GUI. SWT/DWT uses GTK on Linux/Unix for an example. If SWT applications look ugly to you, then either you did not configure the GTK theme or you did something with the look&feel initialisation. SWT applications look exactly the same as any "native" GUI application.
Even though I am a former C++ programmer, and no matter how I dislike it now, I would still recommend C++ to you because you asked for programming language with compiler that compiles to native binary. Additional requirement you specified is the garbage collector. Use the libgc in your C++ applications, and that is all you need. More about it here: http://developers.sun.com/solaris/articles/libgc.html .
In the field of programming languages with native compilers I am more/less settled with D, but unfortunately, D has no actively-developed GUI ToolKit as we speak. That will be solved soon, but until then, use C++.
What about vala?
Vala is an object-oriented programming language with a self-hosting
compiler that generates C code and uses the GObject system. Vala is
syntactically similar to C# and includes useful language features like
anonymous functions, signals, properties, generics, assisted memory
management, exception handling, type inference, and foreach
statements.2 It is being developed by Jürg Billeter and Raffaele
Sandrini. It aims to bring modern language features to C[clarification
needed][peacock term], with no added runtime needs and with little
overhead, by targeting the GObject object system. Rather than being
compiled directly to assembly or to another intermediate language,
Vala is source-to-source compiled to C which is then compiled with a
platform's standard C compiler, such as gcc.
Go there is as well some bindings for GTK, FLTK and WALK. Check out this thread.
On Java you can still modify the Look and Feel of your UI. Java gets also a port of Qt called Qt Jambi.
And then there are very stable languages like Free Pascal/Lazarus and PureBasic that work well (same source code compiles on all platforms) on Win, OS X and Linux
Real Studio uses reference counting for automated memory management. It's not garbage collection, but better in many ways.
And of course Real Studio runs on Windows, OS X and Linux and can create apps for Windows, OS X, Linux and the web.
You could use Qt Quick. It has a declarative UI language called QML and it's scriptable with javascript.
All
I've a Good Command over C++, But I've never done anything anything on device programming. I've some basic understanding on Digital Logic Design. But I am complete Noob in Electronics. Currently I am getting huge interest on microcontroller Programming.
Where To Start ?
I don't think one really needs to have huge amount of knowledge on electronics to run a program on a microcontroller.
I am using Linux. and I've downloaded Keil. never tried to run it through Wine. I've ran it in Windows. But how the code works is not completely clear to me. though I can understand Logic as its written in C. But Its still like a Fog to me.I Just need a Quick Kickstart.
SO is not the best site to ask this kind of question. There's really a large distinction between programming for a PC and programming for an embedded system, other SE sites specialize in physical computing. I got this email from Robert Cartaino on Tuesday:
...Barring any last-minute interest from
[chiphacker.com], we will be launching [electronics.stackexchange.com]
either tomorrow [Wednesday 9/22] or
Thursday.
So, go commit to electronics.stackexchange.com here, and browse chiphacker.com while you wait. Take a look at these questions on Chiphacker:
How to become an embedded software developer?
Steps to learning Arduino Programming
PIC Programming
What are the best beginner project[s] using an arduino
There are a few things you should consider when planning your entry path to embedded systems programming.
What do you want to do?
What do you know how to do?
How fast are you comfortable learning?
I've outlined a few options in the following paragraphs.
You tagged your question linux-device-driver, does this mean that you want to make a custom device to use in Linux? If you meant embedded-linux, then you're into a larger class of microcontrollers. I suggest that you look at the BeagleBoard, also look at this Chiphacker question for some other options. If you want to do embedded linux, and want to build your own board, you'll first need to build up some experience in simpler levels of embedded systems design.
You also tagged your question avr, which is a popular microcontroller class made by Atmel (check out the avrfreaks forum for more info). I started learning embedded systems on the ATmega324p; they really have great documentation, are easy to use, and there are more sites online for the avr than most any other processor.
If you want an easier learning curve, I suggest taking a look at the Arduino environment. It uses Wiring, which is very similar to C/C++, and the Arduino can be enhanced with 'shields', which are modules that can be plugged into the Arduino main board to add functionality. This is your Quick Kickstart.
A good learning path would be to get familiar with the Arduino, then build your own AVR board (possibly a Linux device, like a joystick), then work with an ARM-based development kit, and finally move on to to building your own embedded linux board. You can skip a few steps if you don't mind a steep learning curve, or stop at any point along the way if a given level's capabilities satisfy your needs. You don't necessarily need a "huge amount of knowledge on electronics to run a program on a microcontroller", it's true, but you should understand some basic things like voltage and current before you try to light an LED or connect two devices.
Finally, you said in your question that you've installed the Keil IDE. While this is a fine and rather popular IDE, I'd suggest that you learn using a gcc-based command line toolchain. There are a staggering number of ways in which things that can go wrong when working with embedded systems, and an IDE adds a layer of magic on top of everything that happens. While this can be nice, I'm a strong advocate of minimizing the magic when trying to learn the system. You need to understand the low-level stuff when things don't work automagically. This advice doesn't apply when using the Arduino, which is designed to (and does) make all of the automagical stuff work well.
sparkfun.com has a lot of boards, arduino family and other. I recommend the armmite pro, the lillypad instead of the arduino pro because there is no soldering involved, for either you will need/want the correct usb to serial/power. The mbed2 costs a little more, the blue leds are brutal on the eyes, but easy to use. For none of the above are you required to play in their sandbox, you can use the canned environment, etc but not required.
if it is linux development you are after I recommend the hawkboard.org over the beagleboard.org, to make the beagleboard useable costs about twice as much as the board itself, the hawkboard is usable by only buying something to power it. But you can just learn linux drivers on your desktop/laptop and dont need to mess with embedded necessarily.
Emulators are a good start. Qemu is good stuff, emulates a number of processors, great for emulating virtual linux systems, learning linux driver development, etc. But getting visibility into what the (virtual/emulated) processor is doing is not the goal. I find it useful to have visibility. gdb includes a few emulators as well. mame is loaded with them, but like qemu designed for fast emulation and not for education. visual boy advance is good. Emulation is never perfect, so eventually you want to run on hardware, but emulators and compiler tools are free and you can learn quite a bit before you have to buy hardware. There is a considerable amount you cannot learn from an emulator though, loading your programs into flash/ram, debugging using jtag or other interfaces. i2c, spi, etc.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am writing embedded applications for different hardware (avr, arm7, tms55xx…) and different rtoses (freeRTOS, rtx, dsp/bios). And every second of them needs to communicate with PC or another digital device. Sometimes interactions logic is very advanced. So I'm interesting in common methodology (like state-machine programming style), protocol specification or library, that could simplify developing such things.
I've been very happy with google's protocol buffers on embedded systems for both data passing and RPC mechanisms. They are quite a bit lighter than XML based systems since the data is transmitted is binary encoded and the decoding the data sent requires minimal processing which is a big plus on cpu usage on the embedded side of the link.
There are readily available libraries for various languages but most importantly C for embedded apps.
OpenJAUS.
It's reflective, composable and standardized (ish)
Works cross-language-cross-platform.
Provides a lot more framework than Protocol Buffers ( which is a neat messaging stack)
It's focussed on robotics, but works for control systems.
In theory a JAUS user interface can operate any JAUS-compliant device, and JAUS systems are intended to compose into a syste-of-systems.
If those things don't make sense then please ignore this suggestion.
Here is an article on Embedded.com on CORBA on embedded systems and 'lightweight' or minimal implementations. The commercial solutions mentioned are for QNX, VxWorks and LynxOS. And another article on RPC on Embedded.com (this one authored by a TI DSP trainer and specifically referencing DSP, so may be relevant to DSP/BIOS).
I strongly recommend that you use Embedded.com's article search, there are probably many similar articles that you will find useful.
VxWorks supports RPC, as does QNX Neutrino.
"Roll your own" has always been my solution where standards compliance and inter-system compatibility is not an issue (i.e. my systems talking to my systems). Doing only exactly what you need is the best way to achieve 'lightweight' perhaps at the expense of flexibility and maintainability.
Recently we developted: https://github.com/EmbeddedRPC/erpc
Give chance to it ;)
Protocols are a natural fit for state machines, so perhaps you could use the very lightweight, open source QP state machine frameworks (state-machine.com). Ready to use QP ports and examples for various compilers are available for AVR, MSP430, ARM7/ARM9, TMS320C28x, PSoC, HC08, M16C/R8C, H8, 8051, PIC18, PIC24/dsPIC, ARM Cortex-M3/M0, and many others.
Note: I work for http://state-machine.com