dongle-flash: use program header physical address in ELF -> .hex conversion

`offset` returns the offset of the section *in the ELF file*
`physical_address` returns the (load) address of the section on the device
these are not necessarily the same (but usually are)
this part of dongle-flash is not used by the workshop participants as they'll use dongle-flash with
.hex files (produced by the well-tested `objcopy` tool)
This commit is contained in:
Jorge Aparicio 2020-12-09 17:13:08 +01:00
parent e78140f8ac
commit 41835a7c33

View file

@ -56,7 +56,7 @@ if the red LED was blinking and you got this message then the device wasn't corr
let mut records = vec![];
for ph in elf_file.program_iter() {
if ph.get_type() == Ok(Type::Load) {
let start = ph.offset();
let start = ph.physical_addr();
match ph.get_data(&elf_file).map_err(anyhow::Error::msg)? {
SegmentData::Undefined(bytes) => {