Hi , I am using ChanFat FS with code example from Martin Thomas. 1) There is an char array declared as
BYTE Buff __attribute__ ((aligned (4))) ; /* Working buffer */.
Is there any reason to align this array to a divisible by 4 address ? For example
char linebuf; /* 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 has been conservatively sized ?It does takes a lot of RAM. Thomas
Thomas Fernando wrote: > Is there any reason to align this array to a divisible by 4 address ? The array is probably accessed with a 32 bit pointer somewhere; on some architectures (e.g., ARM) the array needs to be aligned to a 4 byte boundary for that to work.
(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.