code example of LPC802 in C++

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

code example of LPC802 in C++

1,429 Views
mohammad_kamil
NXP Employee
NXP Employee

Hello All,
Does any one have any code example of LPC802 in C++? if possible please share. 

With Regards

Kamil

Labels (3)
0 Kudos
5 Replies

976 Views
converse
Senior Contributor V

With only 16k of flash, you are going to struggle to get much of a C++ application running on a LPC802, unless you use a very small set of C++ features - basically, don't use anything bu the very simplest library calls, no templates, (standard) I/O etc.

You might find this tutorial useful:

C++ on microcontrollers 1 - introduction, and an output pin class - Wouter van Ooijen 

Part 2 shows using C++ on an LPC1114 which has 32k of flash, but a similar Cortex-M0 controller.

976 Views
mohammad_kamil
NXP Employee
NXP Employee

Hello converse‌, Thanks for your quick reply, yes as per customer they want to use very small code with some library such TOTP ( using hmackey) , it seems he has this library (in cpp) used in atmel device, now they want to use our device and wanted to port this library in LPC.

I have asked them to use "New project" from LPCXpresso and use C++ code option and then add this library. but it seems it is giving lots of compilation error. so they need our help have C++ code example and add this library and compile, rest he will develop his code on top of that.

Customer has shared *.Cpp and *.h file of TOTP library. let me know if you want to look into it. As i never used C++ so i have  very little idea of how to resolve those error.

 

With Regards

kami

0 Kudos

976 Views
mohammad_kamil
NXP Employee
NXP Employee

Hello converse‌ as the Atmel device was of 32kb, so customer is agreeing to use LPC804 (32kb) device. we have two option either we can use c++ code in our LPC804 and integrate c++files and header or we can have converter those c++ files and header to c and use it with LPCXpresso. 

With Regards

Kamil

0 Kudos

976 Views
converse
Senior Contributor V

If it compiled and ran on a 32kb Atmel device, it should be OK on the LPC804 device, given similar functionality - no need to convert to C. I can't look at your source code, but if you tell me what the errors are, I may be able to help.

0 Kudos

976 Views
mohammad_kamil
NXP Employee
NXP Employee

converse‌ there are lots absurd error it is throwing. let me work on it to reduce number of error to few then it will be easy to share those error.

0 Kudos