Altera_Forum
Honored Contributor
15 years agowhere do I define ALT_USE_CFI_FLASH
I am trying to enable writing to flash, but alt_flash_open_dev(CFI_FLASH_NAME) is returning NULL due to the following line of code# if (!defined(ALT_EXCLUDE_CFI_FLASH) && ((!defined(ALT_USE_SMALL_DRIVERS) && !defined(ALT_SIM_OPTIMIZE)) || defined(ALT_USE_CFI_FLASH)))
in altera_avalon_cfi_flash.h If I uncheck enable_reduced_device_drivers in the BSP editor, the function works, but the code size is increases by 9k. This will not work since I have to fit the code in the boot loader section that is only 8k. I have found support solution rd04202006_176, but the steps do not make sense.- Right click your system library and select Properties
- Select C/C++ Build from the left hand panel of the Properties window
- Under Tool Settings select Preprocessor under Nios II Compiler
- Define a new symbol called ALT_USE_CFI_FLASH in the Defined Symbols window
- Select OK
- Recompile your project