473,795 Members | 3,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C or C++ for embedded system plug-in?

I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can't guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.

Jan 3 '07 #1
42 2368
Baron Samedi wrote:
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can't guarantee
that, of course.
My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).
In the majority of cases you just need a way to provide functions with C
linkage and calling conventions, to be able to call him from another
languages. Most language implementations provide ways to do that, then you
can choose what language to use based in other requirements or preferences.

--
Salu2
Jan 3 '07 #2

Baron Samedi wrote:
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can't guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.
I work on embedded systems for a large networking company. I work in
the packet core on UMTS & GPRS GSN nodes. Our various GSN nodes differ
in implementation our SGSN was written in C++ (however the compiler is
very old and some of the features were disabled for whatever reason)
and our GGSN was written in C, mainly since we inherited a lot of base
routing, service and subscriber managment code written in C. Although I
like working on our GGSN, mostly for the IP Service development, I urge
you... if you are starting a project and have a choice.. use C++.... no
matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramatically depending on the size of your project. Some code may still
be needed to be written in Assembly or C (i.e. any special hardware
like a fast ethernet line card would probably still need to be
programmed in assembly for performance reasons).

As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.

Jan 3 '07 #3
bjeremy wrote:
Baron Samedi wrote:
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can't guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.

I work on embedded systems for a large networking company. I work in
the packet core on UMTS & GPRS GSN nodes. Our various GSN nodes differ
in implementation our SGSN was written in C++ (however the compiler is
very old and some of the features were disabled for whatever reason)
and our GGSN was written in C, mainly since we inherited a lot of base
routing, service and subscriber managment code written in C. Although I
like working on our GGSN, mostly for the IP Service development, I urge
you... if you are starting a project and have a choice.. use C++.... no
matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramatically depending on the size of your project. Some code may still
be needed to be written in Assembly or C (i.e. any special hardware
like a fast ethernet line card would probably still need to be
programmed in assembly for performance reasons).

As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.

Thanks for the great reply (and quick too).

Basically, I want to have a common adaptation layer for
handsets/modems/terminal adapters which sits above the protocol stack
(AS/NAS, Layers 1 to 3) and offers a 24.007 interface at one side and a
generic interface to different device drivers (USB, Ethernet, etc),
probably appearing as a virtual serial port.

The code probably won't be extensible by the end user, and I don't see
them instantiating any objects, but I do like C++.

As I stated, there will be fixed interfaces on both sides, one defined
by CCITT/ETSI/3GPP and the other abstracting device drivers, so
probably Virtual Serial Port. Users only get to tweak a few macros to
determine how my software allocates memory, performs debug tracing,
handles timers and the like.

You have certainly given me food for thought. Thanks.

Jan 3 '07 #4

"bjeremy" <bj*****@sbcglo bal.netwrote in message
news:11******** ************@42 g2000cwt.google groups.com...
As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.
In your opinion of course. In MY opinion C++ provides all the rope you can
hang yourself with as in C plus a whole lot extra. But you shouldnt worry
about that at all if you have competent programmers. C and C++ are both
great languages that get the job done from the lowest level to the highest.
If I had the choice of language for a next project I would choose what I
like best and not ask advice from biased newsgroup people
Jan 3 '07 #5
Serve Laurijssen a écrit :
"bjeremy" <bj*****@sbcglo bal.netwrote in message
news:11******** ************@42 g2000cwt.google groups.com...
>As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.

In your opinion of course. In MY opinion C++ provides all the rope you can
hang yourself with as in C plus a whole lot extra. But you shouldnt worry
about that at all if you have competent programmers. C and C++ are both
great languages that get the job done from the lowest level to the highest.
If I had the choice of language for a next project I would choose what I
like best and not ask advice from biased newsgroup people

In truth, I have seen many good C programmers wanting to hang themselves
when they learned they would have to code in C++ :)

For further reading, you can try this article:
http://www.ganssle.com/articles/alingo.htm

Michael
Jan 3 '07 #6
Serve Laurijssen wrote:
"bjeremy" <bj*****@sbcglo bal.netwrote in message
>As for performance in C compared with C++, what I mainly seen
are the capacity issues deal more with the design of the system.
And C++ provides less rope to hang yourself with than C.

In your opinion of course. In MY opinion C++ provides all the rope
you can hang yourself with as in C plus a whole lot extra. But you
shouldnt worry about that at all if you have competent programmers.
C and C++ are both great languages that get the job done from the
lowest level to the highest. If I had the choice of language for a
next project I would choose what I like best and not ask advice
from biased newsgroup people
If you want a widely available language and maximum safety use Ada.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Jan 3 '07 #7
On 2 Jan 2007 18:14:32 -0800, "bjeremy" <bj*****@sbcglo bal.netwrote:
no
matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramatically depending on the size of your project.
I have a different opinion. If you have the stated problems with C,
they are due more to your programmers than the language. C can be
written to be easily maintainable, extensible, and reusable. In fact,
I've seen many cases where the initial partitioning of the problem and
resulting choice of classes made C++ code much more of a problem in
maintenance, extensibility, and reuse.

C++ which takes advantage of OO techniques often ends up "all of a
piece", and disturbing one portion perturbs everything else. It's
possible to design programs using classes which are nicely extensible
and reusable, but it's difficult and time consuming, and all too
seldom done properly.

--
Al Balmer
Sun City, AZ
Jan 3 '07 #8
Al Balmer a écrit :
C++ which takes advantage of OO techniques often ends up "all of a
piece", and disturbing one portion perturbs everything else.
Specially if everything is done in constructors, making it
very difficult to take out one part of that code...
Jan 3 '07 #9
Al Balmer wrote:
On 2 Jan 2007 18:14:32 -0800, "bjeremy" <bj*****@sbcglo bal.netwrote:
>>no matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramaticall y depending on the size of your project.


I have a different opinion. If you have the stated problems with C,
they are due more to your programmers than the language.
Programmers or process.
C can be
written to be easily maintainable, extensible, and reusable.
As can any language, even assembly.
In fact,
I've seen many cases where the initial partitioning of the problem and
resulting choice of classes made C++ code much more of a problem in
maintenance, extensibility, and reuse.
That's one reason why BDUF is a mistake.
C++ which takes advantage of OO techniques often ends up "all of a
piece", and disturbing one portion perturbs everything else. It's
possible to design programs using classes which are nicely extensible
and reusable, but it's difficult and time consuming, and all too
seldom done properly.
I agree, that's why OO designs (in any language) should evolve rather
that be done up front.

--
Ian Collins.
Jan 3 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
342
by: Peter Zentner | last post by:
Hi, I have a bitmap as an embedded resource. Now I want to use that bitmap for a background image of a button. But if I do the following it doesn't work. <snap start> Dim s As System.IO.Stream = Me.GetType().Assembly.GetManifestResourceStream("WindowsApplication1.Bitmap1 ..bmp") Dim bmp as bitmap = New Bitmap(s)
2
2200
by: | last post by:
Where can I find a minimal version of python (less than 2 MB) suitable for a web server on an embedded linux system? The small size is required because the system lives on flash memory. Thanks, Ken Seehart
2
12170
by: Jani Mantytorma | last post by:
I have embedded resource called Settings.xml. I'm able to read the resource but how can I write data to the resource. The code for read operation follows: private XmlDocument m_doc = new XmlDocument(); System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Stream stream = a.GetManifestResourceStream(this.GetType(),"Settings.xml"); if(!(null==stream)) { System.IO.StreamReader rdr = new...
2
1895
by: Kyle Kaitan | last post by:
I have an assembly (AppResources.dll) which contains a number of embedded resource files. Most of these are key/value pairs of relevant strings; a few are images and sounds; some more are XML files. My application will load the resources into memory as they are needed. I would like to be able to read and write to these embedded resources. Is it possible to write to an embedded resource within an assembly? If so, how? If it's not...
0
2351
by: BattleAngel444 | last post by:
Hi All I am trying to run the Postgres 8.0 intaller on my XP embedded (XPe) build. I get to the point where it runs initdb.exe but it ends up failing and does not install. I believe i am possible missing a system file or service but i don't know. To me it seems like the postgres installer comes with its own system files. below is a link to a thread with what i believe is the same problem. ...
0
6503
by: garethrichardadams | last post by:
Hello all, I've added a font to my project and set it to "Embedded Resource". I load the font into a global PrivateFontCollection. (InitCustomFont - shown below) I then set the font of a label to be equal to the custom font (SetCustomFont - shown below)
2
1379
by: Peter van der veen | last post by:
Hi I have a VB project and added a text file to it as an embedded resource. But i can'f find a way now how to read this file just as a normal text file with the streamreader command. Anyone can give me a hint?
1
1926
by: mark | last post by:
I'm using System.Net.Mail to send HTML email. I have a few images embedded within the HTML body. What's the most efficient way of including these images with the message or getting the images to display on recipient's client? Obviously, I want to avoid spam filters and don't want to hog bandwidth. Any help much appreciated.
7
34932
by: Morias | last post by:
I have been trying to install a Zebra LP2844 on a computer running Windows XP. When using the add printer wizard I get an error that simply tells me "The printer could not be installed," but when using the plug and play auto detect wizard I get the error "Data area passed to a system call is too small." The printer has worked on this particular computer before, but when it started malfunctioning I tried reinstalling the drivers and that is when...
4
6391
by: tvnaidu | last post by:
Porting small application from windows to embedded system, not decided what to use whether RTOS or Embedded Linux, is there big difference between RTOS and embedded Linux?. also I need to reduce the C code size (during development all debugging symbols are visible), for final product, I don't need all debugging symbols, I need to turn off all those symbols, can I reduce code size for final product?. also I have to write a library which...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.