This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Create hex command line. Fatal error: Q3900U: Unrecognized option '--hex'.

Hi 

Referencing this document : https://developer.arm.com/documentation/ka004238/latest/
 

As the document says,

I used:

C:\Keil_v5\ARM\ARMCLANG\bin\fromelf.exe --hex --output=myprog.bin myprog.axf

But I get an error:

Fatal error: Q3900U: Unrecognized option '--hex'.

I am on the latest MDK. 

Same result for Arm Compiler for embedded FUSA.



What is the correct command?

Parents
  • I'm sorry that the knowledgebase article "UVISION: Creating Intel Hex Files for Arm-Based Devices" was misleading. My colleague already corrected it. I don't know where this mistake came from. fromelf never supported the option --hex as far as I can tell.

    Ronan is right, you can use --i32 or --i32combined. µVision uses --i32combined when you just select 'Create HEX File' in the dialog 'Options for Target - Output'. If you use --i32, fromelf might create multiple HEX files when you use multiple load regions in the linker scatter file.

    Is there a debug log where I can see what exactly it does when I select create hex in Keil Uvision?
    I would like to see if other flags are used , or the correct flow

    Well, there is no log, but µVision can create a batch file that contains the same tool invocations as it would use during a project build. So when you select the option 'Create Batch File' in the µVision dialog 'Options for Target - Output', and if you then build your application in µVision, you will get a batch file in the project folder with the name of the project target. Be sure to switch off the option 'Create Batch File' after you have created the batch file because this option disables 'Parallel Build' and therefore will extend the build time a lot. Here is an example Debug.BAT:

    ...
    ...
    "C:\Keil_v5\ARM\ARMCLANG\Bin\fromelf.exe" ".\Debug\MyProject.axf" --i32combined --output ".\Debug\MyProject.hex"
    

Reply
  • I'm sorry that the knowledgebase article "UVISION: Creating Intel Hex Files for Arm-Based Devices" was misleading. My colleague already corrected it. I don't know where this mistake came from. fromelf never supported the option --hex as far as I can tell.

    Ronan is right, you can use --i32 or --i32combined. µVision uses --i32combined when you just select 'Create HEX File' in the dialog 'Options for Target - Output'. If you use --i32, fromelf might create multiple HEX files when you use multiple load regions in the linker scatter file.

    Is there a debug log where I can see what exactly it does when I select create hex in Keil Uvision?
    I would like to see if other flags are used , or the correct flow

    Well, there is no log, but µVision can create a batch file that contains the same tool invocations as it would use during a project build. So when you select the option 'Create Batch File' in the µVision dialog 'Options for Target - Output', and if you then build your application in µVision, you will get a batch file in the project folder with the name of the project target. Be sure to switch off the option 'Create Batch File' after you have created the batch file because this option disables 'Parallel Build' and therefore will extend the build time a lot. Here is an example Debug.BAT:

    ...
    ...
    "C:\Keil_v5\ARM\ARMCLANG\Bin\fromelf.exe" ".\Debug\MyProject.axf" --i32combined --output ".\Debug\MyProject.hex"
    

Children
No data