7 years, 1 month ago.

Exporting project, resolving serial class/Eclipse is failing

I have a project that I cannot debug since Eclipse cannot find the definition of Serial class. I believe the problem is related to the DEVICE_SERIAL definition as it will be defined in the Makefile only. Eclipse cannot find it. I might be wrong. Do any one know how to solve this problem? I cannot debug my project using OpenOCD. All pathes are defined for Eclipse and -std=gnu11 is defined also for the compiler. thanks in advance

1 Answer

7 years, 1 month ago.

Hello,

In the source mbed library (mbed-dev or mbed-os) try to open the device.h file associated with the selected target board and add

#define DEVICE_SERIAL 1

For example as follows:

device.h

#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

//=======================================
#define DEVICE_ID_LENGTH       24

#define DEVICE_SERIAL 1

#include "objects.h"

#endif

The problem with this solution, whenever you update the mbed-library .. you have to do this again. I rather change the poroject setting than the device.h. I believe we need to take the cflags to eclipse so that eclipse uses them also.

posted by M J. 24 Mar 2017