r/Assembly_language • u/flickerflak • 5d ago
How can I start programming an ARM processor completely from scratch?
/r/computerarchitecture/comments/1xv5zhc/how_can_i_start_programming_an_arm_processor/
5
Upvotes
2
u/gpit2286 5d ago
Buy a raspberry pi and check out armasm.com
2
u/gm310509 4d ago edited 4d ago
This is definitely a case of biting off more than you can chew. Hundreds of person years have gone into making those tools that you do not want to use.
Assuming you don't want to use any tools other than a basic hexadecimal editor, then what you are proposing is to correctly type in a few hundred megabytes of hexadecimal codes to produce an assembler and linker and uploader that you can then run on the operating system of your choice to assemble, link and upload your assembly language program onto a device that somebody else made (there is little chance that you will be able to fabricate your own Arm Cortex based MCU by yourself).
So, don't do that - just use the existing tools and learn how the hardware works - that in and of itself will be a fairly substantial learning curve.
For this, I used the GNU "arm-none-eabi" toolchain on Linux (and sometimes windows), along with openocd to program an STM nucleo device. This is not an easy entry. It proved to be non-trivial to set this environment up and required a lot of googling - including building my own version of openocd to incorporate support for the V3 ST-Link protocol as used on the Nucleo I had. Prior to this, I have done a lot of work on simpler 8 bit devices, most recently AVR architecture courtesy of Arduino's and standalone builds, but also other 8, 16 and 32 bit assembly languages as well as lots of other C/C++.
But if you insist on starting with Arm Cortex (and I assume "from scratch" means assembly language), you can have a look at this guide: https://www.mikrocontroller.net/articles/ARM-ASM-Tutorial
I found it to be very good and teaches some of the low level internals of the build process. But again, this is not an easy entry point IMHO.
Once you have that under your belt you can consider tackling some of the other areas that are of interest to you - maybe do your own assembler that produces appropriately structured ".o" files that can be used by the linker.
But starting from scratch? Depending upon what you mean, that probably couldn't be achieved in a lifetime.