-
|
Hello everyone! I am trying to make an ESP32 application by combining the examples of ot_cli and ot_rcp. I want to compile a firmware where the device can operate both as a JOINER and in RCP mode. Of course the application will never be in both states, but I want to compile with the possibility of using both these states and dynamically on runtime choose which version to initialize. I noticed that when I enable these configuration options simultaneously the firmware cannot be compiled: FTD mode works fine if I have this enabled: and RCP mode seems to compile fine if I have this enabled: I noticed this line of code inside It looks to me like the esp32 openthread library was not intended to allow compilation for both RCP and JOINER mode. I also noticed that even if I suppress the error above and enable both RADIO and JOINER the CMakeLists.txt in the openthread component (idf/components/openthread/CMakeLists.txt) handles these configurations as mutually exclusive, thus not allowing compilation for both without manually changing this file (and thus diverging from the espressif idf branch) My question is if there is any reason that it is not allowed to compile for both these modes. Of course I understand why I cannot use both these modes simultaneously, I just want to allow compiling for both and choose on runtime which one to initialize. Is there a limitation on that based on the way the openthread library works? Can I just modify the CMake files myself and to compile succesfully or is there a reason that I cannot do that? Has anyone ever encountered this scenario in the past, I am curious to hear how you solved this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
@Mavioux , let me provide some guidance regarding the OpenThread core and its integration into different projects. The OpenThread core itself provides various high-level configuration options, in particular FTD, MTD, or Radio, which correspond respectively to different library outputs: These libraries can then be integrated into other projects to build a full firmware image or executable. Generally, a complete firmware image consists of at least three components:
To construct an RCP firmware, the To construct a full FTD/MTD firmware or executable, the Your idea of having a single firmware that can act as either an RCP or a full FTD stack with a CLI (and be selectable at run-time) is not compatible with the current architecture. To be clear, making such a combination is technically feasible, but it would require some architectural changes and additional development work. If you are interested in such a configuration, perhaps you could implement it and contribute it back to OpenThread. |
Beta Was this translation helpful? Give feedback.
-
|
If I were to try to go through the architectural changes what should I change? A hint to the general direction would be appreciated. I assume I shall not touch the precompiled libraries. Should I make some changes on the platform library and the way I include the precompiled libraries? Do I also need to change the NCP application layer? Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your response and input. I have decided that it is indeed simpler to create two different binaries to achieve this functionality and not try to change the architecture for now. |
Beta Was this translation helpful? Give feedback.
@Mavioux , let me provide some guidance regarding the OpenThread core and its integration into different projects.
The OpenThread core itself provides various high-level configuration options, in particular FTD, MTD, or Radio, which correspond respectively to different library outputs:
libopenthread-ftd.a,libopenthread-mtd.a, andlibopenthread-radio.a.These libraries can then be integrated into other projects to build a full firmware image or executable.
Generally, a complete firmware image consists of at least three components:
libopenthread-*library.otPlat*APIs for the OpenThread stack to use (e.g., radio, timer, settings).