This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assembly coding in GNU

Hai all;

I am doing a project in LPC2368 using uVision3 such that ,I want to write datas to 512k of Flash and read back to RAM.

I reffered C:\Keil\ARM\Flash\LPC_IAP2_512 and using Real veiw toolset it is working in both simulator and in MCB 2300 board fine.

Because of size limitation ,I want to Convert the above project to GNU compiler.IN C:\Keil\ARM\Flash\LPC_IAP2_512 there was one assembly code IAP.s like this ;

AREA IAPEXE, CODE, READONLY

;void my_IAP_Execute (struct sIAP *pIAP); EXPORT my_IAP_Execute

my_IAP_Execute STMFD SP!,{LR} ; Save Return Address ADD R1,R0,#0x14 ; R0 = &IAP.cmd, R1 = &IAP.stat ADR LR,my_IAP_Exit ; Return Address LDR R2,=0x7FFFFFF1 ; IAP Entry (Thumb Mode) BX R2 ; Execute IAP Command

my_IAP_Exit LDMFD SP!,{LR} ; Restore Return Address MOV PC,LR ; Return

END

I changed this code to work in GNU compiler like this

.text .arm _start : .global _start .global IAP_Execute b IAP_Execute

IAP_Execute : STMFD SP!,{LR} /*Save Return Address */ ADD R1,R0,#0x14 /* R0 = &IAP.cmd, R1 = &IAP.stat */ ADR LR,IAP_Exit /* Return Address */ LDR R2,=0x7FFFFFF1 /* IAP Entry (Thumb Mode) */ BX R2 /* Execute IAP Command */

IAP_Exit : LDMFD SP!,{LR} /* Restore Return Address*/ MOV PC,LR /* Return */

.end

But still it is not working ,Will you please tell me that why I am not able to compile in GNU, OR will be there is any other method to do this.

Sincerely
shamsudheen OP

Parents Reply Children
No data