I really want to just write some values to registers but I am really struggling to get the most simple of ASM projects to build
I am coming from PIC background and for an intial lab I want to be able to just show some students how to load a register and add together..Something like this
AREA text, code, readonly ENTRY MOV R0, #5 ADD R0, R0, #1 END
I found this code online, however the build is failing saying it "Cannot find arguement _Vectors" I see that vectors is defined in Startup.s but I really don't want to use any other additional files. Is there a way to do a simple ASM file like above without any additional files? and debug it
The board being used is the STM32F401RE NUCLEO..
Thanks
Welcome Sam.
Have you noticed Writing your own startup code for Cortex-M Jens wrote?
It gives you all you need to initialize the beast in a single file.
You can then add your code at the bottom.
Otherwise, if you look at the comment section of the document I linked, you will see how others are doing it.
Hi Alban. Thanks for that I need to try it out when it get back to work on Monday.
So I should just be able to use that generic startup code on my STM32f4 as long as my code isn't using anything specific to that chip like peripherals. If I just want to edit some register values it should just work?
Hi Sam
I agree with both of you. Attached a startup.s file of Nucleo F401RE, with some sample lines, e.g. writing/reading registers. You can use this single file to start debug straightforward.
Cheers
Sean
Thankyou so much Sean, I will try this file out when I get back to work on Monday
Good afternoon Sam, has it worked for you?
If so, would you be able to mark Sean's answer as Correct to close the question?
Hi Alban
Just got to work and the file doesn't build it says
.\assembly.axf: Error: L6218E: Undefined symbol SystemInit (referred from assembly.o). .\assembly.axf: Error: L6218E: Undefined symbol __use_two_region_memory (referred from assembly.o).
.\assembly.axf: Error: L6218E: Undefined symbol SystemInit (referred from assembly.o).
.\assembly.axf: Error: L6218E: Undefined symbol __use_two_region_memory (referred from assembly.o).
I am guessing this is because the C file isn't attached but I wanted to avoid using the C file and just get the project up and running with nothing but 1 ASM file. I will report back with my findings
Try removing the 'IMPORT SystemInit", the "IMPORT __use_two_region_memory" and the comment-block ...
; LDR R0, =SystemInit
; BLX R0
; LDR R0, =__main
; BX R0
...I think that would get rid of those errors.