使用Stm32 F767,需要使用内存映射模式,参考STM32F769_DISCO开发板的源码,使用了内存映射模式。用来驱动W25Q256,参数如下: //------------------------------------------------------------------------------------------------------------------------------ QSPI_MemoryMappedTypeDef sMemMappedCfg; sMemMappedCfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE; s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE; s_command.Instruction = Fast_Read_Quad; s_command.AddressMode = QSPI_ADDRESS_4_LINES; s_command.Address = 0; s_command.AddressSize = QSPI_ADDRESS_24_BITS; s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_4_LINES; s_command.AlternateBytes = 0x00; s_command.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS; s_command.DataMode = QSPI_DATA_4_LINES; s_command.DummyCycles = 4; s_command.NbData = 0; s_command.DdrMode = QSPI_DDR_MODE_DISABLE; s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD; //s_command.SIOOMode = QSPI_SIOO_INST_ONLY_FIRST_CMD; //只发送一次指令 if (HAL_QSPI_MemoryMapped(&QSPI, &s_command, &sMemMappedCfg) != HAL_OK) { //Error_Handler(); } //------------------------------------------------------------------------------------------------------------------------------ 执行到HAL_QSPI_MemoryMapped()会返回Error,原因是设置标记位时一直不成功, 有时也可能会成功,但 DBG时看到内存映射的地址0x90000000里的数据与Flash内存储的并不相同。 苦恼了好些天了,希望有大神帮忙解答下! |
评分
查看全部评分
评分
查看全部评分