alibaba / alibaba/AliOS-Things
COM3端口访问失败
- Dominant language
- C
- Stars
- 4.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Contact Details
2189885488@qq.com
### What happened?
刚到的HaaS Edu K1-烧录固件无法访问COM端口
运行环境: win11
固件版本:1.1.0
### Version
master (Default)
### What soultions are you seeing the problem on?
_No response_
### Relevant log output
```shell
PS D:\VSCode\Project\测试\test_demo> $Env:Path="C:\ProgramData\aos\miniconda3;C:\ProgramData\aos\miniconda3\Scripts;C:\ProgramData\aos\miniconda3\Library\bin;$Env:Path";python c:\Users\Zhaomeng\.vscode\extensions\haas.haas-studio-2.3.1\asserts\burntool\haaseduk1\flash_program.py --bin=d:\新建文件夹\HaaSPython-HaaSEDUK1-v2.2.0\HaaSPython-HaaSEDUK1-v2.2.0\HaaSPython-HaaSEDUK1-v2.2.0.bin --bin=d:\新建文件夹\HaaSPython-HaaSEDUK1-v2.2.0\HaaSPython-HaaSEDUK1-v2.2.0\littlefs.bin#0xB32000 --port=COM3
binary file is ['d:\\新建文件夹\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0.bin', 'd:\\新建文件夹\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0\\littlefs.bin#0xB32000']
serial port is COM3
bin_files is [('d:\\新建文件夹\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0.bin', '0'), ('d:\\新建文件夹\\HaaSPython-HaaSEDUK1-v2.2.0\\HaaSPython-HaaSEDUK1-v2.2.0\\littlefs.bin', '0xB32000')]
Traceback (most recent call last):
File "c:\Users\Zhaomeng\.vscode\extensions\haas.haas-studio-2.3.1\asserts\burntool\haaseduk1\flash_program_ll.py", line 103, in burn_bin_files
serialport.open()
File "C:\ProgramData\aos\miniconda3\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM3': PermissionError(13, '拒绝访问。', None, 5)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Zhaomeng\.vscode\extensions\haas.haas-studio-2.3.1\asserts\burntool\haaseduk1\flash_program.py", line 121, in
main()
File "c:\Users\Zhaomeng\.vscode\extensions\haas.haas-studio-2.3.1\asserts\burntool\haaseduk1\flash_program.py", line 118, in main
burn_bin_files(myconfig["serialport"], myconfig['baudrate'], bin_files)
File "c:\Users\Zhaomeng\.vscode\extensions\haas.haas-studio-2.3.1\asserts\burntool\haaseduk1\flash_program_ll.py", line 105, in burn_bin_files
raise Exception("Failed to open serial port: %s!" % portnum)
Exception: Failed to open serial port: COM3!
```
Contributor guide
Research direction
Start with the reported Windows 11 command and inspect flash_program.py and flash_program_ll.py, especially burn_bin_files where serialport.open() fails for COM3. Reproduce the firmware flashing attempt with the listed HaaS Edu K1 firmware and port. Done means the tool can open the selected serial port and proceed without the reported PermissionError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100