problem with prototyped MBED software running on the LPC1769

30 Jun 2013

Dear all,

We have a program that works/prototyped perfectly fine on MBED. Next step for us is to have the same program running on our own dedicated PCB which uses a LPC1769. The electronic layout is exactly the same as the LPCXpresso board.

From the different MBED forum topics I understand that it should be possible to run exactly the same MBED program on the LPC1769 as well. So we take the .bin file and use the LPCXpresso's IDE to flash our .bin to the LPC1769.

We notice that the initialization part of the program works just fine. However, when we try to get it to do some other stuff it becomes unresponsive.

Question 1: to solve this I exported my MBED program for the LPCXpresso IDE Code Red suite and imported it in the suite. Now I want to build and flash it from within this suite. However, I notice that I now get all kind of errors when trying to build, while the MBED compiler was just fine. How can this be? Is this a build setting in the suite?

Question 2: Should I worry about these errors occurring in the Code Red suite or should directly flashing the .bin file as compiled in the MBED online compiler still work just fine.

Question 3: any other ideas where to look for the problem?

Thanks,

R

30 Jun 2013

When I exported to Code Red it was simply a matter of exporting, importing, works fine. If you do it on a HelloWorld program, does it work? If it works, does is still work when you paste your code in the HelloWorld program?

The mbed .bin file should work fine on an LPC1769, I assume the Code Red suit doesn't do weird stuff with the .bin file but just uploads it.

But in general the issue is here a lack of information. You get undefined errors after you try to import an undefined program. This program does initialize fine, but when you try to let it execute undefined functions it becomes unresponsive. So when you try to upload a blinking led program, does that work? And considering initialization works, can you try to narrow down what the issue is? I assume you do not use Local File System? Mbed ethernet libraries? What do you use? For example I2C can easily lockup your program since mbed I2C code waits until the bus is available -> if you forgot pull-up resistors it will lock your program. Do interrupts still get executed?

I don't know if that program is confidential, but we really will need more information.

01 Jul 2013

Hi Erik,

Thanks for the response. The program itself is quite extensive with many separate files. So to much to fully explain. But I agree on your feedback, so let me try to narrow it down to make it possible for you and others to come up with ideas where to look. I have done some rework of the MBED program and again, in MBED it builds without any error or warnings.

If I try to build the same code in the Code Red suite I get the following error that seems the one to be concerned about:

"expected initializer before __irq " in Source: USBHost_log.cpp.

We use the AndroidAccessory library (http://mbed.org/users/p07gbar/code/AndroidAccessory/file/98fbe1660f0a/ ) which includes a USBHost library with USBHost_log.cpp inside.

I have read the following: "The __irq keyword enables a C or C++ function to be used as an interrupt routine. __irq is a function qualifier. It affects the type of the function. "

But that is about as far as my knowledge goes about using attributes. Any ideas on why this error with '__irq' occurs when building in the Code Red suite and not when using the MBED online compiler?

Thanks!

01 Jul 2013

I am afraid that compiler issues aren't exactly my strong point, which is why I like the online compiler so much. But you don't use them pre-compiled mbed library but the source one, modified with some changes? I once tried to get that into code-red, which wasnt a success. Then again I didn't use export from mbed compiler, so maybe that should just work. You can manually pre-compile your library and see if that works (see: http://mbed.org/handbook/mbed-tools). Although as I said, this isn't my strong point, maybe these suggestions make no sense, and there should be people here who have more experience with that.

If that works I guess you can debug it, but still it should just work from the mbed compiler bin file. So I would first try to see if a blinking led program works. If that works, try to disable large sections of your program to find out which part is responsible. It can be something as small as a forgotten pull-up resistor on an I2C line.

01 Jul 2013

Assuming you are not using Ethernet, or LocalFileSystem, then you should not realy have any problems porting,

how complicated is your PCB ?
Ddoes it have LCD's accseloromiters, etc etc etc.
the more info you supply the more MBEDer's will help!

also have you attempted to write some unit testing code ?

simple flashing lites are always a good start !
also make 1000% sure your serial link etc is working properly,

I am assuming you are using Flash Magic, to programm, and not J-Tag ??

If you want I will have a look at your copper.

Cheers

Ceri.

04 Jul 2013

Dear Ceri, Erik,

Thanks for the feedback. For now I neglect the errors that the Code Red suite gives during building. It seems that the .bin file compiled in the MBED compiler works. But we weren't sure if some output we see was caused by the software not running on the LPC1769 as it should. That's why we tried to compile again in the Code Red suite. I still don't understand the errors but just leave them for now.

The PCB is a dedicated design and I think it's fair to say it's a very complex one. By some additional experiments I did the PCB itself became the suspect. So (for now) let's say 'case closed' regarding porting the MBED software to the LPC1769.

Thanks again for the support!

26 Sep 2013

Hi

Any solution yet to the Irq problem (I'm running into the same problem porting to CodeRed) ?

regards wvd_vegt