Vanilla Firmware Build fails to work after flash

We are doing our best to solve the power on/off issue by building a new firmware. So our first approach was just to use the vanila GitHub - balena-io-hardware/balena-fin-coprocessor-firmata: firmata firmware for the BGM111 co-processor on the balenaFin and build a hex without any changes. All went smooth (not sure if the log has any issue. firmware.log (25.6 KB) )

After that, we used the GitHub - balena-io-hardware/balena-fin-firmata-flash: BalenaFin application to flash the on-board co-processor with the latest version of balenaFin Firmata . It did work very well for the:
curl -X POST localhost:1337/v1/flash/firmata-balena-2.0.1.hex
The basic functions are there and they work: sleep, setpin, etc.

But when using our new firmware (suppose to have the same implementation) it does not work well. Any command will just make reboot the hardware and loose their state.

Can someone help us? Please? We can try to make a call or chat if required to close all our topics at once.

Thank you

Besides, can’t push to the device to build there. I try dev and production images. Both with same logs:

ricardoosorio@Ricardos-iMac balena-fin-coprocessor-firmata % balena push test
[Info] Starting build for test, user rosorio
[Info] Dashboard link: balena dashboard
[Info] Building on arm06
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[main] Step 1/12 : FROM gcc:9.3.0
[main] —> 5e6b3f4af251
[main] Step 2/12 : COPY ./src /usr/src/firmata
[main] —> 69be451addd5
[main] Step 3/12 : COPY ./.git /usr/src/firmata/.git
[main] COPY failed: stat /var/lib/balena32/tmp/docker-builder062117822/.git: no such file or directory
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: COPY failed: stat /var/lib/balena32/tmp/docker-builder062117822/.git: no such file or directory
[Info] Built on arm06
[Error] Not deploying release.
Remote build failed

Getting nowhere now: using production image, firmware 2.0.1.hex…it changed revision from 09 to 11. And now nothing can work. Again.

Hi Ricardo, regarding the firmware issue I will ping someone on the team to help with that.

For the second issue, it looks like the .git directory is not being uploaded to the builder. Do you have a .dockerignore file on your project directory?

I clone from the git. Deleted and re-clone. The same

Obter o Outlook para Android

Oh, I see. I think the Dockerfile on GitHub - balena-io-hardware/balena-fin-coprocessor-firmata: firmata firmware for the BGM111 co-processor on the balenaFin is only meant to ease building the firmware on a local machine. Is there a particular reason you want to use the builder for this?

You might get it to build on the builder but you would have to make some changes as I think the .git folder is ignored by balena CLI, and the CMD instruction on the dockerfile is intended to run make on a local volume so it won’t be very helpful as is to push this image to a device.

I already try to build using local docker (as you can see in the begin of this thread) but the hex simply doesn’t work when flash. Therefore I try to gave a shot by building in the device itself without luck.

Our goal is: to be able to compile a firmware and flash. And seems the supported github isn’t ok.

Please check the begin of the thread

I understand, unfortunately you won’t get the file to build on device doing balena push which builds on our build server.

Looking at the build logs you shared and your message at the beginning of the thread I understand that you can build and flash the firmware in the balena-fin-coprocessor-firmata repository without issues, is that correct?

Is your custom firmware based on the source in balena-fin-coprocessor-firmata? Are you using the tools in that repository to build your custom firmware?

Is there anything else you can tell us about your custom firmware that might help us better diagnose the cause of the issue?

Thank you

  1. I can build
  2. I could flash (using the githup for flash)
  3. But after flash, the behaviour is not right. It reboots when calling any of the firmware commands using the firmware that was build straight from the balena-fin-coprocessor-firmata repository.
  4. When re-flashing with the older version (firmware 2.0.1) everything gets back to normal. So is something wrong in the balena-fin-coprocessor-firmata repository that is not ok for balena 1.1.1

Hey @ricardoosorio, while we investigate the issue with the v3.0.x release of firmata, could you try basing your changes on the v2.0.1 tagged release for now? This one we know to be stable and would be best for your changes.

We will try. Can you tell us which branch it is?

It’s actually a tag, not a branch, but you can still get that version from the git command line with git checkout v2.0.1.