Today,Im gonna test my first program "hello_world" on esp32-s @ubuntu 20.04,but there's a trouble that confused me a lot : when i use the command "idf.py",whatever "idf.py build",or "idf.py set-target esp32",there always occured the ERROR "Permission denied",i don't know how to solve the problem,i need your help,thanks!
============================================================================================================
The error infomations are as follow:
============================================================================================================
Executing action: all (aliases: build)
Traceback (most recent call last):
File "/home/cfk/esp/esp-idf/tools/idf.py", line 812, in <module>
main()
File "/home/cfk/esp/esp-idf/tools/idf.py", line 730, in main
cli(sys.argv[1:], prog_name=PROG, complete_var='_IDF.PY_COMPLETE')
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1691, in invoke
return _process_result(rv)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1628, in _process_result
value = ctx.invoke(self._result_callback, value, **ctx.params)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/cfk/esp/esp-idf/tools/idf.py", line 645, in execute_tasks
task(ctx, global_args, task.action_args)
File "/home/cfk/esp/esp-idf/tools/idf.py", line 226, in __call__
self.callback(self.name, context, global_args, **action_args)
File "/home/cfk/esp/esp-idf/tools/idf_py_actions/core_ext.py", line 23, in build_target
ensure_build_directory(args, ctx.info_name)
File "/home/cfk/esp/esp-idf/tools/idf_py_actions/tools.py", line 182, in ensure_build_directory
os.makedirs(build_dir)
File "/usr/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/cfk/esp/hello_world/build'
About command "idf.py"
-
- Posts: 9985
- Joined: Thu Nov 26, 2015 4:08 am
Re: About command "idf.py"
Can the user that you run idf.py as write to that directory? If not, did you create it as root or something? Can you do a 'ls -l' in the esp directory?PermissionError: [Errno 13] Permission denied: '/home/cfk/esp/hello_world/build'
-
- Posts: 2
- Joined: Sun Oct 23, 2022 1:26 pm
Re: About command "idf.py"
I faced the same issue 
I tried "su" to proceed the command line as root user, but still it appear "permission denied"

I tried "su" to proceed the command line as root user, but still it appear "permission denied"
-
- Posts: 2
- Joined: Sun Oct 23, 2022 1:26 pm
Re: About command "idf.py"
finally I can launch the scripts using this way
sudo python3 <path_to_the_folder>/vendors/espressif/esp-idf/tools/idf.py build
for example: in my case, it run with this below command line.
sudo python3 /Users/Admin/Documents/EMBEDDED/workspace_AWS/FreeRTOS/vendors/espressif/esp-idf/tools/idf.py -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 build

sudo python3 <path_to_the_folder>/vendors/espressif/esp-idf/tools/idf.py build
for example: in my case, it run with this below command line.
sudo python3 /Users/Admin/Documents/EMBEDDED/workspace_AWS/FreeRTOS/vendors/espressif/esp-idf/tools/idf.py -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 build
Re: About command "idf.py"
I just now had the same error show up when going thru the 'getting started guide' at the end of the . ./export.sh script. I went into the tools directory and saw all the *.py files did not have the executable bits set. I did a 'chmod +x idf.py and the export.sh worked. I'm just now wondering if I should set those other py files as executable. Just wondering. I will continue with the installation process.
Re: About command "idf.py"
The only .py file which should be executable is install.py.
export.py is not executable, because you do not use it straight, you should
It is also described in the docs.
export.py is not executable, because you do not use it straight, you should
Code: Select all
source ./export.sh
or
. ./export.sh
Who is online
Users browsing this forum: mpolix and 153 guests