CodeRed Export

26 Sep 2013

Hi

I'm experiencing some problems while exporting a program to the lastest free CodeRed LPCXpresso.

1) In Portnames.h, PinNames.h, PheriphelralNames.h and Can_help.h (and probably the other headers too), the typedef statements should be below the enum statements defining the type being typedef'ed.

2) The 'packed' keyword is not supported as is (used it to carefully align some critical structs). To fix this, 'packed' should be replaced by a trailing attribute 'attribute((packed))'.

3) The irq keyword is not compiling (like in 'extern "C" void Adc_IRQHandler(void) irq {' ).

4) The method heapstats() does not seem to be available (used it in my code for diagnostics).

So the question is, will points 1 & 2 be changed in the export and how do I fix 3 &4?

regards wvd_vegt

26 Sep 2013

For issues 1 - 3, are you using a really old version of the mbed library? I thought those issues were fixed a long time ago.

-Adam

26 Sep 2013

Hi

A great (thanks for the quick answer), I'm a bit afraid to update a working (online) project.

Can I download/update the latest libraries separate?

I already disabled the heap code so that is not causing any problems and added an attribute instead of the irq (so it gets at least compiled).

The latest error I get in LPCXpresso is that it can't find the linker file. Any clues on that.

regards wvd_vegt

11 Oct 2013

Hi Wim,

Re your item 2, you can use the following construct:

#ifdef __CC_ARM
__packed struct BMPHeaderV3 {   //64 bytes in total
#else
struct __attribute__((__packed__)) BMPHeaderV3 {   //64 bytes in total
#endif

This allows the file to be compiled either online or with GCC.

Regards, Paul