pylink icon indicating copy to clipboard operation
pylink copied to clipboard

how to download the elf file

Open DerZc opened this issue 5 years ago • 12 comments

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.

DerZc avatar Dec 20 '19 01:12 DerZc

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.

DerZc avatar Dec 22 '19 13:12 DerZc

And I meet the question that "No handlers could be found for logger "pylink.jlink"", how can I do? Thank you very much.

DerZc avatar Dec 22 '19 14:12 DerZc

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.

hkpeprah avatar Dec 23 '19 01:12 hkpeprah

I get it. Thank you for your help. I run the trace example but there is no instructions in trace, how can I do?

DerZc avatar Dec 23 '19 01:12 DerZc

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).

hkpeprah avatar Dec 23 '19 01:12 hkpeprah

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.

DerZc avatar Dec 23 '19 06:12 DerZc

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 image and the STrace example is: image the result I got is: image 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

DerZc avatar Dec 23 '19 14:12 DerZc

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.

hkpeprah avatar Dec 23 '19 15:12 hkpeprah

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.

DerZc avatar Dec 23 '19 15:12 DerZc

I meet a question that I can't start the RTT. The board I use is STM32F407VE. The main() is image

And I get the result image How can I get the expection reason

DerZc avatar Dec 29 '19 03:12 DerZc

I can run it, thank you very much

DerZc avatar Dec 29 '19 05:12 DerZc

I meet some question in the rtt example. My source code is that: image when I run the rtt example, I just can input only once, it while run automaticly with none input, the result is that: image the python file I run is the example you provide.

DerZc avatar Jan 03 '20 03:01 DerZc