{"id":4003,"date":"2016-01-05T21:32:32","date_gmt":"2016-01-05T21:32:32","guid":{"rendered":"http:\/\/really.zonky.org\/?p=4003"},"modified":"2018-03-31T21:13:06","modified_gmt":"2018-03-31T21:13:06","slug":"converting-ihex-format-to-binary-under-linux","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=4003","title":{"rendered":"Converting ihex Format To Binary Under Linux"},"content":{"rendered":"<p>A bit of a simple one this \u2026 if you are looking at converting an Intel hex format file that looks like the following :-<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4004\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2016-01-05_2123.png?resize=487%2C441\" alt=\"2016-01-05_2123\" width=\"487\" height=\"441\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2016-01-05_2123.png?w=487&amp;ssl=1 487w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2016-01-05_2123.png?resize=300%2C272&amp;ssl=1 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/p>\n<p>Then it is relatively trivial under Linux (Debian). The relevant tool is probably installed anyway; unless you are not compiling software which may be a marginal activity for weird people but so is converting ihex files. But just in case, you can install it with: <em>sudo apt-get install binutils<\/em>.<\/p>\n<p>Once installed (or being already present) the conversion process is as simple as :-<\/p>\n<pre>\u00bb objcopy -I ihex -O binary somefile.hex somefile.bin<\/pre>\n<p>Be careful to specify the second file name or <em>objcopy<\/em> will overwrite the original hex file (don&#8217;t ask how I discovered this!).<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3904\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/damascus-unix-prompt1.png?resize=695%2C463&#038;ssl=1\" alt=\"\" width=\"695\" height=\"463\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/damascus-unix-prompt1.png?w=792&amp;ssl=1 792w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/damascus-unix-prompt1.png?resize=300%2C200&amp;ssl=1 300w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A bit of a simple one this \u2026 if you are looking at converting an Intel hex format file that looks like the following :- Then it is relatively trivial under Linux (Debian). The relevant tool is probably installed anyway; unless you are not compiling software which may be a marginal activity for weird people <a href='https:\/\/really.zonky.org\/?p=4003' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[4,209,226],"tags":[1378,1379,1380],"class_list":["post-4003","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-working-notes","tag-hex","tag-ihex","tag-objcopy","category-4-id","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-12z","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4003"}],"version-history":[{"count":3,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4003\/revisions"}],"predecessor-version":[{"id":5224,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/4003\/revisions\/5224"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}