Cannot build offline - Embedded Artists LPC4088 Experiment Base Board

12 Oct 2017

EDIT: Post updated with screenshots.


As detailed below, I've made attempts via several different methods to export and build the "Demo Application" for the Embedded Artists LPC4088 Experiment Base Board offline, all without success. Why is it not working, and how can I get it working?

Direct link to the application: https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/

It is linked from here in the "Demo Application" section: https://os.mbed.com/users/embeddedartists/notebook/lpc4088-experiment-base-board---projects/

It looks like it's using an old version of mbed, and there are some broken library references, among other things... But I don't know how to fix it.

My various export and build attempts

For later reference, note the available and greyed-out export options from the mbed online "compiler".

/media/uploads/bmcdonnell_ionx/mbed_online_compiler_export_options.png

1. mbed online compilation fails with "update libraries" option.

Details

From https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/

"Import into Compiler"

  • Import As: Program
  • Update all libraries to the latest revision - CHECKED

Import warnings:

/media/uploads/bmcdonnell_ionx/01_mbed_online_compiler_import_warning.png

Compilation fails.

/media/uploads/bmcdonnell_ionx/01b_mbed_online_compilation_fails.png

2. mbed online compilation succeeds, but cannot build exported project.

(This is the basis for #s 3 - 5, below.)

Details

From https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/

"Import into Compiler"

  • Import As: Program
  • Update all libraries to the latest revision - UNchecked

Import warning:

/media/uploads/bmcdonnell_ionx/02_mbed_online_compiler_import_warning.png

Compilation succeeds (with warnings).

/media/uploads/bmcdonnell_ionx/02b_mbed_online_compilation_succeeds_with_warnings.png

3. Export from online "compiler" to Keil uVision5 fails.

From https://os.mbed.com/compiler/#nav:/lpc4088_ebb_ptp;

Details

Right click project, choose Export...

/media/uploads/bmcdonnell_ionx/03a_mbed_online_compiler_export_program.png

  • Export Target: EA LPC4088 QuickStart Board (the only option)
  • Export Toolchain: Keil uVision5
  • Export All Files: [checked/unchecked does not affect result]

/media/uploads/bmcdonnell_ionx/03b_mbed_online_compiler_export_to_keil_uv5.png

Result: ERROR - "An error occurred during export. Please contact support."

/media/uploads/bmcdonnell_ionx/03c_mbed_online_compiler_export_to_keil_uv5_error.png

4. Export from mbed online "compiler" to LPCXpresso succeeds, but cannot build due to linker error.

Some source edits were required to resolve compiler errors, and the linker option "No startup or default libs (-nostdlib)" was DE-selected to get it that far. I can build and run if I rem out `mcifs.runTest()` in main.cpp... but I need to use the SDCard, so this is not a viable resolution for me.

Details

From https://os.mbed.com/compiler/#nav:/lpc4088_ebb_ptp;

Right click project, choose Export...

/media/uploads/bmcdonnell_ionx/03a_mbed_online_compiler_export_program.png

  • Export Target: EA LPC4088 QuickStart Board (the only option)
  • Export Toolchain: LPCXpresso
  • Export All Files: UNchecked

/media/uploads/bmcdonnell_ionx/04b_mbed_online_compiler_export_to_lpcxpresso.png

Export succeeds.

  • Extract downloaded zip file. Put folder in desired location on filesystem for development.

Using MCUXpresso IDE (v10.0.2 [Build 411][2017-07-11]) (I also tried LPCXpresso v8.2.2_650 - same result.)

  • Import project(s) from file system...
    • choose root directory

/media/uploads/bmcdonnell_ionx/04c_mcuxpresso_proj_import.png

Uncheck "Copy projects into workspace"; check project.

/media/uploads/bmcdonnell_ionx/04d_mcuxpresso_proj_import_screen_2.png

  • Build project

/media/uploads/bmcdonnell_ionx/04e_mcuxpresso_build_proj_-context_menu-.png

Build errors (note many warnings, too)

/media/uploads/bmcdonnell_ionx/04f_mcuxpresso_build_errors.png

Edit TestAcc.cpp to resolve first two errors (int -> int32_t). Build project again - new errors

/media/uploads/bmcdonnell_ionx/04g_mcuxpresso_build_errors.png

Edit WM8731.cpp to resolve new errors (add curly braces around body of path_analog case). Build project again - linker errors remain

/media/uploads/bmcdonnell_ionx/04h_mcuxpresso_build_linker_errors_1.png

Project properties - uncheck the "No startup or default libs (-nostdlib)" option.

/media/uploads/bmcdonnell_ionx/04i_mcuxpresso_linker_options_uncheck_no_startup_or_default_libs.png

Build project again - one new linker error remains

/media/uploads/bmcdonnell_ionx/04j_mcuxpresso_build_linker_errors_2.png /media/uploads/bmcdonnell_ionx/04k_mcuxpresso_build_linker_errors_2_console.png

10:42:31 **** Incremental Build of configuration Debug for project lpc4088_ebb_ptp ****
make -r -j4 all 
Building target: lpc4088_ebb_ptp.axf
Invoking: MCU C++ Linker
arm-none-eabi-c++ -L"C:\dev\lpc4088_ebb_ptp" -L"C:\dev\lpc4088_ebb_ptp\EALib" -L"C:\dev\lpc4088_ebb_ptp\EALib\FATFileSystem" -L"C:\dev\lpc4088_ebb_ptp\EALib\FATFileSystem\ChaN" -L"C:\dev\lpc4088_ebb_ptp\I2S" -L"C:\dev\lpc4088_ebb_ptp\LM75B" -L"C:\dev\lpc4088_ebb_ptp\SDFileSystem" -L"C:\dev\lpc4088_ebb_ptp\mbed" -L"C:\dev\lpc4088_ebb_ptp\mbed\TARGET_LPC4088" -L"C:\dev\lpc4088_ebb_ptp\mbed\TARGET_LPC4088\TARGET_NXP" -L"C:\dev\lpc4088_ebb_ptp\mbed\TARGET_LPC4088\TARGET_NXP\TARGET_LPC408X" -L"C:\dev\lpc4088_ebb_ptp\mbed\TARGET_LPC4088\TOOLCHAIN_GCC_ARM" -L"C:\dev\lpc4088_ebb_ptp" -Xlinker -Map="lpc4088_ebb_ptp.map" -Xlinker --gc-sections -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -T "C:\dev\lpc4088_ebb_ptp\mbed\TARGET_LPC4088\TOOLCHAIN_GCC_ARM\LPC4088.ld" -o "lpc4088_ebb_ptp.axf"  ./SDFileSystem/SDFileSystem.o  ./LM75B/LM75B.o  ./I2S/I2S.o  ./EALib/FATFileSystem/ChaN/ccsbcs.o ./EALib/FATFileSystem/ChaN/diskio.o ./EALib/FATFileSystem/ChaN/ff.o  ./EALib/FATFileSystem/FATDirHandle.o ./EALib/FATFileSystem/FATFileHandle.o ./EALib/FATFileSystem/FATFileSystem.o  ./EALib/AR1021.o ./EALib/Adafruit_GFX.o ./EALib/EaLcdBoard.o ./EALib/GFXFb.o ./EALib/LcdController.o ./EALib/MCIFileSystem.o ./EALib/MMA7455.o ./EALib/QSPIFileSystem.o ./EALib/SPIFI.o ./EALib/TSC2046.o ./EALib/XBee.o ./EALib/glcdfont.o ./EALib/gpdma.o ./EALib/sdram.o  ./AR1021I2C.o ./EaLcdBoardGPIO.o ./Graphics.o ./TestAcc.o ./TestAudio.o ./TestDisplay.o ./TestFileSystemMCI.o ./TestFileSystemSPI.o ./TestJoystick.o ./TestRGBLed.o ./TestShiftreg.o ./TestTemperature.o ./TestTrimpot.o ./WM8731.o ./main.o  C:/dev/lpc4088_ebb_ptp/mbed/TARGET_LPC4088/TOOLCHAIN_GCC_ARM/system_LPC407x_8x_177x_8x.o C:/dev/lpc4088_ebb_ptp/mbed/TARGET_LPC4088/TOOLCHAIN_GCC_ARM/board.o C:/dev/lpc4088_ebb_ptp/mbed/TARGET_LPC4088/TOOLCHAIN_GCC_ARM/cmsis_nvic.o C:/dev/lpc4088_ebb_ptp/mbed/TARGET_LPC4088/TOOLCHAIN_GCC_ARM/retarget.o C:/dev/lpc4088_ebb_ptp/mbed/TARGET_LPC4088/TOOLCHAIN_GCC_ARM/startup_LPC408x.o -lmbed
c:/nxp/mcuxpressoide_10.0.2_411/ide/tools/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
c:/nxp/mcuxpressoide_10.0.2_411/ide/tools/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0x10): undefined reference to `_kill'
c:/nxp/mcuxpressoide_10.0.2_411/ide/tools/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
collect2.exe: error: ld returned 1 exit status
make: *** [lpc4088_ebb_ptp.axf] Error 1

10:42:33 Build Finished (took 1s.812ms)

5. From the online mbed compiler, attempting again to export to LPCXpresso,

but selecting the "Export All Files" in the export dialog (shown UNchecked in screenshot 04b_mbed_online_compiler_export_to_LPCXpresso.png) increases the size of the downloaded zip file, but does not change the contents, other than the build timestamp in the .cproject file. So the result is the same as #4.

6. "Export to desktop IDE" (LPCXpresso) directly from project page

Excludes dependencies from downloaded zip file. (Excludes EALib, I2S, LM75B, and SDFileSystem. Includes mbed.) Zip file contents otherwise are basically the same as #4.

From https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/

Click "Export to desktop IDE". Choose toolchain "LPCXpresso (DEPRECATED)".

/media/uploads/bmcdonnell_ionx/06a_project_export_page.png /media/uploads/bmcdonnell_ionx/06b_project_export_to_lpcxpresso_deprecated.png

7. "Export to desktop IDE" (uvision5) directly from project page fails

"Page error" / "Sorry, this page is currently unavailable."

/media/uploads/bmcdonnell_ionx/07a_project_export_to_uvision5.png /media/uploads/bmcdonnell_ionx/07b_failed_export_to_uvision5.png

8. I am unable to export to an offline IDE using mbed-cli.

I describe this in more detail here: https://os.mbed.com/questions/79232/Cannot-export-to-IDE-from-mbed-cli/

12 Oct 2017

I am working to replicate your issue. Though, I need to download eclipse.

In the meantime, I suspect the issue might be an outdated mbed build, so it might be quicker for you to try this first. In the online compiler, please right-click the mbed folder in the project and select "update". Then perform the export.

12 Oct 2017

Hi Sarah,

Thanks for the prompt reply. Please note that I updated the OP with screenshots.

I updated the mbed library as you suggested, but this breaks the online build, as pictured below, so I did not continue with attempting export.

Sarah Marsh wrote:

I need to download eclipse.

Note I'm using MCUXpresso, not Eclipse proper. I don't know if that makes a difference to your troubleshooting.

/media/uploads/bmcdonnell_ionx/09a_updated_mbed_breaks_online_build.png

12 Oct 2017

Right. This is a bit of a mess. So, this is a really old program. A lot has changed in Mbed, so it is probably using some outdated API calls, as well as outdated tools. Can I ask what you want to use from this repository? I could work on porting some of it to the newest version of Mbed or even Mbed OS, if you're interested.

12 Oct 2017

Sarah Marsh wrote:

Right. This is a bit of a mess. So, this is a really old program. A lot has changed in Mbed, so it is probably using some outdated API calls, as well as outdated tools.

I also submitted a tech support request to Embedded Artists this morning, summarizing the issues and pointing them to this post. I don't know yet how responsive they'll be, but if they don't chime in soon, maybe someone they'll listen to someone from ARM... ;)

Sarah Marsh wrote:

Can I ask what you want to use from this repository? I could work on porting some of it to the newest version of Mbed or even Mbed OS, if you're interested.

With all my wrangling described in attempt #4, I did get it to build and run without the SDCard, albeit with numerous warnings. So I'd like for the whole thing to be less of a mess, but the SDCard is the primary roadblock.

Items of interest for me:

  • UART / serial comm
  • Buttons
  • LEDs & shift register
  • SDCard (via the MCI interface, e.g. using MCIFileSystem)
  • Audio CODEC
  • maybe Joystick

Don't care about:

  • SPI interface to SDCard
  • Trimpot
  • Display
  • Temperature
12 Oct 2017

Most of these can be accessed just from the high level Mbed OS APIs, and we have some great, simple examples that you might be interested in trying:

Hope this helps.

12 Oct 2017

Thanks for the pointers.

Sarah Marsh wrote:

you might look into trying to port the implementation to mbed OS, if EA doesn't respond.

I'm still not clear on what is and isn't "mbed OS"...

I've read about mbed OS 2, mbed OS 3 (rarely mentioned), mbed OS 5, just plain "mbed". Can you clarify the differences between these (and any others I missed)? Links to documentation explaining this would be helpful.

What is just plain "mbed" in the software sense? Is it a library with no OS? How can I tell which among these things and which version a program is using? Like with this "Demo Application", for example.

12 Oct 2017

This blog post does a great job of explaining some of the differences, and what's great about Mbed OS.

The documentation link in the post is now outdated, and you can find our most recent docs for Mbed OS here.

Brendan McDonnell wrote:

How can I tell which among these things and which version a program is using? Like with this "Demo Application", for example.

Just plain mbed will use .bld files, like the one in your application - https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/file/eb6086159020/mbed.bld

Mbed OS uses .lib files - https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/file/c0e9192885c6/mbed-os.lib

12 Oct 2017

Sarah Marsh wrote:

This blog post does a great job of explaining some of the differences

That is somewhat helpful, but I'm still confused. Why is there no mention of "just plain mbed" - and what that means - in the docs? (I don't recall having seen it explicitly anywhere; so far I've just inferred that it may be a thing...) Is "mbed" a set of libraries (which may run on "bare metal"), and "mbed OS" the libraries plus an OS? If so, how can I tell by looking at a project whether or not it's using the OS?

Is there also "mbed 2", "mbed 3", and "mbed 5", in addition to "mbed OS [235]"?

Sarah Marsh wrote:

Brendan McDonnell wrote:

How can I tell which among these things and which version a program is using? Like with this "Demo Application", for example.

Just plain mbed will use .bld files, like the one in your application - https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/file/eb6086159020/mbed.bld

Mbed OS uses .lib files - https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/file/c0e9192885c6/mbed-os.lib

That's the only way to tell? That seems...opaque. Besides, the lpc4088_ebb_ptp application has .lib files, too. (1, 2, 3, 4)

How can I tell what version (2/3/5) of mbed is being used?

Also, what is a .bld file?

12 Oct 2017

"plain mbed" is mbed 2.

mbed 3 was based around eventing, and was essentially a short term product that isn't really supported anymore.

mbed 5 is mbed OS.

Obviously the word "mbed" is overloaded, so we combine it with the major version number to distinguish between the 3 major versions of the library.

As the blog post states, mbed 5 aims to combine the libraries of mbed 2 with mbed-rtos (a library to be used with mbed 2 that provided RTOS APIs) and the events system of mbed 3.

Essentially, mbed 2 and mbed OS share the same peripheral APIs, but mbed OS adds RTOS functionality.

Quote:

That's the only way to tell? That seems...opaque. Besides, the lpc4088_ebb_ptp application has .lib files, too. (1, 2, 3, 4)

I mean, the main way to tell is that the mbed 2 library has the name "mbed" and mbed OS is called "mbed-os". They also have different revision histories if you were to view their histories with a version control tool. Their directory structure looks essentially the same, but Mbed OS obviously has some code to provide the RTOS. All of the official team mbed code samples will have a "warning" that should let you know if a project is outdated (IE mbed 2 or 3). But, the big marker for me personally is the .bld file extension on the mbed library. Maybe you prefer to look at the naming scheme.

.bld files and .lib files are essentially the same thing in that they are just links to code repositories that the tools read and use to pull in the corresponding dependency. However, .bld files are unique to the mbed library itself, as they signify a link to a precompiled binary of the mbed library.

12 Oct 2017

It is becoming clearer, thank you.

(I know we're off-topic now, but I've been looking at this stuff for two weeks, and I'm still trying to get clarity on this big picture stuff. Since we're on a roll, I'll keep going...)

I'll number my questions below for reference.

Sarah Marsh wrote:

As the blog post states, mbed 5 (synonym for mbed OS), aims to combine the libraries of mbed 2, with mbed-rtos (a library to be used with mbed 2 that provided RTOS APIs), and the events system of mbed 3.

Essentially, mbed 2 and mbed OS share the same peripheral APIs, but mbed OS adds RTOS functionality.

1. So "mbed OS 2" is not a thing? Likewise "mbed OS 3"?

2. Is mbed OS (5) an OS with a realtime option? Or is it always an RTOS?

3. Can mbed 5 be used on bare metal? i.e. No OS, with a main loop. If so, how can I tell by looking at a project whether it's using the OS?

Sarah Marsh wrote:

the main way to tell is that the mbed library has the name "mbed" and mbed OS is called "mbed-os".

This is clearer, IMO, thanks.

Sarah Marsh wrote:

.bld files are unique to the mbed library itself, as they signify a link to a precompiled binary of the mbed library.

4. .bld files signify the link to what program? i.e. What program takes a .bld file as input?

5. Is the precompiled mbed library binary a .o file?

6. Have I got it right that the canonical location for mbed 2 source code is on os.mbed.com, but the canonical location for mbed OS/5 is on github? And if you don't mind, I'm curious - why?

12 Oct 2017

I understand. The history of Mbed can be a lot to take in as a new user, as it has evolved a lot over the years.

  1. No, mbed OS 2 or 3 is not a thing
  2. It is always an RTOS
  3. This is mbed 2. I'm hesitant to commit to the statement "mbed 2 is mbed 5 minus the RTOS," because every API provided with mbed OS expects to use the RTOS. This allows us to better support things like the filesystem and neworking APIs (these are baked into mbed OS as opposed to independent libraries like in mbed 2).
  4. .bld files are used by the mbed tools, which are doing all the importing, exporting, and compiling behind the scenes. You can use the tools directly with mbed CLI, but they are behind the scenes of the online website and compiler too! For example, when you call "mbed import [URL]", the tools read all the bld/lib files in the project and perform all the necessary commands to clone the linked repository into your project space. This also happens when you use the "import" button to import anything into the online compiler.
  5. The library is actually a .a file, which is basically an archive of .o files
  6. Yes. Mbed OS is hosted on GitHub so that we can better handle the many contributors who write code for Mbed OS.
13 Oct 2017

7. (Re: 3) What do you recommend for a user now doing new development who doesn't want an OS? Platform, libraries, etc.

8. How lightweight can the OS be? e.g. When a user doesn't think he/she needs an OS, but may use it if it has low enough runtime overhead.

9. What is the entry point for mbed OS - still main()? And where does the user's "main" code go?

EDIT: 9. Taking another look at Blinky, it looks like main() is the entry point, and where the user's code goes.

13 Oct 2017

Brendan McDonnell wrote:

7. (Re: 3) What do you recommend for a user now doing new development who doesn't want an OS? Platform, libraries, etc. The libraries you need would depend on what you want to accomplish in your application. It appears you are already including LWIP. You may also need many drivers to talk to peripherals which depends on platform, so you will need platform as well.

8. How lightweight can the OS be? e.g. When a user doesn't think he/she needs an OS, but may use it if it has low enough runtime overhead. OS will bring in scheduler and scheduler will need ticks which is usually 1ms, and also the overhead of doing task switches. If you have simple application which is completely interrupt driven you may not need OS.

9. What is the entry point for mbed OS - still main()? And where does the user's "main" code go?

EDIT: 9. Taking another look at Blinky, it looks like main() is the entry point, and where the user's code goes.

13 Oct 2017

So if a developer wants to develop a new bare-metal (no OS) firmware application, the modern mbed is not an option, because all the modern libraries available here are built on the OS - right?

That is, assuming the developer doesn't use the old mbed 2 - which would be a bad idea, since it's basically deprecated - right?

13 Oct 2017

Brendan McDonnell wrote:

That is, assuming the developer doesn't use the old mbed 2 - which would be a bad idea, since it's basically deprecated - right?

We still maintain and release bug fixes for mbed 2, but it is not under active development.

The networking and filesystem libraries for Mbed OS are better/faster/more developed, because they have the advantages of the RTOS. Mbed is designed for IoT devices. By nature, these devices must be connected to the internet. We have built the best platform to allow memory constrained devices to connect to the internet. So, if you want to develop an IoT application, use Mbed OS.

There is a way to compile Mbed OS without the RTOS, but it is not "officially supported." If that's what you really want, I can help you out.