9 years, 10 months ago.

flash_algo_gen.py python compiler problem

Traceback (most recent call last): File "flash_algo_gen.py", line 158, in <module> gen_flash_algo() File "flash_algo_gen.py", line 110, in gen_flash_algo run_cmd([FROMELF, 'bin', ALGO_ELF_PATH, '-o', TMP_DIR_W_TERM]) File "C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools\utils.p y", line 25, in run_cmd p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=wd) File "C:\Python27\lib\subprocess.py", line 709, in init errread, errwrite) File "C:\Python27\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] Impossibile trovare il file specificato

how can I fix this? How you use the file.txt ????

thanks best regards

Question relating to:

Hello Sacchetti Giampaolo, please share what arguments did you use to execute the python script?? Use '<<code>> <</code>>' to share the outputs from the console.

posted by Martin Kojtal 26 May 2014

(my shell script)

C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools>c:\Python27\pyt hon.exe flash_algo_gen.py

(out compiler python error)

[WARNING] Using default settings. Define your settings in the file private_setti ngs.py Traceback (most recent call last): File "flash_algo_gen.py", line 154, in <module> gen_flash_algo() File "flash_algo_gen.py", line 110, in gen_flash_algo run_cmd([FROMELF, 'bin', ALGO_ELF_PATH, '-o', TMP_DIR_W_TERM]) File "C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools\utils.p y", line 25, in run_cmd p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=wd) File "c:\Python27\lib\subprocess.py", line 709, in init errread, errwrite) File "c:\Python27\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] Impossibile trovare il file specificato

posted by Sacchetti Giampaolo 27 May 2014

my python script, best regards

posted by Sacchetti Giampaolo 27 May 2014

Hello,

what target are you trying to build? You are using default settings, have you checked that your KEIL installation matches the path which is set by default in scripts?

posted by Martin Kojtal 27 May 2014

Hello 0xc0170 I want to build the target KL46Z. How to config settings.

posted by zhang shengping 12 Dec 2014

2 Answers

9 years, 10 months ago.

Hello Sacchetti Giampaolo,

the error is caused by not setting the path for fromelf (part of uvision installation). Please provide own private_settings.py file, where you set at least this 2 variables:

FROMELF = r'c:\\Keil\\ARM\\ARMCC\\bin\\fromelf.exe'
UV4 = r'C:\Keil\UV4\UV4.exe'

The scripts are not documented yet, many changes were there added lately, therefore we should update and expand it.

Regards, 0xc0170

C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools>C:\Python27\pyt hon.exe flash_algo_gen.py

[WARNING] Using default settings. Define your settings in the file private_setti ngs.py

Traceback (most recent call last): File "flash_algo_gen.py", line 154, in <module> gen_flash_algo()

File "flash_algo_gen.py", line 110, in gen_flash_algo run_cmd([FROMELF, 'bin', ALGO_ELF_PATH, '-o', TMP_DIR_W_TERM])

File "C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools\utils.p y", line 30, in run_cmd

raise Exception('"%s" returned %d\n%s' % (' '.join(command), rc, stderr))

Exception: "C:\Keil_v5\ARM\ARMCC\bin\fromelf.exe bin C:\Users\dell690\Desktop\ CMSIS-DAP-master\CMSIS-DAP-master\tools\tmp\flash_algo.axf -o C:\Users\dell690\D esktop\CMSIS-DAP-master\CMSIS-DAP-master\tools\tmp/" returned 1 "C:\Users\dell690\Desktop\CMSIS-DAP-master\CMSIS-DAP-master\tools\tmp\flash_algo .axf": Error: Q0122E: Could not open file 'C:\Users\dell690\Desktop\CMSIS-DAP-ma ster\CMSIS-DAP-master\tools\tmp\flash_algo.axf': No such file or directory Finished: 0 information, 0 warning and 1 error messages.

posted by Sacchetti Giampaolo 27 May 2014
9 years, 10 months ago.

Can I use this "flash_algo_gen.py" in PyOCD's flash algorithm?

You mean generated flash bob from that script to use in pyOCD?

posted by Martin Kojtal 29 May 2014