Closed romainreignier closed 1 month ago
That .... is unexpected (I wrote the support and the demos). I'll look into it.
Can you attach your two elf files, or can you run llvm-objdump -t | rustfilt | sort
on them?
Sure.
Objdump results: rp2040.txt rp2350.txt
Elf files with a .txt
extension to allow upload on Github:
rp2040_binary_info_demo_bin.txt
rp2350_binary_info_demo_bin.txt
RP2020:
100001c0 g O .boot_info 00000014 rp_binary_info::PICOTOOL_HEADER
100085a4 l O .bi_entries 0000001c binary_info_demo::PICOTOOL_ENTRIES
100089b8 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
100089cc l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
100089fc l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10008a48 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10008a5c l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10008a70 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10008a7c l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
100094c8 g O .rodata 00000018 rp_binary_info::MAPPING_TABLE
RP2350:
10008ba4 l O .bi_entries 0000001c binary_info_demo::PICOTOOL_ENTRIES
10009084 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10009098 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
100090c8 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10009114 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10009128 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
1000913c l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
10009148 l O .rodata 0000000c binary_info_demo::PICOTOOL_ENTRIES::ENTRY
Oops.
The .boot_info
input section is missing from the RP2350 example linker script. It should be packed into the .start_block
output section.
Indeed, it now works as expected:
$ cargo build --bin binary_info_demo
$ picotool info -a -t elf target/thumbv8m.main-none-eabihf/debug/binary_info_demo
File target/thumbv8m.main-none-eabihf/debug/binary_info_demo:
Program Information
name: binary_info_demo
version: 0.1.0
web site: https://github.com/rp-rs/rp-hal
description: A GPIO blinky with extra metadata.
binary start: 0x10000000
target chip: RP2350
image type: ARM Secure
Fixed Pin Information
none
Build Information
pico_board: pico2
build attributes: debug
With the latest version (2.0.0) of picotool,
picotool info
works with rp2040 binaries but not with rp2350.Steps to reproduce
So it works with RP2040.
But doing the same RP2350 provides no info: