How to flash .h and .cpp files to a device?

photon
Tags: #<Tag:0x00007f03978ffb50>

#32

In the Web IDE, click on the “Devices” menu and change the “System Firmware Target:” for your device to 0.6.3:

image


#33

For some more reading on the Web IDE, here are the references: https://docs.particle.io/tutorials/developer-tools/build/photon/#wait-what-is-firmware-


#34

A while back I’ve seen a similar report and here is Rick’s response back then


#35

I changed the firmware target to 0.6.3 and it verified. However, when i go to flash it, it is giving “You are not including led.h log_backup.h rest_client.h wifi_login.h even though they are a part of this app. Are you sure you want to continue? To include these files, please hit cancel and add include lines to the top of the
to the top of the main app file”. Should i proceed?


#36

That’s just an ignorant warning from the Web IDE which expects you to include these headers in your .ino file since it doesn’t know that you’ll be indirectly including it anyhow.
This doesn’t harm the program at all, but if you want, you can add the include statements to remove that message.


#37

ok. i will try again this evening. thanks again everyone for your help.


#38

update… i had to login with a different laptop at home. i was getting several more error messages. i removed the MACS app and readded them back in with the instructions from above. I copied the contents of the main.cpp into the macs.ino, added the #pragma once into the .h files (first line), set the rom level to 0.6.3 now i am getting one error message. undefined reference to “wlan_select_antenna”. i tried to bring back the app link that i sent out in this message, however, all i get is a blank screen when i click on the link. i have been working on this for hours and trying not to bother you… https://go.particle.io/shared_apps/5c4ddd94405ba5554b0014c7


#39

Once you remove the base project from your account all shared revisions get invalidated too.
This is the version I’ve still got stored
https://go.particle.io/shared_apps/5c4b3dd5a48b8fa3fe000118
This builds for me with 0.6.3 (as does yours)


#40

Having trouble opening shared files… When i click on your link (or any other shared app links), it opens up the Particle Web IDE page and I do not get anything else? Do i add it thru the libraries? I have tried copying the link directly into Chrome, Firefox, Internet Explorer and… (father forgive me… Edge).


#41

I’m using Chrome and just clicking on the link should suffice.
However, when you copy/past the link make sure you are not also copying the view count that’s automatically appended to the link.
My link ends on 118 but when copy/paste it I get 1182 (currently two views have been registered).


#42

I was able to bring in your saved files. Thanks for the link. I am still getting "undefined reference to “wlan_select_antenna” when i verify. This is so strange. It was working… Grrr…


#43

Are you sure you are targeting a Photon and have set the build target to 0.6.3?


#44

Yes, it is showing the Photon connected. I am set to build 0.6.3.


#45

can u see if it that link will compile for you? This is bizarre.


#46

You have not selected the Photon as target - it needs to have the yellow star activated to actually become the desired target.


#47

That was it!!! I thought if i was connected to it (i was flashing the lights) that is all i needed to to do. Good catch! i owe you lunch … thanks again!


#48

Then how would it know which device to flash :wink: ?


#49

Very true… now i know that method! I was able to flash 3 of the modules! Strange thing, it does not like my work laptop for some reason. They may have some jacked up USB drivers they are using on the image. Again, i really appreciate the help! This community is really great!


#50

You may want to ready the changelog for v1.0.0 (which your screen capture shows is currently on the device).

or specifically:

Note: Downgrading [Electron/Photon/P1] OTA or YModem transfer:
If you need to downgrade, you must downgrade to 0.7.0 and then 0.6.3(Photon/P1), 0.6.4(Electron) to ensure that the bootloader downgrades automatically. When downgrading to older versions, downgrade to 0.7.0 first, then 0.6.3(Photon/P1), 0.6.4(Electron), then to an older version such as 0.5.5.


#51

The problem is not the installed device OS version but the build target.
You can run applications that are targeted at previous versions, so that’s not the issue.
The issue is that the respective commands where made “private” in versions following 0.6.3 so you can’t access them in code anymore, but they are still present to be called (when your code has the privilege).