I am new to microcontroller programming. I have a program written in C or assembly language which I need to convert into a .HEX file to flash into the 8051 microcontroller. I do not want to use an IDE (Keil for example) and want to perform this conversion only using terminal commands incorporating some kind of compiler or executing any other program through terminal. I have read some other answers that address similar issues but they make use of IDE. Please help me with this issue and let me know if there is anything else I should know.
Source code in C for 8051 is always compiler specific. One reason is the crazy addressing space (
xdata, and no, I am not making this up).
Thus you always need to know which C compiler you want to code for.
Each Compiler call usually needs quite a lot of command line arguments - e.g. in order to select the correct MCU and memory model. Another issue: Header files - these are also MCU specific. It is about an order of magnitude simpler to manage these in an IDE.
If you needed a command line tool for whatever reason (automation comes to mind) either call the IDE (most of them can compile projects via command line) or write a
Makefile to be used with
make command line tool.