10 years, 5 months ago.

rtos - Missing __CORTEX_Mx definition

Hi all!

I'm just working on getting a program going with the rtos because I eventually want to use the TCI/IP stack.

I am trying the sample program and I am seeing the problem in the title (Missing CORTEX_Mx definition) when I compile it. Oh, I am using Eclipse offline as my development environment.

Where is this definition supposed to be made? Is it possible that I have an old version of the mbed library that does not include that definition?

TIA!

3 Answers

10 years, 5 months ago.

Hello Tim Borland,

here are macros for one project with RTOS and TCP/IP (exported like 20 days ago) :

TARGET_LPC1768, TARGET_M3, TARGET_NXP, TARGET_LPC176X, TOOLCHAIN_ARM_STD, TOOLCHAIN_ARM, CORTEX_M3, ARM_MATH_CM3

You probably add them to your application according to your setup.

Regards,
0xc0170

So I just need to include those defines (appropriate for my LPC1768 board) in my main.cpp before including the rtos.h file correct?

posted by Tim Borland 29 Oct 2013
Tim Borland
poster
10 years, 5 months ago.

So I tried defining the items that you specified and I am still getting the same error. Here are the defines I put in my main.h header file:

#define TARGET_LPC1768
#define TARGET_M3
#define TARGET_NXP
#define TARGET_LPC176X
#define TOOLCHAIN_ARM_STD
#define TOOLCHAIN_ARM
#define __CORTEX_M3
#define CORTEX_M3
#define ARM_MATH_CM3

And here are the includes in my main.cpp to show that I'm including my main.h before the rtos.h

#include "mbed.h"
#include "main.h"
#include "rtos.h"

So now I need to know where to go from here.

TIA!

After looking at the file that is producing the error I realized that the code checking the definitions was before any include file, so it must be looking for the value to be a preprocessor definition. However when I set it up as a preprocessor definition, it produces the same result.

Any help is GREATLY appreciated!

posted by Tim Borland 30 Oct 2013
10 years, 2 months ago.

Hi Tim,

Did you fix the problem yet? I encounter the same problems!

EDIT: For anyone out there also using GCC4MBED compiler. This was my fix: Add this line

DEFINES += -DTARGET_LPC1768 -DTARGET_M3 -DTARGET_NXP -DTARGET_LPC176X -DTARGET_MBED_LPC1768 -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M3 -DARM_MATH_CM3

Before you include gcc4mbed.mk in your Makefile

Cheers, Boris