Forum Discussion
Altera_Forum
Honored Contributor
14 years agoNot sure what your problem is?
The flash sector size could well be 64k bytes (except maybe for 'boot' sectors at one end of the device), so you can only erase multiples of that size. As a general point, don't use int16 (or short) unless you really want wrapping at 2^16, are saving space in a structure, or mapping actual hardware registers into a structure. All you do is cause the compiler to generate extra instructions every time you do any maths. In the above, both your int16 items will be promoted to 'int' (32 bits) before the multiply - so that shouldn't be relevant. The size of the flash chips data bus is mostly irrelevant - apart from the problems in generating the required single cycles during the programming operation.