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
uint8_t rxBuffer[1024]; //Address 1
uint8_t txBuffer[1024]; //Address 2
__attribute__((section("datapatharea"))) uint8_t localBuffer[1024]; //Address 3
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)
const
Address 2 =
0x43400000 (From Map file)
uint8_t *traveseTxBuffer = txBuffer;
uint8_t *traveseT
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.
Thanks daith,
>> I would probably put those items into a struct
Yes that's suitable but these are my communication buffer at different level of abstraction layer.
>> If you really want to use the map fileNo i don't want to use map file, I am looking for a way which calculate the before compilation, e.g. I knew the base address of section("datapatharea") and sizes of above buffer.
I really appreciate your answer.
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.