Altera_Forum
Honored Contributor
16 years agoIntersting observation regarding flash...
hello i wrote:
//Write to flash
int var_2 = FLASH_getIndex();
////////////////////////////////////////////////////////////////////////////////////
LCD_clear();
fprintf(fp_LCD, "%d %d %d\r\n", regions.offset, regions.block_size, var_2);
ret_code = alt_write_flash_block(fd_FLASH, 0, regions.offset + (regions.block_size* var_2), FLASH_buffer, BUFF_SIZE);
fprintf(fp_LCD, "%d %d %d\r\n", regions.offset, regions.block_size, var_2);
while(1)
////////////////////////////////////////////////////////////////////////////////////
.
the output is: 65536 65536 0 <-- correct 65536 65536 100663112 <--wrong!!! why does the var_2 value changes after the alt_write_flash_block function call????