Skip to content

stdlib: Add Intel HEX support to InstallRawStep #9636

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
Sep 7, 2021

Conversation

ehaas
Copy link
Contributor

@ehaas ehaas commented Aug 27, 2021

This allows writing HEX files with exe.installRaw, where exe is a LibExeObjStep. A HEX file will be written if the file extension is .hex or .ihex, otherwise a binfile will be written. The output format can be explicitly chosen with exe.installRawWithFormat("filename", .hex); (or .bin)

Part of #2826

@ehaas ehaas force-pushed the hexfiles branch 2 times, most recently from 21f006a to 865ac72 Compare August 28, 2021 01:42
@ehaas
Copy link
Contributor Author

ehaas commented Aug 28, 2021

Drone failed on Test [193/1032] behavior.atomics.test "behavior-native-ReleaseFast-bare-single atomicrmw with floats"... FAIL (TestUnexpectedResult) which seems to be unrelated.

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Looks merge-ready to me except for 1 question that I had-

@@ -13,6 +13,7 @@ const fs = std.fs;
const io = std.io;
const sort = std.sort;
const warn = std.debug.warn;
const nl = std.cstr.line_sep;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the newline depend on the target, not the host system running the compiler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon further investigation it appears to always end in CRLF. Source: https://developer.arm.com/documentation/ka003292/latest and also running objcopy -O ihex test.o test.hex on a native .o file for a x86_64 linux system. So I'll update it to always to \r\n

ehaas and others added 2 commits September 1, 2021 12:21
This allows writing HEX files with `exe.installRaw`, where `exe` is a
`LibExeObjStep`. A HEX file will be written if the file extension is `.hex`
or `.ihex`, otherwise a binfile will be written. The output format can be
explicitly chosen with `exe.installRawWithFormat("filename", .hex);`
(or `.bin`)

Part of ziglang#2826

Co-authored-by: Akbar Dhanaliwala <[email protected]>
@andrewrk andrewrk merged commit d305ba7 into ziglang:master Sep 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants