how to define a big array at specify ram address in psoc creator for PSOC5 LP?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 help:

   

I want define a uint ADC_sample[2048] at 0x20000000.

   

writing as this:

   

uint16 ADC_sample[2048] _at(0x20000000);

   

But the psoc creator come out error.How can I wrinting for define this kind of array.

   

thanks!

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Have a look at this thread www.cypress.com/ and follow the links.

   

Another point to consider is: What is the use in having data stored at a specific address? The compiler is able to track variable's addresses, you may assign addresses to pointers, so at the end there is no need for and no use of putting areas of memory on a specific address.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

That would be true if all compilers provided perfect optimization. However

   

I have had instances where compile / link decisions left significant holes of

   

unused memory, and that if I overrode their address / location assignment

   

I could get more net code, ram availabilty.

   

 

   

Not an approach I prefer, actually I dislike doing it, but when device packing

   

and pennies / device collide sometimes necessary.

   

 

   

I wonder if user has another interesting reason for doing this ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 I want use this 2048 as a ad buffer.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You mean as ADC buffer? (if not - what is a 'ad buffer'?). Then you don't need to have it at a specific address, since you can tell the DMA the address of the buffer.

0 Likes
Anonymous
Not applicable

Sorry, adc bufffer.

   

I am write as follow.But the address of this array at 0x1fff850c in Psoc creator 3.0. It was not my define.why?

   

 uint16 ADC_sample[2048] __attribute__((at(0x1fff8000)));

   

 

   

Thanks

0 Likes