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

Placing and Accessing data at/from specific addresses

IDE:                               ARM DS-5 (v5.19.0)

Platform:                        Cortex-R4 (Dual Processor)

Debug agent                   DSTREAM (Connection Type:TCP:DSTREAM)

Execution Environment    Bare-metal

Hello everyone,

I am using attribute for placing the variables in a specific section e.g. "__attribute__((section("datapatharea")))"


//Processor A

__attribute__((section("datapatharea"))) uint8_t rxBuffer[1024];      //Address 1
__attribute__((section("datapatharea"))) uint8_t txBuffer[1024];      //Address 2

__attribute__((section("datapatharea"))) uint8_t localBuffer[1024];   //Address 3

but the problem is that, I want to access them by there address in other processor. Currently i am doing this manually by using there address from map file.

//Processor B

uint8_t * const txBuffer = (uint8_t*)(0x43400000);    // Address 2 = 0x43400000 (From Map file)

uint8_t *traveseTxBuffer = txBuffer;


So, my questions are:

1) what's the best way of doing this?
2) I am looking for a general solution?

I really appreciate your suggestions.

Thanks.

Parents
  • Well they'll all be accessible since they are all in the same section so what you want is to restrict visibility of names a bit.

    I think something like this should work, put a statement like this into the header defining rxbuffer for instance

    static uint8 * const rxbuffer = struct__name.rxbuffer;


    These could go into the different headers where you defined rxbuffer etc before.

Reply
  • Well they'll all be accessible since they are all in the same section so what you want is to restrict visibility of names a bit.

    I think something like this should work, put a statement like this into the header defining rxbuffer for instance

    static uint8 * const rxbuffer = struct__name.rxbuffer;


    These could go into the different headers where you defined rxbuffer etc before.

Children
No data