embedded

Pointer memory error

The problem I can't get the data from the Flash memory when using the function that return the address of the pattern desired in the Flash (simplified in the example below with only 1 constant : PATTERN_P). Some code before explication The type patternp is defined as typedef prog_uchar patternp[NUM_ROWS]; The global PATTERN_P vari...

binary format to pass tabular data

I'm maintaining a legacy embedded device which interacts with the real world. Generally speaking, this device collects data from sensors, processes the data using its internal algorithm, and displays warning when data reaches a certain "bad" state. For debugging purposes, we wish this device will send us on a regular basis many of the d...

How can you do C++ when your embedded compiler doesn't have operator new or STL support?

I am working on a group senior project for my university and I have run into a major hurdle in trying to get my code to work. The compiler that we have for our 8 bit Atmel microcontroller does not support the new or delete operators, and it does not support the C++ STL. I could program it in C, but I have to implement an A* algorithm w...

What open-source COM implementations work on embedded systems?

I am considering using COM interfaces within an embedded (non-Windows) system that has a limited C++ compiler, and I am looking for an open-source COM implementation using simple C++, in particular with little or no use of templates and without use of exceptions (yes I know COM doesn't use exceptions but an implementation could use them ...

serialize and deserialize SQL query

I'm having an embedded device which keeps a list of inner tables. I would like it to synchronize this table's state with some outside database for debugging purposes. That is whenever I add an element to a certain struct array I wish the device to issue an "INSERT INTO ..." command. However I'm sending the data over an RS232 serial cabl...

What's the best description for "embedded hardware system"?

When I hear that, I always think about an mobile device. But why is the hardware "embedded" there? Isn't the whole device the hardware? Why is a personal computer no embedded hardware system? ...

How can I unit test Arduino code?

I'd like to be able to unit test my Arduino code. Ideally I would be able to run any tests without having to upload the code to the Arduino. Are there any tools or libraries out there which can help me with this? Update: There is an Arduino emulator in development which could be useful but it doesn't yet seem to be ready for use. Updat...

How to start develop for chinese mobile phones based on nucleus RTOS? (MTK)

I've noticed that chinese mobile phones became very popular, perhaps because of their very reasonable price and many modern features (touch screens, advanced multimedia, double sim cards etc). I'm wondering if there's any way to develop custom solutions for this handsets as independent developer? How to obtain a toolkit and documentati...

C language: #DEFINEd value messes up 8-bit multiplication. Why?

I have the following C code: #define PRR_SCALE 255 ... uint8_t a = 3; uint8_t b = 4; uint8_t prr; prr = (PRR_SCALE * a) / b; printf("prr: %u\n", prr); If I compile this (using an msp430 platform compiler, for an small embedded OS called contiki) the result is 0 while I expected 191. (uint8_t is typedef'ed as an unsigned char) If I ch...

How to determine which task is dead?

I have an embedded system that has multiple (>20) tasks running at different priorities. I also have watchdog task that runs to check that all the other tasks are not stuck. My watchdog is working because every once in a blue moon, it will reboot the system because a task did not check in. How do I determine which task died? I can't ...

GCC MIPS-32 Calling Conventions / Stack Frame Definition

There appears to be no definitive standardized stack frame and C language calling conventions (register usage and such) for the MIPS-32 Processor Architecture. That is, it appears to be completely up to the assembler/compiler tool chain to define their own stack frame and calling conventions. I've struggled to find a definitive reference...

Is there any reason to use C instead of C++ for embedded development?

Question I have two compilers on my hardware C++ and C89 I'm thinking about using C++ with classes but without polymorphism (to avoid vtables). The main reasons I’d like to use C++ are: I prefer to use “inline” functions instead of macro definitions. I’d like to use namespaces as I prefixes clutter the code. I see C++ a bit type safe...

A way to convert byte stream to packet stream in C89 on an embedded device.

I’m working on with an embedded device that is connected to PC using rs232 (rs232 over USB). I’m thinking about developing my own protocol: <MAGIC><LENGTH><BINARY DATA><CRC> but I don’t want to reinvent the wheel. Please note that: I'm thinking about quite restricted device: 4kb of RAM, no kernel, nor standard C lib. Can you think...

Simple serial point-to-point communication protocol

I need a simple communication protocol between two devices (a PC and a microcontroller). The PC must send some commands and parameters to the micro. The micro must transmit an array of bytes (data from sensor). The data must be noise protected (besides parity checking, I think I need some other data correction method). Is there any sta...

Low-Level control of RS232 (Com-Port) RTS/CTS/DTR/DSR possible?

I wonder if and how it's possible to control the RS-232 handshaking lines directly from win32 (the old C-API). I'd like to interface with an external piece of hardware, and two simple data-lines would be sufficient for my needs. So - is there a API for win32 that lets me read and write the state of the four status lines? In normal se...

Which system can one call "Embedded Linux based"?

I am working on SBC(Single Board Computer) board with Red Hat Linux, which is being used to get information from many routers and process packets. Can this Gateway be called an "Embedded Linux based" product? ...

SQLite - pre allocating database size...

Is there a way to pre allocate my SQLite database to a certain size? Currently I'm adding and deleting a number of records and would like to avoid this over head at create time. ...

How I can fix this code to allow my AVR to talk over serial port?

Hi guys, I've been pulling my hair out lately trying to get an ATmega162 on my STK200 to talk to my computer over RS232. I checked and made sure that the STK200 contains a MAX202CPE chip. I've configured the chip to use its internal 8MHz clock and divided it by 8. I've tried to copy the code out of the data sheet (and made changes wher...

Python *.py, *.pyo, *.pyc: Which can be eliminated for an Embedded System?

To squeeze into the limited amount of filesystem storage available in an embedded system I'm currently playing with, I would like to eliminate any files that could reasonably be removed without significantly impacting functionality or performance. The *.py, *.pyo, and *.pyc files in the Python library account for a sizable amount of spa...

Porting Windows demo apps to WinCE/XP Embedded

We have a range of PC demonstration programs for our microcontroller products. The programs typically connect to a USB HID chip on the microcontroller board. The USB chip acts as a communications bridge, allowing the programs to communicate with the micros over SPI/I2C/UART. The programs can configure the micros, and get back status ...