Hi, I’ve been out of the Spark world for a while (messing with crappy ESP8266 sorry!) and am looking to get my hands on a Photon or two.
Sooooo. How to we build for a Photon, as obviously they’re different CPU and wifi chips for a start. Is it handled in the makefiles automatically, or do we have to pass in some arguments?
I’m not concerned with cloud IDE/spark-cli builds.
P.S. did you ever get static IP working (not static dynamic)?
We should have something really exciting to announce that will make it super simple for people using linux/mac/windows to compile their binary locally. Stay tuned!
I also see that the network stack has some flags to set the static ip but i might be wrong.
i don’t think the makefile setup needs to get any simpler, jees you download arm-none-eabi and dfu-util and type “make”, the new HAL branch means you only have one repo to download too.
p.s. i don’t like make v=1, can’t we use something normal like -v or --verbose ?
well i’d get rid of firmware/build/verbose.mk which then defaults us to verbose output. for the very few people who don’t want to see any progress, they can run “make -s” which gives you:
$ make -s
Building firmware for Spark core, platform ID: 0
text data bss dec hex filename
12932 632 3560 17124 42e4 ../build/target/bootloader/platform-0/bootloader.elf
text data bss dec hex filename
79708 1144 11620 92472 16938 ../build/target/main/platform-0/main.elf
$ make -s clean APP=bmp085_cloud
Building firmware for Spark core, platform ID: 0
$ make -s APP=bmp085_cloud
Building firmware for Spark core, platform ID: 0
text data bss dec hex filename
12932 632 3560 17124 42e4 ../build/target/bootloader/platform-0/bootloader.elf
text data bss dec hex filename
86084 1168 11632 98884 18244 ../build/target/main/platform-0/applications/bmp085_cloud/bmp085_cloud.elf
i’m trying to figure out how libraries are handled on a local build these days.
i thought we could put them in firmware/main/libraries or firmware/main/inc but that only seems to work for header files not c++ files (e.g. the bmp085 library has .cpp and .h files) and it also seems to be compiling every library instead of just the ones #include’d in the cpp source - actually it seems to be building every application - maybe the whole thing is broken - doesn’t seem to be building according to travis-ci either?
surely we don’t have to split .cpp files into src/ and .h files into inc/ ?
i’m sure we had this working months ago…?
i’ve tried the develop branch as well as master and they both seem to have the same problem, which branch should we be using these days?
am i right in that we no longer need core-common-lib or core-communications-lib, just firmware (not core-firmware) ?
ok thanks for the library info, i got it working as a subdirectory but thought we’d already fixed that - as surely the ide servers only use one copy of a library - or do they copy them for each script?
to support libraries locally, at a minimum need some metadata so the compiler knows which libraries to build and link. I’d really like to see this happen soon!
well we’d need some info on what that metadata is - i assume that’s linked to the build server setup which we have no visibility of?
the problem at the moment i guess is the recursive search for build.mk files - you can’t use a makefile to append the libraries to $CPPSRC as then every one will get built, and inc/ is only being appended to to the include path (for headers).
Another workaround is to include your own build.mk file in the application sources, and amend CPPSRC and INCLUDES_DIR to include the libraries you want to build.
Even doing this doesn’t quite get us there since the library format has a “firmware” directory, which contains all the sources and headers. Yet, the include directive is include “lib/lib.h” - no mention of “firmware”. There is some magic happening in the online IDE, which the local built would have to emulate, via copying or symlinks to fix up the namespace.
Probably best you checkout a clean working copy and try again. I didn't use the -s switch because I couldn't make it work - if make had set a variable indicating silent mode then I could have used that, but I didn't find any such variable.
But if I'm perfectly honest, it seems a bit petty to spend time worrying about whether we pass v=1 or -s to change verbosity - surely the syntax is moot so long as it's reasonably compact and works?