Hello,
I am running some bits of code that I have brought together, both of them have worked individually, I am unsure why they wouldn’t work together, all that is happening is that one part of the code dictates when the other runs, but now I am getting the following error
I am fairly sure I know what line causes the error, but I need that line to work and I don’t know why it would happen
I’ve followed the link provided, and a further link from there but I am struggling to understand how to read the error to truly know what the issue is
any insight at all would be helpful
many thanks
George
Make sure the complete crash report (as it is shown in your first post) is saved in the crash_log.txt file.
Open a command window and check whether the python command works:
type python --version and hit ENTER. It should display the python version installed on your system.
If that works, in the command window type again python followed by a space and then put the command you already used (showed in your second post) and hit ENTER.
as far as I can tell this still has not worked, nothing appears to have come up
I dont get any errors or anything just nothing seems to happen
see screenshot here
thanks for the help so far!
unfortunately, that hasn’t worked either, will be looking at the linked thread over the next day to try and understand what they’ve done differently
many thanks
George
hello, thank you for the help so far!
i now get an error when I run it fully
File "C:\Users\georg.LAPTOP-MIF8IBGQ\Mbed Programs\SDMotors\BUILD\NUCLEO_F401RE\ARMC6\crash_log_parser.py", line 195, in <module>
elfhelper = ElfHelper(args.elffile, args.mapfile)
File "C:\Users\georg.LAPTOP-MIF8IBGQ\Mbed Programs\SDMotors\BUILD\NUCLEO_F401RE\ARMC6\crash_log_parser.py", line 32, in __init__
op = check_output([_NM_EXEC, _OPT, elf_file.name]).decode('utf-8')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1008.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
it appears to be the same error as in the thread you linked previously
unfortunately, I have still been unable to fix it but I am still working on it
thank you for all the advice so far!
so I’ve now been able to get the parser to work and have the following output
Crash Info:
Crash location = SHT$$INIT_ARRAY$$Limit [0xFFFFFFFF] (based on PC value)
Caller location = SHT$$INIT_ARRAY$$Limit [0xFFFFFFFF] (based on LR value)
Stack Pointer at the time of crash = [1FFFDBE4]
Target and Fault Info:
Processor Arch: ARM-V7M or above
Processor Variant: C24
Forced exception, a fault with configurable priority has been escalated to HardFault
MPU or Execute Never (XN) default memory map access violation on an instruction fetch has occurred
I think I understand the that most important information is:
MPU or Execute Never (XN) default memory map access violation on an instruction fetch has occurred
and the lines of my code it gets angry at are:
if (diffx[store] >= 0) { dirPin[0] = 1; }
else if (diffx[store] < 0) { dirPin[0] = 0; }
if (diffy[store] >= 0) { dirPin[1] = 1; }
else if (diffy[store] < 0) { dirPin[1] = 0; }
does anyone know why this might cause this error to occur?
Most likely either the actual value of the store variable is greater than the declared dimension of the diffx (or diffy) array or the declared dimension of dirPin is less than 2 (that is equal to 1).
Format the code to be more debug friendly. For example:
if (diffx[store] >= 0) {
dirPin[0] = 1;
}
else if (diffx[store] < 0) {
dirPin[0] = 0;
}
if (diffy[store] >= 0) {
dirPin[1] = 1;
} else if (diffy[store] < 0) {
dirPin[1] = 0;
}
Compile using the debug profile.
Setup a breakpoint at first line (if (diffx[store] >= 0) {
While stepping through the code in debug mode check (monitor) the value of the store variable and notice the line when the program crashes.
NOTE: You can also refactor the code (replace else if (...) { with else { ) as follows:
When I run it I get this error that I cannot figure out how to remedy:
‘’’
C:\Users\wjgdm\Mbed Programs\TaleGator_Project\BUILD\LPC1768\ARMC6>python crash_log_parser.py
usage: crash_log_parser.py [-h] CRASH LOG [ELF FILE] [MAP FILE]
crash_log_parser.py: error: the following arguments are required: CRASH LOG
C:\Users\wjgdm\Mbed Programs\TaleGator_Project\BUILD\LPC1768\ARMC6>python crash_log_parser.py crash_log.txt TaleGator_Project.elf TaleGator_Project.map
Traceback (most recent call last):
File “crash_log_parser.py”, line 199, in
elfhelper = ElfHelper(args.elffile, args.mapfile)
File “crash_log_parser.py”, line 36, in init
op = check_output([_NM_EXEC, _OPT, elf_file.name]).decode(‘utf-8’)
File “c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\subprocess.py”, line 411, in check_output
**kwargs).stdout
File “c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\subprocess.py”, line 488, in run
with Popen(*popenargs, **kwargs) as process:
File “c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\subprocess.py”, line 800, in init
restore_signals, start_new_session)
File “c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\subprocess.py”, line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
To use this script, arm-none-eabi-nm needs to be available on your PATH. This means that you will need to install ARM GCC if you haven’t already. See here for instructions on installing it (you can skip the parts about CMake and Ninja).