The line that is: if (get_timer(start) > info->erase_blk_tout) { ~~~~~~~~~~~~~~~~~~~~ in "flash_status_check(xx, xx, ulong tout, xx)" that should be: if (get_timer(start) > tout) { because the "flash_status_check" do not only to be excuted when erasing flash.