embedded

Unit testing device drivers

I have a situation where I need to write some unit tests for some device drivers for embedded hardware. The code is quite old and big and unfortunately doesn't have many tests. Right now, the only kind of testing that's possible is to completely compile the OS, load it onto the device, use it in real life scenarios and say that 'it works...

Delay in MCC18, 48Mhz, 18F87J50

How should i write a delay macro for an PIC 18f87J50 with a 48MHz crystal and compiler of MCC18. The delay should be in us. So I for example can write: Delay_us(201) and really get 201us delay. What I have now is: #define Delay_us(n) (Delay10TCYx(((n) * (uint16_t) 12 + 9) / 10)) And it does'nt seems right at my oscilloscope! :/ Kind...

WiFi communication to embedded display

Hi, I'm trying to create an embedded outdoor display of bus arrival times at my university. I'd like the device to utilize my school's secured WiFi network to show arrival time updates determined from a server script I have running. I was hoping to get some advice on the high-level operation of this thing -- would it be better for the d...

CodeWarrior for FreeScale trying to debug a simple program using the 56800E simulator

I'm just getting started learning FreeScale DSCs (MC56F800x series). I've done some work with AVRs using both AVR Studio on Windows and Eclipse and avr-gcc on Linux. CodeWarrior is just not as intuitive. Right now I'm stuck trying to debug a simple program. I start the debugger using the built-in simulator, but it never reaches the fir...

How to Verify Atomic Writes?

Hello all, I have searched diligently (both within the S[O|F|U] network and elsewhere) and believe this to be an uncommon question. I am working with an Atmel AT91SAM9263-EK development board (ARM926EJ-S core, ARMv5 instruction set) running Debian Linux 2.6.28-4. I am writing using (I believe) the tty driver to talk to an RS-485 seria...

Initialization of arrays in C

Hi all.. In C, i have read tat half-initialized arrays will be filled with zeros for the rest of the elements (irrespective of integer or char arrays).. Eg: int arr[10] = {3}; arr[4] will be 0 if initialized and a junk value if not initialized My question is, will the above work for all C compilers (or) this appending of zeros mi...

Designing Web Interface for Embedded System

OS : Linux. Im trying to find possible ways to design web interface for my embedded system. Currently there is a shell(text based) and a small set of commands are implemented to query the device. Im new to web development, my questions are : What web server must i use ? ( i got apache up on my development setup and tried using cgi ...

Is forcing I2C communication safe?

Hi. For a project I'm working on I have to talk to a multi-function chip via I2C. I can do this from linux user-space via the I2C /dev/i2c-1 interface. However, It seems that a driver is talking to the same chip at the same time. This results in my I2C_SLAVE accesses to fail with An errno-value of EBUSY. Well - I can override this via ...

Is Android recommended for Atom processor platform?

Hi Geeks, I am going to develop a handheld device which has an Atom processor. I am thinking of using Android embedded OS for running telecom applications on this device. I have heard from my friends that Android is good for wireless applications. But my device does not need any wireless application. I will need only data (ping, tracero...

Loose-coupling patterns for embedded systems programming

Where can I find some good, proven guidelines or examples on writing extensible, modular, loosely-coupled code in C (if possible)? Background of our problem is that we are maintaining large plain C, legacy code project for a low-cost microcontroller with limited computing and memory resources. Due to the fact that the system must be ex...

Linux thread performance very fast under GDB but extremely slow otherwise

I'm working on an embedded C++ application running on Linux. I've recently encountered some really strange performance problems with pthreads. My system has 8 threads passing information back and forth protected using a pthread mutex lock. When running my application stand-alone, thread performance is abysmally slow when taking a mute...

USB software loopback device on Linux

I have a need to write an client-server application where a tiny server rests on a USB gadget and communicates with a client application on the host. I've not done this sort of thing before but I have done webapps and usually, they're all developed and debugged on the local machine using the lo loopback network interface. This has perh...

What's the "best" database for embedded?

I'm an embedded guy, not a database guy. I've been asked to redesign an existing system which has bottlenecks in several places. The embedded device is based around an ARM 9 processor running at 220mHz. There should be a database of 50k entries (may increase to 250k) each with 1k of data (max 8 filed). That's approximate - I can try to...

Where can I find information about programming the TI TMS320C64xx DMA controller

I need to do some simple memory transfer using this DSP, but I am unable to find any documentation about the DMA functions. I am using C with code composer 3.3 ...

Looking for C++ FSM classes for embedded project

I'd like some (freely reusable) C++ classes to represent states, events and Finite State Machines (FSM). Maybe each even has a unique ID and string name which can be used when debugging. Maybe each state has the same plus an OnEnter() and OnExit() function, etc and maybe each FSM has a collection of states, each of which accepts various...

Embedded wxWidgets for ThreadX OS

I'm working on an embedded system using ThreadX. The project will involve a GUI. I'm looking for a port of wxWidgets for embedded on ThreadX operating system. My search has turned up wxWidgets for embedded Linux and WinCE. Also, is wxWidgets difficult to port to a new (different) OS? Thanks, (The project tools are C++ using Gre...

threadsafe single-consumer, single-producer FIFO on embedded system

I have a TI DSP (TMS320F28235 if anyone cares) that I need to implement a FIFO for queueing information between main-loop code and an interrupt. High-speed execution for this queue is very critical but so is proper operation, and I'm not sure whether I can get away with implementing a FIFO without any explicit synchronization, or if not,...

GCC, ARMboot - Creating standalone application without any library and any OS

I have an embedded hardware system which contains a bootloader based on ARMboot (which is very similar to Uboot and PPCboot). This bootloader normally serves to load uClinux image from the flash. However, now I am trying to use this bootloader to run a standalone helloworld application, which does not require any linked library. Actuall...

Grand Unified Theory of logging

Is their a Grand Unified Theory of logging? Shall we develop one? Question (just to show this is not a discussion :), how can I improve on the following? (note that I live mainly in the embedded world, but non-embedded suggestions are also welcome) How do you log, when do you log, what do you log, what do you do with log files? How do ...

TI DSP: interfacing C++ and assembly

I posted this Q to TI's 28xx DSP forum but haven't heard a response and figured maybe someone here might know. I know how to write functions in assembly so that they are C-callable; if the C-callable name is foo() then the assembly function is named _foo(). What if I want to use C++ and optimize a class method in assembly? How do I d...