8 years ago.

Offline toolchains: CodeRed versus LPCXpresso export not working for identical project LPC1768

Is anyone having any success getting projects exported to LPCXpresso to work?

We had a project a couple of years back which we exported to CodeRed. This worked fine offline in LPCXPresso 6.

Now when we export the updated project in the export specifically for LPCXpresso it doesn't work offline. We've done more work on it but nothing radically different.

So as a check we have exported the old original project with the new LPCXpresso export and it doesn't work offline whereas the previous export in CodeRed does. Nothing has changed bar the export option in the online compiler.

/media/uploads/ARMedanddangerous/coderedversusxpresso.jpg

So this leads us to think that the LPCXpresso export is broken and is a bug.

Replicated in LPCXpresso 6/7/8.

Outputs in LPCXpresso 6 for the old exported CodeRed project and new LPCXpresso export above. The earlier CodeRed export compiles just fine.

Currently madly copying and pasting between the working CodeRed export that does work and the newer C files.

UPDATE: We have tried copy and pasting now, but there seems much more to it and surely this is a common problem when exporting to offline toolchains?

Any help much appreciated.

Richard

Created an issue here: https://github.com/mbedmicro/mbed/issues/1655.

posted by Jan Jongboom 06 Apr 2016

What's your mbed lib? CAn you update to the latest one?

posted by Martin Kojtal 14 Apr 2016

That was the first thing I tried. I don't think it's the C or libs. It seems to be the project/linker settings etc. as Garry's comments confirm.

posted by Richard Plant 14 Apr 2016

2 Answers

8 years ago.

I have the same issue and luckily have a copy of a previous CodeRed export to compare. After much trial and error and changing of settings I decided to instead copy the project settings file from the working CodeRed export to the non-working LPCXpresso project within the workspace. So this is what I did:

In the workspace:

  • Copy the .cproject file from the working CodeRed project to the non-working LPCXpresso project
  • In the copied .cproject file I did a copy and replace on the project filename to replace the old file name with the new
  • I also had to copy the LPC1768.ld file from workspace\mbed\LPC1768\GCC_CR folder of the working project to the non-working project

The export from the MBED online compiler in LPCXpresso mode seems to create a .cproject file that is twice as big as the file when created in CodeRed mode, and gives compiler and linker errors.

The above seems a fudge to get the export to work properly, and if you don't have a copy of a previous CodeRed export then I presume you're stuck, though if you trawl through all the settings I presume you should be able to get it to work!

Does anyone have a view on why this should be and would it be too much to ask to re-instate the previous CodeRed export?

If anyone can shed any more light on this issue I'd be very grateful, thank you.

Regards, Garry

Accepted Answer

We did the above fixes and it worked.

Now a few weeks/months later the export has started working again so my guess is the fault lay with the mbed compiler and they fixed it in the background.

posted by Richard Plant 28 Jul 2016
8 years ago.

I've tried also to export a LPC1768 project to LPCXpresso and it works fine. The code in the issue from R. Plant shows a linker error with undefined 'fprintf'. I find this only in older mbed versions in api/error.h, so I guess that the project just needs a mbed lib update.There is a difference in api/error.h, the newer lib uses a mbed_error.h and vfprintf().

I'm not 100% convinced as I have updated the libs before exporting. That also doesn't say much for backward compatibility either.

Or are you saying update the libs in LPCXpresso somehow?

We've actually managed to get it going using Garry's method and copying and pasting to modify the project and linker files. There are a ton of errors and not just and fprintf error if you don't do that.

Looks like a suspect project and linker file to us that is being exported from the online mbed compiler.

Also shouldn't newer libs and headers go out from the online mbed export though?

posted by Richard Plant 14 Apr 2016