问答

汇集网友智慧,解决技术难题

21ic问答首页 - TAG - QSPI
  • GD32w515 qspi 配置错误 新手求帮助!

    使用引脚 PA9,PA10,PA11,PA12,PB3,PB4 我在读取 芯片id 时 读取的是88, 我查看 芯片手册 应该是引脚复用 为GPIO_AF_3 和GPIO_AF_4 ,但是还是不对,示波器打出来的波形很奇怪, 新手求帮助! [b]配置代码如下:[/b] rcu_periph_clock_enable(RCU_GPIOA); rcu_periph_clock_enable(RCU_GPIOB); rcu_periph_clock_enable(RCU_GPIOC); gpio_af_set(GPIOA, GPIO_AF_3, GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12); gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12); gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_166MHZ, GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12); gpio_af_set(GPIOB, GPIO_AF_4, GPIO_PIN_3 | GPIO_PIN_4); gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_3 | GPIO_PIN_4); gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_166MHZ, GPIO_PIN_3 | GPIO_PIN_4); qspi_init_struct Init; // rcu_periph_clock_enable(RCU_GTZC); // tzgpc_tzspc_peripheral_attributes_config(TZGPC_PERIPH_QSPI_FLASHREG, TZGPC_TZSPC_PERIPH_SEC); qspi_flash_gpio_config(); // qspi_deinit(); rcu_periph_clock_enable(RCU_QSPI); Init.prescaler = 1; /* QSPI clock = AHBCLK/(ClockPrescaler+1) */ Init.fifo_threshold = 10; Init.sample_shift = QSPI_SAMPLE_SHIFTING_NONE; // QSPI_SAMPLE_SHIFTING_NONE; Init.flash_size = 22; /* 2^(FlashSize+1) ***** number of address bits = FlashSize + 1*/ Init.cs_high_time = QSPI_CS_HIGH_TIME_1_CYCLE; Init.clock_mode = QSPI_CLOCK_MODE_0; qspi_init(&Init);

    gp 错误 GD32W515 spi QSPI GD32

    9762浏览量 16回复量 关注量
  • AT32F435VMT7基于FAL+QSPI驱动W25Q128。连续读取超过512K字节报错

    用QSPI驱动W25Q128.驱动应该没问题。但是读取的时候,数据超过512K就会失败。 512K以内就正常,1M就失败。 我把FLASH分区,一个512K分区,一个1M分区,同时跑fal bench。结果如下: ``` msh />fal bench 4096 yes Erasing 524288 bytes data, waiting... Erase benchmark success, total time: 1.896S. Writing 524288 bytes data, waiting... Write benchmark success, total time: 2.048S. Reading 524288 bytes data, waiting... Read benchmark success, total time: 0.144S. msh />fal probe update2 Probed a flash partition | update2 | flash_dev: norflash0 | offset: 1048576 | len: 1048576 |. msh />fal bench 4096 yes Erasing 1048576 bytes data, waiting... Erase benchmark success, total time: 3.844S. Writing 1048576 bytes data, waiting... Write benchmark success, total time: 4.096S. Reading 1048576 bytes data, waiting... 585728 3057 f1 ff. 585728 3058 f2 ff. 585728 3059 f3 ff. ... ... 585728 4090 fa ff. 585728 4091 fb ff. 585728 4092 fc ff. 585728 4093 fd ff. 585728 4094 fe ff. Data check ERROR! Please check you flash by other command. Read benchmark has an error. Error code: -1. This operate has an error. Error code: -1. msh /> ``` 不知道什么原因。 而且分区擦除和写入都成功了,读取失败了! ``` msh />sf probe qspi20 [I/SFUD] Find a Winbond flash chip. Size is 16777216 bytes. [I/SFUD] sf_cmd flash device is initialize success. [I/SFUD] Probe SPI flash sf_cmd by SPI device qspi20 success. 16 MB sf_cmd is current selected device. msh />sf bench yes Erasing the sf_cmd 16777216 bytes data, waiting... Erase benchmark success, total time: 41.318S. Writing the sf_cmd 16777216 bytes data, waiting... Write benchmark success, total time: 65.537S. Reading the sf_cmd 16777216 bytes data, waiting... Data check ERROR! Please check you flash by other command. Read sf_cmd failed, already rd for 788480 bytes, read 256 each time Read benchmark has an error. Error code: 3. This flash operate has an error. Error code: 3. ``` 我单独做sf bench测试正片flash,也失败了,但是,我测试fal read write少量数据读写都正常。用sf 的read write也正常。

    SFUD FAL QSPI bench AT32

    5125浏览量 22回复量 关注量
  • STM32H750 QSPI内存映射模式不能随机访问

    我在使用W25Q128FV这个flash,stm32h750, qspi能读能写,数据OK,但是使用HAL_QSPI_MemoryMapped内存映射后,从地址0x9000000直接读取数据也正常,但是我想随意定一个地址开始读取数据,比如从0x90001000开始读取,就发现全是FF。按理说这个地址也在flash范围以内啊?这是个bug么?

    FLASH spi 内存映射 stm32h750 flash App

    4780浏览量 4回复量 关注量