pylink
pylink copied to clipboard
how to download the elf file
very sorry for interrupting you. can you tell me how to download the elf file? i can't use the flash() or flash_file() to download the elf file.
I convert the elf file to bin file and download it to the board. But I run the trace example, and set the trace_address as the entry of main, set the breakpoint_address as a point in the main function. But I don't get any instruction. I don't get any error. How can I get the instruction in the trace.
And I meet the question that "No handlers could be found for logger "pylink.jlink"", how can I do? Thank you very much.
Sorry for getting back to you so late. You need to great a bin (or hex) file from the ELF file to flash to your device. The no handlers message that pops up means that the library attempted to log a message (could be informational, error, etc.), but there was no handler to do so. To enable logging, you should do something like:
import logging
logging.basicConfig(level=logging.INFO)
or logging.DEBUG
, logging.ERROR
, etc. depending on what logging level you want.
I get it. Thank you for your help. I run the trace example but there is no instructions in trace, how can I do?
The example should work provided the addresses are valid (come from the disassembly of the binary file). That would be my suggestion, otherwise I'm unsure of what the issue would be. I'd ensure that the device you're using supports instruction tracing as well (the info command from the CLI will tell you that: pylink info -p
).
Thank you for your help. May be the address I set was wrong, I reset the address and it run success. Now I can get the trace when it hit the breakpoint, but how can I get the instructions when it is running.
I'm so sorry that I have so much question.
I run the Strace example to get the trace, but the example do not return all the address in the trace.
the trace I want is
and the STrace example is:
the result I got is:
there are two address was missed: 0x80001b8 and0 x80001ba
I got other trace, sometime it is completed, but sometime some address was missed.
the project I run was come from the jlink website:
J-Trace_PRO_CortexM_Tutorial
Thank you for your help. May be the address I set was wrong, I reset the address and it run success. Now I can get the trace when it hit the breakpoint, but how can I get the instructions when it is running.
STrace only allows you to do a capture between two points; it stops at the second point (the break point), and you can dump the trace. If you want a trace while the target is running, you have to use something like ETM, but the FIFO queue can fill up, and wrap (I think), meaning you'll have to at some point stop the target, and flush the queue. Reading the ETM registers may or may not be possible while the target is running; I've never tried that.
I know the ETM, I want to get the trace with C or python code, but I don't buy the JLink SDK. So I don't know which API can I use.
I meet a question that I can't start the RTT.
The board I use is STM32F407VE.
The main() is
And I get the result
How can I get the expection reason
I can run it, thank you very much
I meet some question in the rtt example.
My source code is that:
when I run the rtt example, I just can input only once, it while run automaticly with none input, the result is that:
the python file I run is the example you provide.