0.4.0 firmware available (pre-release)

I’m very pleased that we have been finally able to push our latest Core and Photon firmware into our public repo after obtaining the 3rd party licenses required! :confetti_ball: :balloon:

The firmware is available from https://github.com/spark/firmware/tree/develop in the develop branch and targets both the Core and the Photon:

  • Photon: The firmware is the 0.4.0 release that is flashed to photons once they first connect to the cloud, and is the same firmware flashed via Particle Build (Web IDE.)
  • Core: The firmware is pre-release since we have not formally released 0.4.0 on the Core. (The WebIDE is building 0.3.4, which corresponds to the master branch.)

I hope everyone that is building locally will test their apps on this new codebase and report their findings, positive or otherwise!

Over the coming days I will be updating documentation, pulling together all the info needed about how the repo has been restructured. In the meantime feel free to ask questions here!

14 Likes

@mdma, I tried to compile under Windows and getting following errors:

The syntax of the command is incorrect.
The syntax of the command is incorrect.
make[1]: *** […/build/target/user/platform-0-lto/src/src/application.o] Error 1

make: *** [user] Error 2

Could you please guide me how to solve this?

@krvarma, did you run make from the “main” directory? I am compiling on Win 7 without any problems.

@peekay123, yes, I am running from “main” folder. Previously I was having issue with “tr” command and after installing the GnuWin, that error is gone. My GCC version is 4.9-2015-q1-update and the make version is 3.81. I am on Win7 too.

@krvarma, I found that the path makes all the difference. Here is what I have installed on my Win 7x64 PC and the path I use:

  • Git version 1.95 preview20150309
  • GitHub 2.8.1.1
  • GNU Tools for ARM Embedded Processors 4.9 2015.q1
  • GnuWin32: Make 3.8.1
  • Nodejs 0.12.0 (for Particle CLI, etc)

The end of my path is:
PATH=…
C:\Program Files\nodejs;C:\Git\cmd;C:\win32-mingw32;C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q1\bin;C:\Program Files (x86)\GnuWin32\bin;C:\MinGW\msys\1.0\bin;C:\Git\bin

Hope that helps! :smiley:

1 Like

Cool that you can compile it. I am looking at the code but I cannot find any place where they call FreeRTOS’ xTaskCreate funciton to create a thread to deal with their internal stuff like Wifi communication. I can only find FreeRTOS’ header files but no .cpp. Do you know if they are included?

1 Like

The FreeRTOS calls are handled in the WICED SDK. At present, we don’t distribute the sources for that, only the compiled libraries. You can register with Broadcom to download the SDK to gain access to the sources.

Presently all the code runs on the main thread, so there’s not much to see under the covers.

3 Likes

@peekay123, let me try and get back here.

1 Like

Is there any ETA when 0.4.0 will make it to the Core via the Web IDE?

ETA is around 3 weeks time. We want to add version selection to the Web IDE so folks that want to build against the current release can do that.

6 Likes

@peekay123, I managed to rectify the error “The syntax of the command is incorrect” error, it was due to the “mkdir” command. By default this will take the Windows mkdir command. This results in the “The syntax of the command is incorrect” error. When it is changed to GnuWin's mkdir then it is working correctly (by modifying the common-tools.mk file). But after that following error is coming.

D:\particle\firmware\main>make
arm-none-eabi-gcc -Tlinker_stm32f10x_md _dfu.ld -L../build/arm/linker --specs=na
no.specs -lc -lnosys -u _printf_float -Wl,-Map,../build/target/main/platform-0-l
to/main.map  -L../build/target/user/platform-0-lto/src/ -L../build/target/wiring
/platform-0-lto/ -L../build/target/system/platform-0-lto/ -L../build/target/serv
ices/platform-0-lto/ -L../build/target/communication/platform-0-lto-prod-0/ -L..
/build/target/hal/platform-0-lto/ -L../build/target/platform/platform-0-lto/ -Wl
,--whole-archive -luser -lwiring -lhal -lsystem -lservices -lcommunication -lpla
tform -Wl,--no-whole-archive -L../build/arm/linker -nostartfiles -Xlinker --gc-s
ections  -flto -Os -fuse-linker-plugin  ../build/target/main/platform-0-lto/star
tup/startup_stm32f10x_md.o   -o ../build/target/main/platform-0-lto/startup/star
tup_stm32f10x_md
arm-none-eabi-gcc: error: _dfu.ld: No such file or directory
make: *** No rule to make target `../build/target/main/platform-0-lto/startup/st
artup_stm32f10x_md', needed by `../build/target/main/platform-0-lto/main.elf'.
Stop.

Don’t know why it is coming.

It’s necessary to have installed mingw and have that in your path so that the build can function correctly. (see https://github.com/spark/firmware/blob/develop/docs/dependencies.md#1-download-and-install-dependencies)

Also, are you targeting the Core or Photon? the make command on it’s own will target the core. Please see here for a link to the makefile docs for how to build platforms other than the Core. https://github.com/spark/firmware/tree/develop#how-do-we-build-these-repositories

1 Like

Thanks @mdma!, I have the MinGW installed already and is included in the path. Also I am targeting Core, I don’t have Photon with me :frowning:. But when I target the Photon just for testing, it is giving some other error:

D:\particle\firmware\main>make PLATFORM=photon
head: $((`stat: invalid number of bytes
make[1]: *** [../../../build/target/user-part/platform-6-m-lto/user-part.bin] Er
ror 1
make: *** [modules/photon/user-part] Error 2

Is there any particular order MinGW should appear?

@krvarma,

@peekay123 had some issues previously though everything was installed.

It would be good to uninstall the various old tools, reinstall MinGW and also set the $PATH properly.

I have shifted out the thread that i wrote (previously private) and hope it helps!

1 Like

Thanks @kennethlimcp, I am re-installing everything now and also trying on my Ubuntu, will post the progress here.

Sure! Ubuntu is also a little tricky when i tried it during the firmware development but i managed to make it work. Let me know if it doesn’t work for you.

Been playing with installation across various platforms recently :wink:

1 Like

OK, which platform Particle is using to compile the code?

Which platform as in OS? On the :cloud:, it’s definitely linux.

We have people using Mac, linux and windows for local compiling as well.

1 Like

Will it be possible to use RTOS features in Core or it will be available just for Photon?