Build firmware for Photon

Hi,

I am trying to build the Firmware for Photon. For that I cloned core-firmware, core-communication-lib and core-common-lib repositories. I also downloaded and install/setup ‘make’ and GNU toolchain for Windows7 . Then I go to core-firmware/build directory and run make command. But it is giving me following error:

make: *** No targets specified and no makefile found. Stop.

This error seems obvious as there is not Makefile present in that directory. Please note, I got this direction from some document. Then I go to the core-firmware/main directory and run ‘make clean all PLATFORM=photon’, but I am getting following error:

make -C …/modules/photon/user-part clean
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
make: *** [clean_modules/photon/user-part] Error 255

Can someone please help me to resolve this?

Thanks,
Dhaval

Have you seen/used these instructions?

@dhaval, for the Photon, you need to clone the develop branch and make sure you have the entire toolchain installed. The Photon firmware is comprised of a system firmware part and a user firmware part. To compile the system firmware go to the modules directory and make from there. For example, to compile the latest develop firmware and flash it to a Photon via DFU:

make clean all PARTICLE_DEVELOP=1 PLATFORM=photon program-dfu

This assumes you have a Photon connected via USB and in DFU mode (flashing yello).

To compile your app, you will find a user\application directory (under the main firmware directory). There you can create a directory and put all the files you want to compile (including libraries, etc) into that directory (no sub-directories). Then to make and flash your code to a Photon in DFU mode:

make clean all PARTICLE_DEVELOP=1 PLATFORM=photon program-dfu APP=appname

where appname is the name of the directory where you placed your files to compile.

:smile:

Hi @Moors7

Yes I followed from that getting started document. And I got those error after that only.

Thanks,
Dhaval

Hi @peekay123

I have tried to build the firmware as you have mentioned:

git checkout develop
make clean all PARTICLE_DEVELOP=1 PLATFORM=photon

But still it is giving the same error:
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)

Thanks,
Dhaval

I can’t see this in your procedure

As Paul said, you’d need to cd into the required directory before calling make

And in the Photon develop branch there should not be a core-firmware/main.

@ScruffR Thanks for you quick reply!

I got it… I want to build the firmware for Photon hardware, not for the CORE. I download checkout the firmware from ‘https://github.com/spark/core-firmware.git’. Is it correct?

I want to trace the function call for analogRead() in this firmware. Can you please help me on that?

Thanks,
Dhaval

I’d still go with the develop branch but build from main with e.g. make clean all PARTICLE_DEVELOP=1 PLATFORM=core APP=tinker (for Tinker).

1 Like

Thanks for your support @Moors7, @peekay123, @ScruffR… I am able to build the firmware on Linux machine.

But still I am not able to build it on Windows system… Getting same error.

Do you get any other error or like something about stat.exe failing?
I had this once (or still have it, if I use a wrong CMD instance) and it was a problem with the PATH.

Have a look at your PATH if something looks fishy (e.g. double entries).
You could also try this installer (maybe after you removed any previous toolchain - including PATH entries)

1 Like