How do I use the Silicon Laboratories IDE with SDCC? - ide

I'm thinking about using a microcontroller with an 8051 core from Silicon Laboratories.
I hope that I can use C rather than assembly language, so I installed SDCC.
I installed the "Silicon Laboratories IDE" to download the executable binaries to the on-chip Flash program memory.
It also supposedly can be set up (under the Project > Tool Chain Integration menu)
to use "any" 8051 compiler.
I tried to set it up to use SDCC, but every time I hit the "Assemble/Compile File" button it tells me
"Compiler process did not sucessfully complete."
How do I get new C code I write onto the SiLabs C8051F310 chip?
Is there a web site with a step-by-step HOWTO?
(Would it be easier to use a MAKEFILE that calls SDCC, only using the "Silicon Laboratories IDE" for the very last step of downloading the executable binary to the chip?)

Start with Silicon Labs Application Note 198 - INTEGRATING SDCC 8051 TOOLS INTO THE SILICON LABS IDE*. It is written for an older version of the IDE, but the general configuration should remain the same. It is probably important to note that AN198 needs updating for SDCC 3.0.0. Additional information from the Silicon Labs MCU User Forum or Microcontrollers Knowledge Base may prove useful as well.
The SDCC Compiler User Guide* can be useful if additional command line options are desired.
The Silicon Labs USB Debug Adapter can be used with the Silicon Labs IDE and the on-chip debug/programming circuitry of the C8051F310* for programming the MCU and debugging your code.
* PDF Link

Related

Instruction set: how to test an external library

Depending on the CPU architecture, some computers can run software with some specific instruction set. Using these instructions can greatly improve the speed of the program, but can also lead to crashes when not supported.
But sometimes, when shipping a software that depends on external libraries (binaries), we may want to check what instruction set they rely on (like AVX2, SSE2, etc) and assess if we can use safely this library or executable (e.g.: on Windows, a .lib, .dll or an .exe). Mostly when the final executable has to be shipped to hardware that is out of our control, but should follow some specifications.
Most of the related questions seems to tackle the problem the other way around: from the software, to check if a set of instruction is supported on the current hardware:
how verify that operating system support avx2 instructions
Detecting SIMD instruction sets to be used with C++ Macros in Visual Studio 2015
How one can check, from the binary, what kind of instruction sets are required or used? Is there some OS tools for that?
The OSs of interest would be Windows, Linux and MacOS.

Why does QEMU use JIT compilation?

The TCG "accelerator" is used by QEMU when requesting full virtualization of a guest with a different hardware architecture (or with -accel=tcg).
TCG is a JIT compiler which emulates the guest architecture set by translating instructions and immediately invoking them at runtime. Portability depends on the list of architectures that TCG supports.
Would it be possible, realistically speaking, to compile an operating system into some efficient IR (similar to Java bytecode) and implement a virtual machine for that bytecode completely in software?
The short answer to "why does QEMU use JIT compilation" is "because it is faster than other ways to do it, like interpreting, but it can still handle any arbitrary guest binary". There has been some work done (not in QEMU itself, but by other projects or research work) on emulation by statically translating guest binaries into code for the host architecture, but this is tricky and you still have to be able to fall back to something like JIT to handle guest binaries that involve self-modifying code or which themselves are JITs (think of running a Java guest inside QEMU).
It is certainly possible to have an operating system which is compiled into an IR bytecode which then executes portably on a virtual machine on a variety of hosts. Historical examples of this include Taos (http://www.uruk.org/emu/Taos.html) and the UCSD p-System (https://en.wikipedia.org/wiki/UCSD_Pascal). Note that you would still here probably want to implement the bytecode-execution engine in such a VM using a JIT, because it's faster than interpreting the bytecode, and there might well be some host-CPU-specific bits of the VM implementation as a result.
However, that sort of portable-operating-system endeavour is an entirely separate idea from QEMU, whose purpose is to run under emulation existing pre-built binaries for a given guest CPU architecture.

Mbed OS -> is it really open source?

If Mbed OS is open source then why do you have to use a cloud compiler to compile the software? Is the source code for Mbed OS open but the the cloud compiler is closed source?
Just looking for clarification amongst marketing jargon.
SW
There seems to be some confusion here between Mbed OS which is a open source project and the Mbed Compiler Service, which is a tool that makes getting started with Mbed OS super easy.
Mbed OS is open source, you can find it here : http://github.com/armmbed/mbed-os, i encourage you to contribute by submitting a Pull Request.
The online compiler service is run by the Arm Mbed team to provide an easy way to get started with compiling your programs (there are some assumptions and sensible defaults in place so everything 'just works'). You can export your programs to a 3rd party compiler like Keil, IAR, or GCC / Eclipse for debugging if you need it. You can also use Mbed CLI offline to compile your code using GCC. (Fun fact, Mbed CLI is the same set of command line tools the online compiler uses).
Additional fun fact, the online compiler is using armcc (the same one that comes with Keil) where as GCC is the default for Mbed CLI (though if you have a liscense for armcc or iarcc you can use those with Mbed CLI as well.
Mbed OS is completely open source. There are various options to compile. So far, there are 3 toolchains that are supported by ARM mbed:
GCC ARM
ARMCC
IAR
Out of these 3, only GCC ARM is free while others have free evaluation versions with limited features unless you buy them.
In short, you can download mbed OS and then compile it for a target using any of the toolchains which may or may not be open source.

Gumstix Overo SSD1306 OLED

Hello everybody,
I have been working for some time on the implementation of tools for coding an application in Qt5 on a Gumstix Overo platform with a Yocto Rocko kernel.
After some effort I managed to set up the development tools:
- Create a bootable SD card with Yocto Rocko and Qt5.
- Get cross-compilation tools to code Qt5 linux support on Gumstix Overo (ARM).
- Configure QtCreator to develop code and compile it for the Gumstix Overo.
All my research work with explanatory "step by step" are available on this link.
In order to use the I2C part of the Gumstix Overo, I would like to exploit the small OLED SSD1306 display.
I found a project that did it for a Beagle Bone here.
And the library practically ready to use here.
After adapting the project for the Gumstix Overo and compiling the code, I can start the application.
The problem is that after a short time running the program stops and show me these two errors.
- ioctl error: Remote I/O error.
- Chunk writtent to RAM -Failed.
The display of the first error comes from an additionnal part that I have added in the code in line 202 there.
The display of the second error comes from the library in the line 777 there.
My unsuccessful searches on the internet make me to ask you for help.
Small precise, given the I2C communication voltage levels between the Gumstix Overo and the SSD1306 OLED display, an electronic adaptation has be made.
the electrical assembly
I2C waveform
Voltage level adaptation schematic
Thank you all.
Ok I found the solution.
The problem was the logical level converter that not working for 1.8 VDC.
I choose the PCA9306 Breakout from sparkfun there and it's working well.
I hope that will help someone.

What pascal compilers can target embedded ARM with no OS?

Looks like available Pascal compilers can only produce binaries for ARM on Linux. Is there established version of compiler/bundle for just bare ARM cpu with zero extra software preinstalled ?
To clarify, I am looking for high quality, compact tool (alternative to commercial C, open source C) for kernel-less, plain embedded CPU with all software in one plain ROM ? IDE with debugging capabilities is nice to have, but not necessary. Dubugger could actually be some different 3rd party generic IDE. I hope that compilers can dump the debug/symbols info in some standard form.
Thank you
Free Pascal Compiler supports ARM without any OS. They call it TARGET EMBEDDED.
For ARM Linux take a look at this and this.
There is also Lazarus CT edition cross compiler which seams to target sysless ARM too.
UPDATE 1: mikroElektronika has also recently made Pascal compiler for ARM.
UPDATE 2: Ultibo framework for bare metal Raspberry Pi programming looks outstanding.