Electronics > Microcontrollers

Exploring ARM assembly language on STM32 with Windows desktop

<< < (4/4)

brucehoult:

--- Quote from: westfw on December 01, 2022, 01:33:44 am ---
--- Quote ---Cortex-M3 supports both 16-bit Thumb and (16/32-bit) Thumb-2 instructions, Cortex-M0 supports Thumb (and a few Thumb-2) instructions
--- End quote ---
Yeah, but what surprises you is that a bunch of things like "immediate mode" and "range of arguments" end up pushing you from the 16bit encoding to 32bit encodings (which don't exist on M0.)  So you get "mov r1, 0x80" but not "mov r1, 0x8000", and you have "and (registers)" but not "and (immediate.)"  Grr.

--- End quote ---

No surprise to those of us used to programming (and writing compilers for) ARM7TDMI and the like :-)

It's quite an exercise to memorise all 19 instruction formats for Thumb1 and their limitations!

harerod:

--- Quote from: Sherlock Holmes on November 29, 2022, 06:38:52 pm ---I'm looking for ways I can explore ARM assembly language with STM32 devices and using Windows desktop as my preferred workstation.

I have VisualGDB already and that's is good enough for my informal, non-professional needs but I don't think it makes it straightforward to start an assembler based project.

What other ways are there to do this?

--- End quote ---


I understood your initial question as: "Which toolchains are available that support assembly?"

In that case - why not CubeIDE with the GCC toolchain?
If it is about exploring the functionality of assembly, it may even be helpful to let your assembly function be called by C.
I have rare applications/excuses for writing ASM on ARM. However, there are some functions that I prefer doing in ASM.

SiliconWizard:
Not sure what exactly the OP is after? You don't need anything else than what you'd use for developing with C on those MCUs. An assembler is part of any compiler distribution I know of. GCC would be the most common for ARM MCUs and strictly speaking, all you'd need is binutils, but it's always part of a GCC distribution. The rest is just your favorite programming text editor/IDE.

ARM distributes their "official" binaries for the toolchain : https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

You don't need to download the full Cube crap from ST. You can use your own dev tools along with the above ARM toolchain, and then use the ref manuals for register description/etc.
You can browse ST's github repos for the libraries and take what you need if anything, for instance for the F4 series : https://github.com/STMicroelectronics/STM32CubeF4
All the base include files are in there : https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Drivers/CMSIS
It's only C definitions though, I'm not quite sure where you can find assembly definitions for the registers, for instance. Can probably be found somewhere. You can otherwise generate them yourself from the SVD files.

This is a very useful repo : https://github.com/posborne/cmsis-svd
A crapton of MCUs in there with their respective SVD file, and tools in Python for parsing SVD and generating various file formats from it. Recommended for anyone doing bare metal dev and especially if using prog languages that are "exotic".

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod