STM32H7S78-DK开发板的主控制器为STM32H7S7L8H6H,其片上存储器资源包括:620 KB SRAM,64 KB Flash。它的片上Flash仅有64 KB,比片上SRAM还要小。对于稍微复杂的项目,64KB根本不够用。但是它有超能力:XIP实现直接执行外部存储器上的代码。
STM32H7R/S系列外部存储器接口和控制器包括:2个SD/SDIO/MMC接口;2个 Octo-SPI 存储器接口,或者1个Octo-SPI + 1个 Hexa-SPI接口,支持XIP;
灵活存储器控制器(FMC),可以支持到32比特位宽,支持SRAM, PSRAM, FRAM, SDR/LPSDR SDRAM, NOR/NAND存储器;
STM32H7S78-DK开发板上搭载了两个外部存储器,分别是:
256 Mbit Octo-SPI PSRAM APS256XXN-OBR-BG
1 Gbit Octo-SPI NOR Flash MX66UW1G45GXDI00
开发板框架:
开发板晶振;24M
chubeMX工程搭建
时钟配置:
串口配置:
static void MX_UART4_Init(void)
{
/* USER CODE BEGIN UART4_Init 0 */
/* USER CODE END UART4_Init 0 */
/* USER CODE BEGIN UART4_Init 1 */
/* USER CODE END UART4_Init 1 */
huart4.Instance = UART4;
huart4.Init.BaudRate = 115200;
huart4.Init.WordLength = UART_WORDLENGTH_8B;
huart4.Init.StopBits = UART_STOPBITS_1;
huart4.Init.Parity = UART_PARITY_NONE;
huart4.Init.Mode = UART_MODE_TX_RX;
huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart4.Init.OverSampling = UART_OVERSAMPLING_16;
huart4.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart4.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart4.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart4) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetTxFifoThreshold(&huart4, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetRxFifoThreshold(&huart4, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_DisableFifoMode(&huart4) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN UART4_Init 2 */
/* USER CODE END UART4_Init 2 */
}
定义一个数组
const char *str = "Hello 21ic, Hello STM32H7S78-DK!\n";
两种方式实现打印:
HAL_UART_Transmit(&huart4, (uint8_t*)str, strlen(str), HAL_MAX_DELAY);
printf("Hello 21ic, Hello STM32H7S78-DK!\n");
HAL_Delay(500);
|