Skip to content

Add big endian support #9

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

Merged
merged 2 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions memory.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ SECTIONS {

*(.text)
*(.text.*)
/* TI naming convention */
*(.text:*)

*(.rodata)
*(.rodata.*)
Expand Down
26 changes: 13 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,35 +185,35 @@ macro_rules! algorithm {
#[link_section = "DeviceData"]
pub static FlashDevice: FlashDeviceDescription = FlashDeviceDescription {
// The version is never read by probe-rs and can be fixed.
vers: 0x1,
vers: 0x1u16.to_le(),
// The device name here can be customized but it really has no real use
// appart from identifying the device the ELF is intended for which we have
// in our YAML.
dev_name: $crate::arrayify_string($device_name),
// The specification does not specify the values that can go here,
// but this value means internal flash device.
dev_type: $device_type,
dev_addr: $flash_address,
device_size: $flash_size,
page_size: $page_size,
dev_type: ($device_type as u16).to_le(),
dev_addr: ($flash_address as u32).to_le(),
device_size: ($flash_size as u32).to_le(),
page_size: ($page_size as u32).to_le(),
_reserved: 0,
// The empty state of a byte in flash.
empty: $empty_value,
empty: ($empty_value as u8).to_le(),
// This value can be used to estimate the amount of time the flashing procedure takes worst case.
program_time_out: $program_time_out,
program_time_out: ($program_time_out as u32).to_le(),
// This value can be used to estimate the amount of time the erasing procedure takes worst case.
erase_time_out: $erase_time_out,
erase_time_out: ($erase_time_out as u32).to_le(),
flash_sectors: [
$(
FlashSector {
size: $size,
address: $address,
size: ($size as u32).to_le(),
address: ($address as u32).to_le(),
}
),+,
// This marks the end of the flash sector list.
FlashSector {
size: 0xffff_ffff,
address: 0xffff_ffff,
size: 0xffff_ffffu32.to_le(),
address: 0xffff_ffffu32.to_le(),
}
],
};
Expand All @@ -222,7 +222,7 @@ macro_rules! algorithm {
pub struct FlashDeviceDescription {
vers: u16,
dev_name: [u8; 128],
dev_type: DeviceType,
dev_type: u16,
dev_addr: u32,
device_size: u32,
page_size: u32,
Expand Down
Loading