FreeBSD Support for IDF

Drohne
Posts: 5
Joined: Tue Nov 14, 2023 11:48 am

Re: FreeBSD Support for IDF

Postby Drohne » Sat Apr 20, 2024 3:58 pm

Thank you very much for responding. I'd like to apologize for my late response.

Many thanks for your experience. I would like to comment on some.

I use the xtensa-esp32-elf toolchain. Since I do not have permanent internet connection and due to a centralized deployment, the usage of those python scripts reeling in missing portions of the prerequisite Python environment is not an option and I deeply regret this misleading concept.

Somehow I miss a list of Python modules required to map those requirements onto the ports tree offering. Some Python ports I figured out myself, thanks for the hints on those I missed.

According to:

Code: Select all

pkg install -Ay python py39-click cmake py39-yaml esp_idf_monitor idf_component_manager esp-idf-kconfig py39-esptool
I do not see how esp_idf_monitor idf_component_manager and esp-idf-kconfig could be installed via FreeBSD's pkg tool - there is no official package, there isn't even a port.
I just try to create ports myself for those three prerequisites, but since I'm not much into ports creation, the road to a mutual success is way too steep.

As of now I managed to wrap esp-idf FLAVOR=idf51 into a port. idf44 (last make based one I read ...) doesn't build properly with most recent make framework, so again frustration. The toolchains for esps2 and esp32s3 as well as rsic fail to build on 15 CURRENT and 14-STABLE, I guess it is due to LLVM 18, but I do not have any clue at the moment.

Maybe I missed something in Espressif's documentation. I droped "platformio" since this tool is completely depending on active network conncetions.

Drohne
Posts: 5
Joined: Tue Nov 14, 2023 11:48 am

Re: FreeBSD Support for IDF

Postby Drohne » Sun Jul 07, 2024 10:08 am

In the meinawhile, the maintainer of the port "trombik/xtensa-esp32-elf" located on GitHub (see above) has updated its port to meet "ESP-IDF 5.2.2". Running on CURRENT, 14-STABLE and/or 14.1-RELENG works (we build the toolchain for these supposed tob be development platforms.

The ESP-IDF is reeled in via git (to complete the described necessities here) and is at ESP-IDF v5.2.2-273-g83f436e13e, located in the $HOME path and IDF_PATH, IDF_TOOLS_PATH are set accordingly as well as the paths to the toolchain(s).

I didn't run install.sh, since it messes up my environment!

After I managed to create the missing python ports for FreeBSD, i.e

comms/py-esp-idf-monitor
devel/py-esp-idf-kconfig
devel/py-esp-idf-nvs-partition-gen
devel/py-idf-component-manager
...

I fail to run "idf.py". The above mentioned Python ports (python3.11 on recent systems) are in place, among others installed as dependencies, but not all with the version requested by the ESP-IDF.

Taking a simple example from the ESP-IDF examples, hello_world, fails with:

[...]
# idf.py build
The following Python requirements are not satisfied:
Requirement 'requests-file<2' was not met. Installed version: 2.0.0
Requirement 'contextlib2>0.6.0; python_version >= "3.6"' was not met. Installed version: 0.6.0.post1
Requirement 'bitarray==2.8.0' was not met. Installed version: 2.8.1
To install the missing packages, please run "install.sh"
Diagnostic information:
IDF_PYTHON_ENV_PATH: /usr/local/
Python interpreter used: /usr/local/bin/python
Requirement files:
- /home/drohne/Projects/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /usr/local/bin/python

ESP-IDF v5.2.2-273-g83f436e13e
[...]

QUESTIOPN: How do I avoid checking those version checkings seen above? I checked for the esp-idf/tools/requirements/requirements.core.txt?

I'd like to know where those constraints are defined - I can not find any version constraint files in the installation path of the ESP-IDF, maybe I did not look close enough.

Drohne
Posts: 5
Joined: Tue Nov 14, 2023 11:48 am

Re: FreeBSD Support for IDF

Postby Drohne » Sat Oct 19, 2024 8:40 am

Just for the record:

with the latest port upgrade a decent toolchain for FreeBSD is available now, derived from crosstool-ng 13.2.0 and supports Xtensa ESP32 based MCUs (esp32, esp32s2, esp32s3) (refering to ESP-IDF v5.3 - the git repo needs some minor tweaks to work with FreeBSD without downloading all the stuff usually used via Linux).
With some (minor) tweaks RISC-V ESP32 based chips might be supported as well.

The port is now in the official FreeBSD latest ports tree!

T. Sakurai (at github: trombik/xtensa-esp32-elf) has also updated his sophisticated private port and included LLVM toolchain support.

My personal attempts to build the FreeBSD's now official toolchain for gcc14 and crosstool-ng 14.2.0 was also successful, but there are minor or larger pitfals in conjunction with FreeBSD's Python port devel/py-setuptools and the Python toolsets provided to make life easier. At least the toolchain compiles well for both gcc13 and gcc14 based crosstool-ng.

Case closed.

Who is online

Users browsing this forum: No registered users and 245 guests