Attribute aligned

OP #2215803
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
(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

A question of your own? This thread is over 15 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.