I’m not sure if this is a bug in the current code, or something I’m doing wrong, however when working with the latest develop branch of the firmware, on Windows 7, with Arm 4.9 2015q2, I’m getting an error when building for the Photon platform, that I’m not seeing when building for the Core. I’m doing a git reset --hard prior to these builds, and building with make clean all v=1 with PLATFORM=photon for the photon build. Here’s the end of the build output:
I tried taking the offending line out of the rt_dynalib.h file, DYNALIB_FN(rt, sscanf), which results in a successful compile, however I’m afraid to try flashing the result, as I’m not sure if it’ll screw something up. Any ideas? Thanks!
Paging @mdma, but this seems to be resolved by building with the 2015q1 ARM toolchain, so my problem is fixed, but does there need to be a note, and/or is this a bug in the firmware for it to compile on the newest ARM GCC setup?
I’m also having issues, here is my error (when building with 2015q1)
C:\Spark\photon\firmware-develop\modules>make PLATFORM=photon clean all
0 [main] stat 5176 open_stackdumpfile: Dumping stack trace to stat.exe.stackdump
head: -38: invalid number of bytes
make[1]: *** [../../../build/target/system-part1/platform-6-m-lto/system-part1.bin] Error 1
make: *** [C:/Spark/photon/firmware-develop/modules/photon/system-part1/makefile] Error 2
C:\Spark\photon\firmware-develop\modules>
and with 2015q2
C:\Spark\photon\firmware-develop\modules>make PLATFORM=photon clean all program-dfu
C:\Users\Chris\AppData\Local\Temp\ccF61aSd.ltrans4.ltrans.o: In function `sscanf':
C:\Spark\photon\firmware-develop\modules\photon\system-part1/../../../rt-dynalib/inc/rt_dynalib.h:33: multiple definition of `sscanf'
c:/sparkcoreprograms/gnu tools arm embedded/4.9 2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libg_nano.a(lib_a-ssca
nf.o):sscanf.c:(.text.sscanf+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make[1]: *** [../../../build/target/system-part1/platform-6-m-lto/system-part1.elf] Error 1
make: *** [C:/Spark/photon/firmware-develop/modules/photon/system-part1/makefile] Error 2
C:\Spark\photon\firmware-develop\modules>
The problem is the same as reported earlier in the thread - stat.exe is crashing.
0 [main] stat 5176 open_stackdumpfile: Dumping stack trace to stat.exe.stackdump
Indicates that stat.exe crashed. That’s some issue with MinGW, that I’m afraid it out of my sphere of knowledge. The error when you downgraded to 2015q2 is the same error as others are seeing - it’s necessary to use the latest arm gcc version.
@mdma, 2015q2 is the newest version, as near as I can tell? it was released 3 days ago… I haven’t seen any issues with the stat command on 2015q1, so I can’t help anything with that. @peekay123, with 2015q2, I tried building from the root folder, from main, and from modules, and still get the multiple definition of sscanf error. All of those individual builds work with 2015q1.
I was getting mixed up with the versions I thought I was on 2015q2, I’m still using 2015q1, so please stick with that. (I had not seen the newer version.)
The stat.exe issue is not related to the compiler - it’s a problem with MinGW. Let’s keep both those issues separate in our minds to avoid further confusion.
Been doing some research on the error… should i be using a msys shell instead of a command prompt? if so how do i do that?
edit:
So i what i figured out so far… install all the Dependencies from here (and make sure to check versions) and follow @kennethlimcp tut from post 6 above.
start a shell using C:\MinGW\msys\1.0\msys.bat
navigate to the folder (note forward slash not back slash) cd c:/particle/firmware/modules
update system to develop firmware make PLATFORM=photon clean all program-dfu
that will compile part 1 and flash it using dfu, then go straight onto compile part 2 and flash it via dfu, and then compile user and flash via dfu. it then exits dfu mode and restarts the photon. now the photon is flashing green… and im yet to work out the next step of compiling my own code wish me luck
As far as I know, if you have all the correct tools in your path, a normal command shell should be fine. Btw, I was also working on compiling with a cygwin shell, and I got some errors if parts of the toolchain/compiler have spaces in their path.
Im giving up for a few hours… 2 days solid trying to get it working now
and i think i broke my photon need to push the reset button to get it to switch on after plugging it in… then i get flashing green. all i can do is push and hold the mode till it enters listening mode then put in wifi creds… next reboot it just goes flashing green and i dont know what fw its running
Thank you so much @Hootie81 ! I was so frustrated because I got everything to build on an old slow XP computer with flakey USB ports but couldn’t get it to work on my newer Win7 64 computer until your post. Now I’m in business and can flash successfully despite some mysterious final error messages that seem bogus:
so using the minGW shell ala @Hootie81 works fine for me (despite errors being reported) to flash photon from /modules in either the firmware-develop or firmware-0.4.2 branches. However, I bomb out with a stat.exe error if running from the simple windows7 64 bit command prompt. I can live with that.
Here’s the compile output in the minGW shell that works despite reported errors:
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash "
Downloading to address = 0x080a0000, size = 2328
Download [=========================] 100% 2328 bytes
Download done.
File downloaded successfully
Error during download get_status
make[1]: *** [program-dfu] Error 74
make[1]: Leaving directory `c:/particle/firmware-0.4.2/modules/photon/user-part'
make: *** [c:/particle/firmware-0.4.2/modules/photon/user-part/makefile] Error 2
I get the same error at the end… but the photon goes to flashing green? if i unplug and plug it back in it stays off till i push the reset button. when it comes on it goes back to flashing green. if i push and hold the mode button it goes solid green then into listening mode… i can enter the creds and it connects to the wifi and goes breathing cyan, but the next time i restart it goes to flashing green again…