pyocd / pyOCD

Open source Python library for programming and debugging Arm Cortex-M microcontrollers
https://pyocd.io
Apache License 2.0
1.09k stars 475 forks source link

It is not available on STM32H7 #900

Open whj4674672 opened 4 years ago

whj4674672 commented 4 years ago

Hi there, I used pyocd on STM32F4 and everything worked fine. When I tried to use pyocd on STM32H7, I had problems. I had read Docs. C:\Users\Administrator>pyocd pack -u 0000258:INFO:__main__:Updating pack index... Jun 18 18:20:21.939 ERRO download of "https://www.keil.com/pack/Keil.STM32F7xx_DFP.pdsc" failed: https://www.keil.com/pack/Keil.STM32F7xx_DFP.pdsc: error trying to connect: unexpected end of file Jun 18 18:20:21.943 ERRO download of "https://www.keil.com/pack/Keil.STM32G0xx_DFP.pdsc" failed: https://www.keil.com/pack/Keil.STM32G0xx_DFP.pdsc: error trying to connect: unexpected end of file Jun 18 18:20:21.956 ERRO download of "https://www.keil.com/pack/Keil.STM32H7xx_DFP.pdsc" failed: https://www.keil.com/pack/Keil.STM32H7xx_DFP.pdsc: error trying to connect: unexpected end of file Jun 18 18:20:21.960 ERRO download of "https://www.keil.com/pack/Keil.STM32L4xx_DFP.pdsc" failed: https://www.keil.com/pack/Keil.STM32L4xx_DFP.pdsc: error trying to connect: unexpected end of file Jun 18 18:20:33.314 ERRO download of "http://www.qorvo.com/extra/keil_pack/Active-Semi.PAC55XX.pdsc" failed: https://www.qorvo.com/extra/keil_pack/Active-Semi.PAC55XX.pdsc: error trying to connect: 远程主机强迫关闭了一个现有的连接。 (os error 10054) Downloading descriptors (634/640)

whj4674672 commented 4 years ago

I then tried to download the Keil.STM32H7xx_DFP.pdsc from keil's website, along with other PDSC files, but failed. `C:\Users\Administrator>pyocd gdb --pack C:\Users\Administrator\AppData\Local\cmsis-pack-manager\cmsis-pack-manager\Keil.STM32H7xx_DFP.pdsc 0000334:CRITICAL:main:Failed to open CMSIS-Pack 'C:\Users\Administrator\AppData\Local\cmsis-pack-manager\cmsis-pack-manager\Keil.STM32H7xx_DFP.pdsc': File is not a zip file Traceback (most recent call last): File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\target\pack\cmsis_pack.py", line 88, in init self._pack_file = zipfile.ZipFile(file_or_path, 'r') File "c:\users\administrator\appdata\local\programs\python\python38\lib\zipfile.py", line 1268, in init self._RealGetContents() File "c:\users\administrator\appdata\local\programs\python\python38\lib\zipfile.py", line 1335, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd__main.py", line 368, in run self._COMMANDSself._args.cmd File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd__main__.py", line 660, in do_gdbserver session = ConnectHelper.session_with_chosen_probe( File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\core\helpers.py", line 241, in session_with_chosen_probe return Session(probe, auto_open=auto_open, options=options, **kwargs) File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\core\session.py", line 179, in init or Board(self, self.options.get('target_override')) File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\board\board.py", line 44, in init pack_target.PackTargets.populate_targets_from_pack(session.options['pack']) File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\target\pack\pack_target.py", line 209, in populate_targets_from_pack pack = CmsisPack(pack_or_path) File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\pyocd\target\pack\cmsis_pack.py", line 90, in init__ six.raise_from(MalformedCmsisPackError("Failed to open CMSIS-Pack '{}': {}".format( File "", line 3, in raise_from pyocd.target.pack.cmsis_pack.MalformedCmsisPackError: Failed to open CMSIS-Pack 'C:\Users\Administrator\AppData\Local\cmsis-pack-manager\cmsis-pack-manager\Keil.STM32H7xx_DFP.pdsc': File is not a zip file`

whj4674672 commented 4 years ago

This problem of mine has been solved. Please use FlashAlgo to implement the corresponding target download algorithm first.Then use target remote ocalhost:3333 and then use monitor reset halt to load

whj4674672 commented 4 years ago

In addition, I found a handwriting error. error it should be "0774": BoardInfo( "DISCO-L4R9I", "stm32l4r9i", None, ),