我想用QSPI FLASH 作OTA,选用的是W25Q64,现在对QSPI的读写都正常,但是把QSPI 映射成内存模式,一对 0x9000000UL 进行读,就进入HardFault_Handler, 下面是我配置映射的代码,哪位大侠能帮看看有什么问题没有我芯片是用的STM32H750VB 用的STM32CUBE static unsigned int QSPI_EnableMemoryMappedMode(QSPI_HandleTypeDef *QSPIHandle) { QSPI_CommandTypeDef s_command; QSPI_MemoryMappedTypeDef s_mem_mapped_cfg; // Configure the command for the read instruction s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE; s_command.Instruction = QUAD_INOUT_FAST_READ_CMD; s_command.Address = 0; s_command.AddressMode = QSPI_ADDRESS_4_LINES; s_command.AddressSize = QSPI_ADDRESS_24_BITS; s_command.AlternateBytes = 0x00; s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE; s_command.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS; s_command.DataMode = QSPI_DATA_4_LINES; s_command.NbData = 1; //??????? s_command.DummyCycles = 6; s_command.DdrMode = QSPI_DDR_MODE_DISABLE; s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD; // Configure the memory mapped mode s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE; s_mem_mapped_cfg.TimeOutPeriod = 0; return HAL_QSPI_MemoryMapped(QSPIHandle, &s_command, &s_mem_mapped_cfg); } */ static unsigned int QSPI_EnableMemoryMappedMode(QSPI_HandleTypeDef *QSPIHandle) { QSPI_CommandTypeDef s_command; QSPI_MemoryMappedTypeDef s_mem_mapped_cfg; // Configure the command for the read instruction s_command.InstructionMode = QSPI_INSTRUCTION_4_LINES; s_command.Instruction = QUAD_INOUT_FAST_READ_CMD; s_command.Address = 0; s_command.AddressMode = QSPI_ADDRESS_4_LINES; s_command.AddressSize = QSPI_ADDRESS_32_BITS; // 24 32 都试过 s_command.AlternateBytes = 0x00; s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE; s_command.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS; s_command.DataMode = QSPI_DATA_4_LINES; s_command.NbData = 1; //??????? s_command.DummyCycles = 6; s_command.DdrMode = QSPI_DDR_MODE_DISABLE; s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD; // Configure the memory mapped mode s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE; s_mem_mapped_cfg.TimeOutPeriod = 0; return HAL_QSPI_MemoryMapped(QSPIHandle, &s_command, &s_mem_mapped_cfg); } |
STM32H750内部flash读写
STM32H743采用flash swap 进行IAP升级,reset后启动不了
STM32双核H7核间通信的方法
STM32H743IIC,HAL库驱动硬件I2C,hi2c2.state一直是busy. 为什么?
H747 DSI 模块的官方例程跑不通
MAC回环或以太网PHY芯片回环怎么实现?
STM32745/747芯片固件升级问题
H743 DAC通道缓冲器的校准问题
STM32H750更改时钟后,程序无法运行
疑似STM32CUBEIDE出现BUG
麻烦给个连接,我学习一下啊
链接在这里,查看
[md]连接打不开啊
感觉发生了非法访问导致硬错。
好好检查下配置,尤其注意地址方面被给错或越界了。