0.4.0 firmware available (pre-release)

Yes, that’s correct although those branches are intended for the compile server and may not be around forever. Please use the 0.3.4-rc2 tag which marks the current release.

I was talking with @nexxy specifically about this yesterday! :smile:

While make is good for builds, it's not appropriate as our top-level entrypoint - things like checking prerequisites are especially tricky.

With the cli, we could compile locally using an extension of the current command, something like:

particle compile photon --local myappdir

This will also open the door to local library management....much excite! :smile:

1 Like

We’ve had a few issues lately with builds not working or having different behavior, which can be attributed directly to using a different version of the compiler than we tested on.

The latest build now checks the compiler version and stops the build if it is older than the minimum required. You’ll find the minimum required version listed in the build docs.

Hi,

I have updated all this, and switched to “latest” branch, but I am having build problems. The culprit seems to be the checkin “disable LTO since it causes linker errors on 2015 q2 ARM GCC 4.9.3. Fixes #471.”.

I got linker errors around isatty etc. Reverting that commit fixes the build issue.

Is anyone else also seeing this problem?

I get:

/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-writer.o): In function `_write_r': 
writer.c:(.text._write_r+0x10): undefined reference to `_write'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-closer.o): In function `_close_r': 
closer.c:(.text._close_r+0xc): undefined reference to `_close'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x10): undefined reference to `_read'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
collect2: error: ld returned 1 exit status

When I try to build my firmware after updating this morning. I am running Ubuntu 14.04 using the terry.guo gcc-arm-embedded ppa for the compiler.

You mentioned you updated this morning - which branch was that? Those errors mean that something is trying to read/write to standard input/output.

Please try removing the build/target directory and compile again.

I successfully did clean build of latest, so it’s not a general problem with the build but possibly something in your environment. Any other details you can share that might help us resolve this?

I am on branch “latest”. The way my code compiles, it always uses a clean version of your firmware. It always builds everything from a clean slate.

My code compiles fine if I revert this commit:

commit ed45a2c411e79437390adfa6f37d706f74ec79d8
Author: Matthew McGowan mat.mcgowan+github@gmail.com
Date: Mon Jul 13 22:42:07 2015 +0200

disable LTO since it causes linker errors on 2015 q2 ARM GCC 4.9.3. Fixes #471.

M modules/photon/user-part/makefile

I am using snprintf() a number of times in my code. I notice that the original bug is sprintf related.

Adding COMPILE_LTO=y fixes the problem for me. When I compile it that way my firmware all works.

Yes, then prices and I are exactly seeing the same. I assume that adding COMPILE_LTO=y is the same as not writing COMPILE_LTO=n (I have no idea what LTO is). I am using the recommended compiler. I did a clean rebuild and also removed the whole directory and checked out again - just to be sure. I guess it is related to the usage of snprintf.

I’m guessing it’s the user-part module that is failing to build?

I’ve added sprintf and snprintf to our build integration tests, but I’m unable to reproduce the error.

Related digression :grey_exclamation: The problem we have is that some bugs appear with LTO enabled, and others appear with it disabled! Can’t win either way! :slight_smile: With LTO enabled we’ve seen crashes - probably due to issues in our code or in the WICED library but it takes time to hunt them down, so quicker to disable the flag until we have time to investigate.

1 Like

Yes, it’s the user-part which fails. I will see if I can isolate a simple reproducer. I cannot post the whole code, it is in a relatively complex web server.

1 Like

My code includes a web server, also. I wonder if it is something in that part of the code. Did you write your own server, or use an open source one?

It’s my own.

@mdma Sorry to ask but I am not sure what your comment above means. Can you explain further?

Is there an ETA for 0.4.0 for the Core? Or do I need to delve into the delights of local compiling to get all the new features, bugfixes, etc.?

What is a "sprint"? I know that's a phone company, but that's probably not what you're referring to. Is this a particular interval?

2 Likes

@mdma As of yesterday, when I synch’d my firmware again from your repository, I get errors with COMPILE_LTO set to yes, or no. I get the same errors as before if I have it set to no. Now, if I have it set to yes, I get:

`snprintf' referenced in section `.text.unlikely.attoHTTPParseParam.constprop.25' of /tmp/ccSnHxsv.ltrans4.ltrans.o: defined in discarded section `.text' of rt_dynalib.o (symbol from plugin)
`vsnprintf' referenced in section `.text.attoHTTPprintf' of /tmp/ccSnHxsv.ltrans5.ltrans.o: defined in discarded section `.text' of rt_dynalib.o (symbol from plugin)
collect2: error: ld returned 1 exit status

So vsnprintf and snprintf are being discarded. I am not sure yet if this is in a system library, or part of the firmware that I am compiling.

Please remove the build/target directory and compile again, without any COMPILE_LTO flag. Thanks.

When I do that I still get:

/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x10): undefined reference to `_write'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0xc): undefined reference to `_close'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x10): undefined reference to `_read'

Never mind. I had debug code enabled in one section that included printf. That was the problem. :laughing:

Thanks for your help! :smile:

1 Like