embedded

Migrating from Winarm to Yagarto

Hi This question must apply to so few people... I am busy mrigrating my ARM C project from Winarm GCC 4.1.2 to Yagarto GCC 4.3.3. I did not expect any differences and both compile my project happily using the same makefile and .ld files. However while the Winarm version runs the Yagarto version doesn't. The processor is an Atmel AT9...

Remote proxy with shared memory in C++

Suppose I have a daemon that is sharing it's internal state to various applications via shared memory. Processes can send IPC messages to the daemon on a named pipe to perform various operations. In this scenario, I would like to create a C++ wrapper class for clients that acts as a kind of "Remote Proxy" to hide some of the gory detai...

Windows CE Icon lost when using CAB installer

I have a C# Windows CE 5.0 application. I am using VS2005. My executable shows the correct icon (32x32 8 bit). If I move the .exe file to the CE device using ActiveSync then the icon is still correctly displayed. When I use a CAB file to install the application the icon is lost. Currently the icon is an embedded resource. Any suggestions...

Where to find definition of CeCreateDatabaseWithProps

According to msdn it should be in windbase.h but it is not available instead it is in windbase_edb.h but cordll.lib is linked with windabase.h only. So, i want to know is there any method by which CeCreateDatabaseWithProps can be linked with a appropraite library? Thanks in advance. ...

sample rc file for splint

I am using splint for code checking, and it is throwing out a huge number of warnings. Some of them, I guess can be ignored. I am in the process of creating the .splintrc by trial and error. My question, Is there some sample .splintrc file that can be used? I am using splint for C code, written for a multi-tasking embedded system. ...

How to move from microcontrollers to embedded linux?

As a kind of opposite to this question: "Is low-level embedded systems programming hard for software developers" I would like to ask for advice on moving from the low level embedded systems to programming for more advanced systems with OS, especially embedded Linux. I have mostly worked with small microcontroller hardware and software, ...

PIC I2C slave ack on data

Hi! I am looking into the I2C protocol for PIC16F88X. What I would like to do, is to enable an I2C slave to either ACK or NACK depending on the data received on the I2C. The PIC can ACK or NACK on the I2C address sent on the line, but from what I've read it will always ACK on the subsequent received bytes. Is that correct? In the foll...

Building an AVR with HTTP server and SNMP agent?

I need to build a prototype for a simple data collection device using an AVR microcontroller. The device will basically collect sensor data and make this data available via SNMP and a HTTP response. What are my options when it comes to AVR software that would already have a HTTP server and SNMP agent built-in? ...

micro-SD card initialization using SPI interface

I'm using a micro-SD card in an embedded design. The card is connected to a microcontroller using the SPI interface. It worked fine for all cards I've used before, but now my new card will not initialize. The card is a Transcend 2GB micro-SD card (TS2GUSD). After sending the initial clock train to switch to SPI mode I do the following: ...

Unit testing patterns for microcontroller C code

Although there are plenty of unit test frameworks that support C, I'm a little stumped on how to write unit tests for micro controller code (PIC in my case, but I think the question is more general than that). Much of the code written for micro controllers revolves around Writing configuration and data values to registers, reading incom...

Html renderer with limited resources (good memory management)

I'm creating a linux program in C++ for a portable device in order to render html files. The problem is that the device is limited in RAM, thus making it impossible to open big files (with actual software). One solution is to dynamically load/unload parts of the file, but I'm not sure how to implement that. The ability of scrolling is...

How can I visualise the memory (SRAM) usage of an AVR program?

I have encountered a problem in a C program running on an AVR microcontroller (ATMega328P). I believe it is due to a stack/heap collision but I'd like to be able to confirm this. Is there any way I can visualise SRAM usage by the stack and the heap? Note: the program is compiled with avr-gcc and uses avr-libc. Update: The actual prob...

What is this written in?

I am dealing with an circa 80's era machine controller. A program is being downloaded to the operator's control panel and for the life of me I can't figure out what it is written. The machine is a Cybermation 700A plasma cutting machine and here is a snippet of what being download. Note that this is use to manage the download of cnc f...

What is the best C compiler for the 8051 family?

We are starting a new project based on an 8051 microcontroller. Questions: What is the best C compiler to use? Are there any open source 8051 compilers and how good are they? ...

Call tree for embedded software

Does anyone know some tools to create a call tree for C application that will run on a microcontroller (Cortex-M3)? It could be generated from source code (not ideal), object code (prefered solution), or at runtime (acceptable). I've looked at gprof, but there's still a lot missing to get it to work on an embedded system. An added bonus...

recursive folder scanning in c++

Hi I want to scan a directory tree and list all files and folders inside each directory. I created a program that downloads images from a webcamera and saves them locally. This program creates a filetree based on the time the picture is downloaded. I now want to scan these folders and upload the images to a webserver but I´m not sure how...

Unravelling Assembly Language Spaghetti Code

I've inherited a 10K-line program written in 8051 assembly language that requires some changes. Unfortunately it's written in the finest traditions of spaghetti code. The program--written as a single file--is a maze of CALL and LJMP statements (about 1200 total), with subroutines having multiple entry and/or exit points, if they can be i...

How to make your embedded C code immune to requirement changes without adding too much overhead and complexity?

In many embedded applications there is a tradeoff between making the code very efficient or isolating the code from the specific system configuration to be immune to changing requirements. What kinds of C constructs do you usually employ to achieve the best of both worlds (flexibility and reconfigurabilty without losing efficiency)? If...

Data structure for storing serial port data in firmware

I am sending data from a linux application through serial port to an embedded device. In the current implementation a byte circular buffer is used in the firmware. (Nothing but an array with a read and write pointer) As the bytes come in, it is written to the circular bufffer. Now the PC application appears to be sending the data too f...

Best strategy to call an arbitrary function without using JMP or LCALL

In embedded C is quite natural to have some fixed/generic algorithm but more than one possible implementation. This is due to several product presentations, sometimes options, other times its just part of product roadmap strategies, such as optional RAM, different IP-set MCU, uprated frequency, etc. In most of my projects I deal with th...