How to build the firmware.bin file

Thatā€™s great to know. Iā€™m going to stop worrying about the size difference now that I know it even happens to you. Iā€™m pretty confident I know how to get the release sources now. Maybe Iā€™ll take a crack at getting rid of some or all of the 80 warnings; Iā€™ve always found that ignored warnings are a bad idea.

1 Like

Emil, I was able to take the source code for the 1.0.1 release and eliminate all 80 warnings so that it compiles cleanly. Many of those were simple unused variables, but 10 specific warnings turned out to be because of suspected coding errors. Anyway the changes are concentrated in 19 source files. Iā€™ll send the annotated files to contact@circuitmess.com. It seems to run just fine.

4 Likes

Okay, thanks for that.

This seems like a standalone issue so I would prefer to have it in a separate forum thread to avoid irrelevant posts in this thread.

Also, a better course of action might be to fork our repository on github and open a pull request for our library/firmware, whichever you edited.

I will go over the files youā€™ve sent and will message you back via email.

1 Like

I have opened pull requests to CircuitMess-Ringo-firmware and CircuitMess-Ringo that removes all warnings and fixes the bugs hidden among them.

Remember that:

Compiler warnings should always be taken seriously, since bugs will hide among them.

2 Likes

Has anybody tried to build it from the command line? Iā€™m having some success, but am missing setup() and loop(). Those functions are defined in /home/nelson/ringo/CircuitMess-Ringo-firmware/src/main.cpp but that file isnā€™t getting included in the build.

The command line of which build environment? Arduino? VS Code? Something else?

Unix shell. Probably using platformio.

You got me there. I searched high and low through my Windows 10 machine running VS-Code with Platformio extension and couldnā€™t find hide-nor-hair of a Makefile. Yet I know the compiler options must be being set somewhere because in this compilation ā€œcharā€ is unsigned which is NOT the default for g++. Do you have a Makefile, and if so where did you get it? Main.cpp is in the same directory as the rest of the firmware, so something would have to be intentionally NOT compiling it, while compiling everything else.

I know what I did wrong here. I did a git clone in ā€¦/lib/MAKERphone, which put the files into CircuitMess-Ringo, whereas they should have gone directly into MAKERphone. Oops.

If youā€™re reading this, you should be reading that: Ringo Reflash factory firmware

Looks like you found the answer to your question, Russ.

1 Like

So now that itā€™s workingā€¦ whatā€™s the secret command line to do a build?

1 Like

In an attempt to answer my own question, I tired (from the top level Firmware directory):

C:\Users\Frank\.platformio\penv\Scripts\platformio.exe run --target clean
C:\Users\Frank\.platformio\penv\Scripts\platformio.exe run

But the generated firmware.bin file was different (and of a slightly different size) from the one which is generated by building from the VS Code GUI (Terminal/Run Taskā€¦/PlatformIO: Build Firmware). I didnā€™t try to run it on the phone.

So I seem to have failed to find a command line that exactly duplicates what the GUI does. Enlighten me Russ :slightly_smiling_face:

Yes @RussNelson, weā€™re all eager to know! :smiley:

Thank you guys for being such a big part of the community! :partying_face:

Yes, itā€™s just following the combination of the ā€œReflash factory firmwareā€ instructions and Frankā€™s instructions then running platformio run. That builds the .bin file, then you program it into the phone using the esptool.py command.

I havenā€™t looked into why the executable is yet a third size: 1547424

1 Like

Because i want to change some thinks in firmware is there any guide with steps how to compile it ? I have downloaded the vs code but i am confused how to do it.

Absolutely everything that is necessary to know can be found in this topic (in which you are asking this question) and this topic: Ringo Reflash factory firmware. In particular, see the first 11 steps of the post I made above (in which there are 12 numbered paragraphs); and of course the various mis-steps/gotchas in the posts leading up to that post. Read it all very carefully and youā€™ll be able to build and flash a custom firmware.bin from the two repositories you download from the github website (CircuitMess Ringo firmware and CircuitMess Ringo). Of course the firmware is up to v1.0.5 now as opposed to 1.0.1 when all of the above posts were written, but just grab the latest tag from each.

Thereā€¦fixed that for you. :innocent:

Yeah, fumbly fingers in the morning! Fixed now.