Attribute aligned

OP #2215803
Rate this post
useful
not useful
Hi ,

I am using ChanFat FS with code example from Martin Thomas.
1) There is an char array declared as
1
 BYTE Buff[16384] __attribute__ ((aligned (4))) ; /* Working buffer */.
Is there any reason to align this array to a divisible by 4 address ?
For example
1
char linebuf[120];      /* Console input buffer */
does not use the aligned attribute.

2)If someone can say whats the smallest ARM7/Cortex they have shoehorned 
this FAT system it would help me.
Buff[16384] has been conservatively sized ?It does takes a lot of RAM.


Thomas
Moderator #2223697
Rate this post
useful
not useful
(1) as Andreas mentioned. On some devices the adress of the buffer is 
used in the low-level drivers which may have restrictions i.e. on 
DMA-adresses. On other targets the aligment might not be needed but can 
do no harm (maybe even speeds things up a little bit)

(2) the buffer can be smaller the 16KiBytes are just used in the example 
for benchmarking. If you look further down you will find the sice of the 
buffer used for some copy-routines. See ChaN's API documentation to find 
out which minimal buffer-sizes are needed.

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now