mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-10-31 22:28:49 +00:00
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:
parent
e78140f8ac
commit
41835a7c33
1 changed files with 1 additions and 1 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue