Flashing Two Application Binaries on ESP32 and intract with each other.

srikanth.palvai95
Posts: 4
Joined: Mon Jul 17, 2023 4:41 pm

Flashing Two Application Binaries on ESP32 and intract with each other.

Postby srikanth.palvai95 » Tue Jun 25, 2024 10:17 am

I'm working on a project with esp32 microcontroller and I have a specific requirement.
I need to flash two separate application binaries on the device:

Producer Binary: Created by the product owner, providing essential APIs.
Consumer Binary: Developed by the client, utilizing the APIs provided by the producer.
The idea is for the producer to generate a binary with the necessary APIs and share it with the consumer. The consumer will then develop their application, which consumes these APIs, and generate their own binary.

My questions are:
Is it possible to flash two separate application binaries on esp32.
If so, what would be the best approach to achieve this? Should we use a bootloader or some other mechanism to manage the binaries?
Are there any specific configurations or considerations we need to keep in mind to ensure the two binaries can coexist and interact properly?
Any guidance or examples on how to set this up would be greatly appreciated!

ESP_Sprite
Posts: 9723
Joined: Thu Nov 26, 2015 4:08 am

Re: Flashing Two Application Binaries on ESP32 and intract with each other.

Postby ESP_Sprite » Thu Jun 27, 2024 8:22 am

Not in such a way that they interact: applications will always be separate in that you can boot into one or the other, but they can never have code running at the same time, and you need a reboot to switch.

Generally, people get around this by having one party produce a (binary) library and have the 2nd party statically link with that. I've also seen solutions where the consumer code runs on a VM, e.g. in webassembly.

srikanth.palvai95
Posts: 4
Joined: Mon Jul 17, 2023 4:41 pm

Re: Flashing Two Application Binaries on ESP32 and intract with each other.

Postby srikanth.palvai95 » Wed Jul 03, 2024 8:14 am

Thanks for the response,
I didn't get your poiont here "I've also seen solutions where the consumer code runs on a VM, e.g. in webassembly."
Do we have any existing examples to achive this other then "esp-idf/examples/build_system/cmake/import_prebuilt"

ESP_Sprite
Posts: 9723
Joined: Thu Nov 26, 2015 4:08 am

Re: Flashing Two Application Binaries on ESP32 and intract with each other.

Postby ESP_Sprite » Thu Jul 04, 2024 2:12 am

srikanth.palvai95 wrote:
Wed Jul 03, 2024 8:14 am
I didn't get your poiont here "I've also seen solutions where the consumer code runs on a VM, e.g. in webassembly."
The manufacturer delivers a full binary with their drivers and OTA stuff and otherwise magic stuff including a WebAssembly VM interpreter. The consumer then writes their app in any language that compiles to WebAssembly, uploads it, and it gets run in the VM. The bindings within WebAssembly can make it interact with the producers drivers etc.
Do we have any existing examples to achive this other then "esp-idf/examples/build_system/cmake/import_prebuilt"
We do not. In what way do you think this example is incomplete?

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot], SegmentationFault and 121 guests