avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] External 256K FLASH - memory pointer


From: Parthasaradhi Nayani
Subject: Re: [avr-gcc-list] External 256K FLASH - memory pointer
Date: Tue, 18 Sep 2012 03:22:39 -0700 (PDT)


From: Joerg Wunsch <address@hidden>
To: address@hidden
Sent: Tuesday, September 18, 2012 11:21 AM

>What's the point?  A pointer is just a 32-bit (or perhaps 24-bit,
>in recent AVR-GCC versions) number.

>Normally, the point of using a pointer is that the compiler arranges
>for you to dereference the pointer automatically, but this memory
>being external, not accessible by normal CPU instructions, this cannot
>work anyway.  Consequently, you can use the respective integer numbers
>by itself (perhaps through some kind of typedef that hints them being
>memory addresses).

Thanks for the response. Basically the requirement is to use external serial FLASH memory. We wanted large pointer for two things
1. To declare a section and assign variable names which is better than using absolute addresses. This is possible.
2. Pass the address to functions which do the reading and writing the memory. Given below is an example function prototype we would like to have

void ReadXFlashBlock (unsigned char *destptr, unsigned char *sourceaddr, unsigned int noofbytes);

In the above destptr is not an issue but sourceaddr is. If a 32 bit pointer can be somehow declared then this will be pretty elegant. If this is not possible then the only alternative would be to change the function parameters as shown below which is not really elegant.

void ReadXFlashBlock (unsigned char *destptr, long sourceaddr, unsigned int noofbytes);
The calling program must treat this long variable as a pointer rather than long itself.

Nayani





reply via email to

[Prev in Thread] Current Thread [Next in Thread]