In the Arria® II GX FPGA Development Kit, the factory application will program the flash with the default optionbit bytes only for factory and user 1 locations.
Even if you manually program the flash with the correct optionbit byte for the user 2 location, once the factory application gets executed, it will re-program the optionbit bytes and overwrite the optionbit byte for the user 2 location. This will cause loading of the user 2 location to fail.
Workaround:
Delete the BUP(board_update_portal) software image from flash by using the following command:
nios2-flash-programmer --base=0x0a000000 --erase-all