LPCXpresso CPP

From efiHacks Wiki
Jump to: navigation, search

Contents

LPCXpresso C++ Sample Project

LPCXpresso, LPC1347.

Yes, LPCXpresso can do C++

but not out of the box in an easy way.

again, yes it can be done, but without a wizzard

we use Version: LPCXpresso v5.2.6 [Build 2137] [2013-07-08] in Kubuntu 12.04.2 LTS (Precise Pangolin)

i only use static class instantiation without new XXX

no destructor or virtual function ... basically anything which does not use dynamic mem alloc

also keep in mind, that i'm a EE and not CS ... so no compiler and language specs wizzard, etc ...

so far it worked fine

don't remember exactly how i got started a few month ago ... but something like this ... not 100 % sure

1) create a regular C project with wizz to get the startup stuff going.

2) create a C++ project, add or import the CMSISv2p10_LPC13Uxx project, if it's not already part of it ... or so

if you mix and match C and C++ files you need the extern"C" { } sections to take care of the C++ name mangling

also you will have a .project file and a .cproject file in your project dir and i assume one is for "C" and the other one for "CPP" ... i could be wrong ... never tried to analyze

sorry ... i don't have time right now to elaborate more on the setup and provide this page only as a download source for an early stage project we used for our wide band O2 Air / Fuel Ratio firmware project part.

more to come as soon as i have my head above the water again ... got way too long hung up on a, what i thought was a very nasty CJ125 related failure, and at the end it turned out the VM connection in the connector to the LSU 4.9 sensor was broken.
everything looks honky dory as long as you don't heat the sensor and makes you believe that the wiring is ok. and then you pick the VM signal of the board, cause it's available with all other signals and you go in circles for a couple of weeks analyzing the inner workings of the CJ125.

at least now i understand the CJ125 way better than without this experience, enough said.

Some Quick Hints :

sorry ... you will have to digest the code yourself, didn't have too much time to comment or elaborate on it ... again, sorry :(

Utils Folder

the files in utils fprint and nprint are from a real cool CS instructor in Berkley, Ca i made a few changes, maybe not for the better, but it did, what i wanted it to do. so please observe his Copyright (C).

UART Folder

uart was some code i got off the LPCXpresso sample files and changed it a bit.

Tick Folder

dir tick is my timer isr ... never leave home without it :)

Mon Folder

i'm dragging these file already around for more than 15 years with some mods every so often.
it's a very very simple and easy to use command monitor.

the cmd parsing is on a 32 bit unsigned int, as 4 cmd chars, and some numeric parsing ... i said simple, didn't i

mcMon.cpp/h are the core files for mem disp and mem edit and the token and number parsing files ... again simple EE style.

mcCmd.cpp/h are the extension to add project specific commands.

Finally Main

yes, i like my main.cpp class, with a nice constructor if necessary.

Sample Project Download Link

here is the link to download to the efiSerial project zip which is an early project startup zip-file.

also ... for this C++ project sample only please ignore any copyright notices as long as you don't use it for a commercial purpose


Note : All published design documentation is Copyright efiLabs.com and its use is without exception FOR NON COMMERCIAL PURPOSE ONLY. For commercial licenses contact efilabs.com ... try us, we're reasonable :)

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox