本帖最后由 tcdbobo 于 2020-6-15 16:17 编辑
硬件:正点原子北极星 STM32H750
开发环境: cubeMX + HAL
根据原理图配置相关引脚
采用的是:Bank1 with Quad SPI Lines/四线Bank1模式
PB6 ------> QUADSPI_BK1_NCS
PF6 ------> QUADSPI_BK1_IO3
PF7 ------> QUADSPI_BK1_IO2
PF8 ------> QUADSPI_BK1_IO0
PF9 ------> QUADSPI_BK1_IO1
PB2 ------> QUADSPI_CLK
现在的问题,编译啥的都通过了,0错误,0警告,下载debug ITM显示打印失败。不知道是哪里的问题,请大佬帮忙看一下。
参考的程序是银杏科技论坛里的技术文档http://www.gkwiki.cn/doku.php?id=icore4t_13
参考网上的程序:main.c如下:
int main(void)
{
/* USER CODE BEGIN 1 */
int i;
int temp;
unsigned char write_buffer[4096];
unsigned char read_buffer[4096];
/* USER CODE END 1 */
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_QUADSPI_Init();
MX_USART3_UART_Init();
/* USER CODE BEGIN 2 */
BSP_QSPI_Init();
printf("W25Q64 QuadSPI Test....\r\n\r\n");
temp = BSP_QSPI_FLASH_ReadID();
printf("FLASH ID: 0x%X\r\n\r\n",temp);
//write
for(i = 0;i < 4096;i ++)
{
write_buffer = i % 4096;
read_buffer= 0;
}
BSP_QSPI_Write(write_buffer,0,4096); //写数据
BSP_QSPI_Read(read_buffer,0,4096); //读数据
for(i = 0;i < 4096;i ++)
{
if(read_buffer != write_buffer)
{
printf("FLASH ERROR!\r\n");//打印失败
while(1);
}
}
printf("FLASH TEST OK!\r\n");//打印成功
/* USER CODE END 2 */
while(1)
{
}
}
|