exmc_norsram_parameter_struct FPGAsram_init_struct;
exmc_norsram_timing_parameter_struct FPGAsram_timing_init_struct;
rcu_periph_clock_enable(RCU_AF);
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOB);
rcu_periph_clock_enable(RCU_GPIOD);
rcu_periph_clock_enable(RCU_GPIOE);
rcu_periph_clock_enable(RCU_GPIOC);
rcu_periph_clock_enable(RCU_GPIOG);
rcu_periph_clock_enable(RCU_EXMC);
//exmc_norsram_deinit(EXMC_BANK0_NORSRAM_REGION0);
//FPGA_ADD
gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ , GPIO_PIN_11| GPIO_PIN_12| GPIO_PIN_13);
//gpio_pin_remap_config(GPIO_EXMC_NADV_REMAP, ENABLE);
gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ , GPIO_PIN_2| GPIO_PIN_3| GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6);
//gpio_pin_remap_config(GPIO_EXMC_NADV_REMAP, ENABLE);
//FPGA_DATA
gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ , GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_14| GPIO_PIN_15|
GPIO_PIN_9| GPIO_PIN_10| GPIO_PIN_8);
//gpio_pin_remap_config(GPIO_EXMC_NADV_REMAP, ENABLE);
gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ , GPIO_PIN_7| GPIO_PIN_8| GPIO_PIN_9| GPIO_PIN_10|
GPIO_PIN_11| GPIO_PIN_12| GPIO_PIN_13| GPIO_PIN_14| GPIO_PIN_15);
//gpio_pin_remap_config(GPIO_EXMC_NADV_REMAP, ENABLE);
//NOE、NWE、NE
gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ , GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_7);
//gpio_pin_remap_config(GPIO_EXMC_NADV_REMAP, ENABLE);
//AFIO_PCF1=AFIO_PCF1|(0x00000400);
FPGAsram_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_A;
FPGAsram_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK;
FPGAsram_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE;
FPGAsram_timing_init_struct.bus_latency = 0;
FPGAsram_timing_init_struct.asyn_data_setuptime = 10;
FPGAsram_timing_init_struct.asyn_address_holdtime = 2;
FPGAsram_timing_init_struct.asyn_address_setuptime = 10;
FPGAsram_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION0;//bank0
FPGAsram_init_struct.write_mode = EXMC_ASYN_WRITE;//异步写
FPGAsram_init_struct.extended_mode = DISABLE;
FPGAsram_init_struct.asyn_wait = DISABLE;
FPGAsram_init_struct.nwait_signal = DISABLE;
FPGAsram_init_struct.memory_write = ENABLE;
FPGAsram_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE;
FPGAsram_init_struct.wrap_burst_mode = DISABLE;
FPGAsram_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW;//
FPGAsram_init_struct.burst_mode = DISABLE;
FPGAsram_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B;
FPGAsram_init_struct.memory_type = EXMC_MEMORY_TYPE_SRAM;
FPGAsram_init_struct.address_data_mux = DISABLE;
FPGAsram_init_struct.read_write_timing = &FPGAsram_timing_init_struct;
FPGAsram_init_struct.write_timing = &FPGAsram_timing_init_struct;
rcu_periph_clock_enable(RCU_EXMC);
exmc_norsram_init(&FPGAsram_init_struct);
exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION0);
*(volatile uint16_t*)((uint32_t) 0x60080000)=10000;//使用的地址线A16-A13
get_exmc=*(volatile uint16_t*)((uint32_t) 0x60080000)
无论怎么调试,EXMC的片选信号一直高电平,动都不带动一下的,请求大侠的指导 |