7 years, 5 months ago.

How to include mbed generated symbols in an SW4STM32 project developed off-line?

Hi Folks, I'm trying to compile (using Eclipse SW4STM32) an application that has been developed off-line to use mbed libraries, including mbed-dev. The problem is that the mbed compiler generates many symbols that are used by preprocessor defines in the libraries (including for example the name of the TARGET board). Those symbols are included in a programme export. However if I try to include a set of those symbols manually in Eclipse (i.e. under project properties, C/C++ General -> Paths and Symbols). The compiler complains with an error: 'makefile 57: unterminated variable reference. Stop.' I'm not entirely sure what's going on there, or if there is a reasonably simple method of incorporating the symbols without error. Be grateful for any advice. Thanks, Ron.

What micro are you using? I have spent a fair time with mbed-dev and mbed OS 5 in System Workbench. Getting a project setup has been extremely painful every time I've gone through it. The exporters always seem to get something wrong. Have you considered moving to mbed 5? The mbed-cli tool has an export option, and that has come pretty close to getting me a complete working project. For every build configuration (release, debug, etc), and for every tool (C,C++,Assy, etc), make sure the preprocessor symbol list is right, make sure the include paths are right. Check the fpu is set right. Would probably start by building with all optimzations off. For mbed-dev I had to add linker flags: -specs=nano.specs -specs=nosys.specs, for a single thread application. In the project tree, exclude from the build any file not related to the compiler or micro you are using. The makefile should be generated automatically (I think). Sometimes if I get a makefile error I need to Clean the project, or Refresh it, or even totally close out and reopen it.

posted by Graham S. 14 Nov 2016

Thanks Graham, really appreciate your helpful thoughts and information. Using various targets including STM32L151, STM32L432, currently STM32L073 A recent problem, unresolved for weeks now, is that with the latest restructured mbed-dev source library the on-line compiler won't export at all, to any IDE! Although it still exports using the older mbed-dev. With the older mbed-dev and with those linker flags you mention, I've been consistently able to compile and run without errors. Also I haven't had to fiddle with either include paths or symbols, which seem to be automatically created (or have been) correctly by an SW4STM32 export (contrary to the older export instructions). I haven't yet used mbed OS5, as there's a key networking library that would need modifying I don't know how yet. So with the current export problem and others from time to time, a goal now is to be able to use mbed libraries without resorting to the on-line compiler at all. The mbed-cli tool does sound like the most promising avenue, though maybe export would fail with the latest mbed-dev with that also. I successfully implemented the tutorial but haven't yet figured out how to compile source code that has been developed off-line. Will look at that now. Like yourself, I have also experienced makefile errors etc from time to time, projects disappearing that needed to be re-imported and various other, presumably Eclipse gremlins. Best wishes, Ron

posted by Ron Segal 14 Nov 2016
Be the first to answer this question.