zLib for WindowsCE and ARM platform - zlib

Background
An application that I am designing (on Windows CE7 running over an ARM Cortex A8) receives files from a PC(Windows 64bit) over an Ethernet link.
The files contain data compressed using the zLib version 1.2.11 (https://zlib.net/).
On my device application, I have to uncompress the files and process them.
I found a port of zLib for Windows CE (http://www.tenik.co.jp/~adachi/wince/zlibce/index.html) but it is based on the revision 1.1.4 of zLib. Will this revision mismatch be an issue while decompressing the data (that was compressed using the Version 1.2.11)?
What steps are required to use the zLib source to build it into a static library that can be used on a Windows Embedded over an ARM Cortex platform? From the zLib manual, I understand that it is a native C code that can be compiled for any OS and hardware platform. But while building I came across some assembly code as well that is probably written for an Intel x86. For porting to Windows CE + ARM Cortex platform would then require translation of this assembly code as well?
How to manage the difference in endianness of the compressing side and decompressing side? UPDATE: I missed this part in the zLib FAQ, it says that the difference in endianness is not an issue.
Thanks in advance

zlib compressed data is fully compatible forward and backward through all zlib versions.
The code in the contrib directory, including x86 and other assembler code there, are all third party contributions and are not part of zlib. You do not need them.
As you found, zlib produces and consumes bytes, so there are no endianess issues.

Related

Can i port object files compiled for intel 486 to newer architecture?

I have a plain c object file file.o compiled for intel 486 and vxworks 5.0 RTOS using gcc cygnus 2.7 in tornado 2.0 environment. I have a couple of questions:
Q1: can this file be linked in an executable to target and run on other CPU architecture like ARM?
Q2: can this file be linked in an executable to target and run on higher models of intel CPU?
Q3: can this file be linked to an executable for target os like micrium or free rtos or higher versions of vxworks?
A detailed solution and suggested portability options are highly appreciated.

Writing IAR output to ARM chips without IAR

We currently hold a full license for the IAR EWARM IDE but we need to upload firmware to units being made meaning only one person can do the uploading as the application is way over the kickstart size.
I'm wondering if there is an alternative method for just uploading (no debugging) IAR's outputted executable without the need for a fully licensed version? I've looked into the Eclipse plugin but this seems to rely on the IAR compiler still.
We're using the TMS470 chip and a JLink programmer.
Any advice would be much appreciated.
In your project options, there is a category for Output Converter. In this section you can get a Motorola S-record format, Intel hex format, binary, or other output type. From here, you can use the J-Link software, though you will need to purchase a license to be able to download arbitrary code not as a part of the debug process.
J-Flash is the software component needed for stand-alone flashing support: J-Flash order page.
J-Flash licences are locked the the hardware serial number - you will need one for each J-Link you want to use. They are somewhat expensive for an existing J-Link.
OpenOCD includes support for Segger J-Link (which IAR rebadge), and can be used a for stand-alone flash programmingbut whether it works apparently depends on the J-Link firmware version, so YMMV.
There are lower cost JTAG debugger/programmers(example) that will work reliably with OpenOCD and cost much less that a single J-Link licence.
Segger offers J-Flash, a PC software program that interfaces with the J-Link debug probe to program the flash memory on a target. You need a license for J-Flash but it's independent of the IAR (or other) toolchain.
You might need another software program to convert IAR's standard executable output format to a format that J-Flash can use, perhaps hex, s-record, or binary. IAR probably includes the conversion tool or you may be able to do a web search for something.

How to start ARM programming in linux?

I was using PIC micro controller for my projects. Now I would like to move to ARM based Controllers. I would like to start ARM using Linux (using C). But I have no idea how to start using Linux. Which compiler is best, what all things I need to study like a lot of confusions. Can you guys help me on that? My projects usually includes UART, IIC, LCD and such things. I am not using any RTOS. Can you guys help me?
Sorry for my bad English
Once you put a heavyweight OS like Linux on a device, the level of abstraction from the hardware it provides makes it largely irrelevant what the chip is. If you want to learn something about ARM specifically, using Linux is a way of avoiding exactly that!
Morover the jump from PIC to ARM + Linux is huge. Linux does not get out of bed for less that 4Mb or RAM and considerably more non-volatile storage - and that is a bare minimum. ARM chips cover a broad spectrum, with low-end parts not even capable of supporting Linux. To make Linux worthwhile you need an ARM part with MMU support, which excludes a large range of ARM7 and Cortex-M parts.
There are plenty of smaller operating systems for ARM that will allow you to perform efficient (and hard real-time) scheduling and IPC with a very small footprint. They range form simple scheduling kernels such as FreeRTOS to more complete operating systems with standard device support and networking such as eCOS. Even if you use a simple scheduler, there are plenty of libraries available to support networking, filesystems, USB etc.
The answer to your question about compiler is almost certainly GCC - thet is the compiler Linux is built with. You will need a cross-compiler to build the kernel itself, but if you do have an ARM platform with sufficient resource, once you have Linux running on it, your target can host a compiler natively.
If you truly want to use Linux on ARM against all my advice, then the lowest cost, least effort approach to doing so is perhaps to use a Raspberry Pi. It is an ARM11 based board that runs Linux out of the box, is increasingly widely supported, and can be overclocked to 900MHz
You can also try using the Beagle Bone development board. To start with it has few features like UART I2C and others also u can give a try developing the device driver modules for the hardware.
ARM Linux compilers and build toolchains are provided by many vendors. Below are your options which I know of:
1.ARM themselves in form of their product DS-5 ;
2.Codesourcery now acquired by Mentor graphics. See some instructions to obtain & install, codesourcery toolchain for ARM linux here
3.To first start programming using ARM (C , assembly ) I find this Windows-Cygwin version of ARM linux tool chain very helpfull. Here. These are prebuilt executables which work under Cygwin(A Posix shell layer) on Windows.
4.Another option would be to cross compile gcc/g++ toolchain on Linux for ARM target of your choice. Search and web will have information about how it is done. But this could be a slightly mroe involved and long-winding process.
enjoy ARM'ing.
First, you should question yourself if you really need to program assembly language, most modern compilers are hard to beat when it comes to generating optimized code.
Then if you decide you really need it, you can make life easier for your self by using inline assembler, and let the compiler write the glue code for you, as shown in this wikipedia article.
Then the compiler to use: For free compilers there are practically only two choices: either gcc or clang.
There is also a non free toolchain from arm which when i last tried, 5 years ago, produced about 30% faster code than gcc at the time. I have not used it since.
The latest version of this compiler can be found here
You can also write standalone assembler code in .s files, both gcc and clang can compile .s into .o in the same way you would compile a .c or .cpp file.
Compile
If you are using a STM32 based microcontroller you need to get CMSIS and GNU arm-non-eabi-gcc package installed. Then you need to write your own makefile to pass your c codes into arm gcc compiler.
Programming
For the programming step you need to install openocd and configure that for your specific programmer. You can find a full description on how to do that on my blog
http://bijan.binaee.com/index.php/2016/04/14/how-to-program-cortex-m-under-gnulinux-arch/ and in my GitHub repository.
IDE
I'm using vim with CTags but you can use gEdit with the Shortcut plugin if you need a simpler text editor.

Simulating Circuits and Programming Micro-controllers over Linux

I'm about to go through a Micro-Controller project which controls a robotic arm. My problem is that # MS Windows there are MikroElectronica (IDE: MicroC) compile .c to Hex put the hex in Proteus and simulate. Then using a special (PCB) Kit with CD (carries windows software) I would put the microchip and install the hex file or what ever.
First all the respect to Ms but I just hate it! I adore Ubuntu/linux and open-source I need from the experts to tell me in "Steps" how to do the previously mentioned in linux with minimal complications.
The Electrical and Mechanical Engineers along with me always brag about Ms is easy. I want to show them how Computer Science guy uses open-source technology and how strong and reliable it is.
Please help !
You wish to demonstrate the power of Linux by trying to run products designed for another operating system on it? Chances are those tools may work in Wine.
Or maybe you can use Hi-Tech C as a compiler and try gEDA for simulation. It is also possible to compile Microchip C30 on Linux if you are working on 16-bit PIC:s. In any case, this may not be as easy as using the out-of the-box Windows tools. It will be more educational, nevertheless.
If you can be flexible and opt for AVR then you will have free GCC compiler and programming tools. All open source and Linux/Mac friendly. More info at www.avrfreaks.com.
Here is a compiler, linker and simulator tutorial for PIC on linux. Here is one that uses SDCC c compiler. Google throws out lots of websites when you search for linux pic.
From my side, I cross-compile and program Microchip dsPIC from Linux but it is not really straightforward. Here are the big steps
First I built the C30 toolchain from Microchip sources (you need to apply a few patches on the given sources for it to compile).
Once you have the toolchain binaries, you will need to have the specific Microchip MCU resources. Those are coming with the C30 installation on a win32. I copied those files from the Windows installation folder onto my linux filesystem.
Here you should be able to compile and link some C & ASM code to a hex file through command line.
Second step, I wanted to build my projects within the Eclipse IDE. To do that we "just" had to write a couple makefiles to call our new C30 toolchain.
Third step, program the .hex onto your microchip MCU. Two ways to do it. If you have a Pickit2, Microchip provides a command line tool to play with it. I personally have an ICD2 programmer. I use the command line tool provided in the Piklab project.
Now I don't have any facility to debug with my ICD2 under Linux.
Now Microchip provides an alternative IDE with "Mplab X" which is based on Netbeans (sick) and should work under Linux and MacOS. But this project seemed to be yet under development, I don't know if it is really usable.

OpenCV on ARM11 architecture with Ubuntu Support

I am developing a project based on OpenCV. Currently I am working on Ubuntu 10.04 system with AMD turion processor. But project need to work as an embedded system. So I am using a readymade board based on ARM11 processor with SAMSUNG S3C6410 processor. It supprot Linux 2.6.28. It also support ubuntu. So how could I port my code from the host system to my embedded system.
Thanks
This is link for the board.
http://www.minidevs.com/
I think the best way to start, is to take a look at Angstrom/OpenEmbedded.
It's a framework for building OS images for various embedded platforms. You could take the precompiled-images, but I've realized that after a while it's not worth the hassle.
Just build the target image yourself (with OpenCV for the target platform, it definitely builds for S3C2440 (tested it myself a year ago or so) and for all OMAP3 platforms (BeagleBoard, EVM and the like).
Then, use OpenEmbedded to build the cross-compiler (there is a package name for that), install it on your host machine, and you should be ready to go.
If there is no support for S3C6410, just use any other ARM11 platform out there, and install the packages. It is likely your vendor-supplied OS was built using OpenEmbedded, it quickly becomes de-facto standard.
http://www.angstrom-distribution.org/
http://www.openembedded.org
Check Linaro if the processor you are looking for is ARM. It looks promising. http://www.linaro.org/

Resources