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

Accessing External Memory Devices

Hey all,

I am using uVision 3 and a Phytec 2294 board.

I have an external memory device connected to the phytec expansion board. The external device is using /CS0, although from talking to phytec, I am not sure if that is quite right.

I have set up the external memory space in the project options like so:
Start: 0x80000000 Size: 0x4

When I define a variable like :

#define volatile var x __at 0x8000000

and step through my code, any write/read to that variable doesnt seem to take place at the right addresses.

Can anyone give a clue as to what I may have missed?
Thanks

Doug

Parents
  • Much better. Thank you.

    0x00000606 E7F1 B 0x000005EC
    27: int main (void) {
    28: unsigned int j; /* LED var */
    29:
    0x00000608 B500 PUSH {LR}           ;Just saving some processor context there.

    30: MY_REG1 = 1;
    31:
    0x0000060A 2101 MOV R1,#0x01        ;Loading R1 with the value to be written.
    0x0000060C 4813 LDR R0,[PC,#0x004C] ;Loading R0 with the address to write to.
    0x0000060E 7001 STRB R1,[R0,#0x00]  ;Performing the byte write.
    What's probably throwing you here is at 0x0000060C with the load of R0 with 0x83000000 not being obvious. What is being loaded into R0 is the value the compiler stored at (PC + 0x4C). If you were to look further down in memory at 0x0000065C (or thereabouts), you should see 0x83000000 stored there. That's where the compiler stored our target address.

Reply
  • Much better. Thank you.

    0x00000606 E7F1 B 0x000005EC
    27: int main (void) {
    28: unsigned int j; /* LED var */
    29:
    0x00000608 B500 PUSH {LR}           ;Just saving some processor context there.

    30: MY_REG1 = 1;
    31:
    0x0000060A 2101 MOV R1,#0x01        ;Loading R1 with the value to be written.
    0x0000060C 4813 LDR R0,[PC,#0x004C] ;Loading R0 with the address to write to.
    0x0000060E 7001 STRB R1,[R0,#0x00]  ;Performing the byte write.
    What's probably throwing you here is at 0x0000060C with the load of R0 with 0x83000000 not being obvious. What is being loaded into R0 is the value the compiler stored at (PC + 0x4C). If you were to look further down in memory at 0x0000065C (or thereabouts), you should see 0x83000000 stored there. That's where the compiler stored our target address.

Children