cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create an Assembly Language Project within KEIL uV 5 with or without Cube MX?

ihartavi
Associate II

Dear

I appreciate if someone leads me to learn how to create an assembly program within KEIL uVision 5.

I develop on STM32F030 series micro-controllers.

Is it possible in older versions, i.e. uV 4, uV 3, ... etc?

Best Regards!

6 REPLIES 6
gbm
Lead III

When you create a project with Keil, it does not even create a main function. You may simply write your main function in assembly language instead of C.

Another question is why would anyone do that. An average compile for ARM usually writes better, more compact and faster code than an average assembly programmer. ARM is not an assembly-programming friendly architecture.

Perhaps take and example/template project, clone into another directory, and do you Assembler work directly into the startup.s file.

Failing that, read some of the documentation, or find tutorials or videos, doubt you're charting new territory here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ihartavi
Associate II

There looks to be no straight way to do it.

Dear gbm, I agree that c is easier. However, I believe assembly programming gives me a better understanding of MCU of concern. Hence, it improves my ability to code in C. Eventually, all coding is transformed to assembly instructions after compilation/linking/... process.

Thanks for replies!

gbm
Lead III

Let me, an old programmer with experience in about 20 assembly languages, disagree on this topic. Everything you want to see and understand, is in the assembly listing of your compiled code. Keil free version does not produce this output - another reason for switching to STM32CubeIDE to see the beautiful .list file. 🙂

ARM assembly is not for humans... 😉 Ok, maybe reading is but writing - not.

ARMv6-M architecture was created to make it possible to avoid even a single line of assembly in the whole microcontroller firmware:

https://github.com/gbm-ii/Cortex-M_C_startup_gen

Proof of concept - as you can see, it's possible:

0693W00000UoAB4QAN.png

ChahinezC
Lead

Hello @ihartavi​,

Welcome to ST community.

I think you can find a project that can help you here.

Regards,

Chahinez.

Thanks for sharing! I appreciate.

It is interesting that it was not part of KEIL. I expect it to be, because, IMO, KEIL should provide assembly project generation since assembly coding is already a function of uVision IDE.

It is obvious there is no easy way. I have to beg experts to show me how for a certain microcontroller.