We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello All,
I am trying to write data into flash which i need to copy it to the SRAM later. I am doing this in assembly and this is part of the code i am trying to use.
I have provided the addresses of the FMD, FMA and FMC registers needed for flash programming and then I am copying those addresses into the registers r8,r9 and r10.
My question is how do i now load data values into the addresses pointed by the registers r8,r9 and r10? As you can see, I am clearly wrong somewhere and need assistance!!
FMD EQU 0x000000ABFMA EQU 0x000000DCFMC EQU 0x000000FF....LDR R8, =FMDLDR R9, =FMALDR R10,=FMCMOV32 [R8], #0xF0F0F0F0MOV32 R9, #0x00000000poll MOV32 R10,#0xA4420001BNE poll
Thanks!!
BR,\ksnf3000
For the details of the flash programming side, I guess TI forum might be a better place:
http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/default.aspx
For assembly language aspect, maybe we can help. Typically memory accesses are carried out using LDR (load) and STR (store) instructions.
(Cortex-M4 Devices Generic User Guide: 3.4. Memory access instructions).
For a start, to write a certain value to a memory location:
LDR R0, =address_value
LDR R1, =data_value
STR R1, [R0]
To read back a data:
LDR R1, [R0]
In the generic user guide you can find the details of the instruction set including conditional branches (Cortex-M4 Devices Generic User Guide: 3.10.1. B, BL, BX, and BLX) need by your polling loops.
regards,
Joseph