Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set RTT Search Range #209

Open
j0ntraust1 opened this issue Aug 22, 2024 · 1 comment
Open

Option to set RTT Search Range #209

j0ntraust1 opened this issue Aug 22, 2024 · 1 comment

Comments

@j0ntraust1
Copy link

Hi,

would it be possible to add to the input of the rtt_start() a option to set the search range. Similarly to the option in the Rtt-viewer or the rtt command SetRTTSearchRanges .

image

--

We are using chipset that doesn't work well with the auto detection and the placement in the ram is not always a exact number. We are currently doing workaround by having a while loop that searches for the block address but it seems way slower then it needs to be.

@supersonic71
Copy link

We are using chipset that doesn't work well with the auto detection and the placement in the ram is not always a exact number. We are currently doing workaround by having a while loop that searches for the block address but it seems way slower then it needs to be.

Here is a temporary workaround : You can use elftools in python to find out exactly what the rtt address is. This way you know where to connect to.

def get_symbol_address(elf_file_path, symbol_name):
    try:
        with open(elf_file_path, 'rb') as f:
            elf = ELFFile(f)
            
            # Iterate through all sections in the ELF file
            for section in elf.iter_sections():
                if section['sh_type'] == 'SHT_SYMTAB':
                    # Iterate through all symbols in the section
                    for symbol in section.iter_symbols():
                        if symbol.name == symbol_name:
                            return symbol['st_value']
    except Exception as e:
        print(f"Error reading ELF file: {e}")
        return None

    print(f"Symbol '{symbol_name}' not found")
    return None

get_symbol_address("abc.elf", "_SEGGER_RTT")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants