Ekami 0 Posted August 14, 2013 Share Posted August 14, 2013 Hello, I'm currently trying to make a simple blinky project in asm because I want something working for my base asm project. So far I made this Makefile: SRC= blink.s OBJS= $(SRC:.s=.o) NAME= blink.bin AS= arm-eabi-as LD= arm-eabi-ld OBJCPY= arm-eabi-objcopy INC= $(STELLARISWARE) LIBS= -L$(LIB_DIR_STELLARIS)/ -ldriver-cm4f CFLAGS= -I$(INC) -g -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall $(NAME): $(OBJS) $(LD) -T ldStart.ld -o a.out $(OBJS) --gc-sections $(OBJCPY) -O binary a.out $(NAME) clean: rm -vf $(OBJS) $(NAME) *.d *.out With this ldStart.ld MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 } SECTIONS { .text : { _text = .; KEEP(*(.isr_vector)) *(.text*) *(.rodata*) _etext = .; } > FLASH .data : AT(ADDR(.text) + SIZEOF(.text)) { _data = .; *(vtable) *(.data*) _edata = .; } > SRAM .bss : { _bss = .; *(.bss*) *(COMMON) _ebss = .; } > SRAM } But in blink.s there is just... nothing... So it does compile but I can't obviously test it on my board. I would like to know if someone have an asm sample for me to test it and see a result on the Stellaris. Atm I'm not enough skilled to make one by myself. Thank you Quote Link to post Share on other sites
Lyon 3 Posted August 14, 2013 Share Posted August 14, 2013 Hi, Here are two examples: a) http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/p/45978/156802.aspx#156802 http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/243460.aspx and one advice: play with that for fun or to learn assembler a little bit, but do not waist your life with a project in asm - use C instead, more productive and close enough to assembler. Not to mention that for 32 bits is more difficult to do than for 8-bit micros. Lyon bluehash and jazz 2 Quote Link to post Share on other sites
Ekami 0 Posted August 14, 2013 Author Share Posted August 14, 2013 Thanks a lot for your links but I already found them on the net and I tried to adapt it to gnu gas ARM assembler but it did not work . Maybe that's because of my Makefile, maybe because of what I tried to adapt? I can't tell , that's why I wanted a real working gnu gas working assembly project. And don't worry, that's only for study purpose with very small projects . Btw, I already managed to get a C project working on the stellaris . Quote Link to post Share on other sites
Lyon 3 Posted August 15, 2013 Share Posted August 15, 2013 Hi, I understand you - as an example of file in .asm/gnu look at the file TivaWare/bootloader/startup_gcc.S - has enough to understand the syntax and how to begin an .asm file. Note the extension in .S - this is a requirement since usual gas is not called directly, but from gcc, which knows how to call gas. The upper later is needed because of an gcc error. Another (maybe) problem are your tools - you call "arm-eabi-xxx", while the right tools should be "arm-none-eabi-xxx" - Look also to the Makefile and makedefs in TivaWare - contain all you need to configure the tools. Another thing to make your life easier: you can install Eclipse + GCC tools to have an IDE to work with. Has the advantage that with a right plug-in, you don't need to write makefiles, since it generates automatically for you. Not to speak about the debugger... Lyon Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.