活动介绍
file-type

AT91RM9200串口配置指南与开发要点

下载需积分: 50 | 78KB | 更新于2025-04-13 | 41 浏览量 | 2 下载量 举报 收藏
download 立即下载
标题中所指的知识点是关于AT91RM9200微控制器的串行端口配置方法。AT91RM9200是Atmel公司推出的一款高性能、低功耗的32位RISC微控制器,广泛应用于工业控制、通信、网络等需要复杂处理功能的嵌入式系统中。该微控制器内置了丰富的外设接口,其中包括多个串行端口。 在嵌入式系统开发中,串行端口的配置是基础且非常关键的步骤之一。串行端口用于微控制器和外部设备或计算机进行数据交换,其配置正确与否直接影响到系统的稳定运行和通信的可靠性。 以下详细说明了AT91RM9200串行端口配置中的关键知识点: 1. 串行端口的硬件资源:AT91RM9200通常会提供多个串行端口(UARTs),它们有专用的引脚,比如TX(发送)和RX(接收)用于进行数据传输。除此之外,还可能包含用于硬件流控制的RTS(请求发送)和CTS(清除发送)等引脚。 2. 串行端口的初始化:为了正确使用串行端口,开发者需要先对相关的寄存器进行配置。初始化步骤包括设置波特率、数据位、停止位和校验位等参数。波特率决定了数据的传输速率,而数据位、停止位和校验位则定义了每个数据包的结构。 3. 波特率的设置:波特率的配置需要根据外部设备的规格和通信需求来确定。在AT91RM9200中,可以通过设置波特率发生器来控制波特率。波特率发生器的值需要根据主时钟频率来计算和设置,以确保数据正确同步传输。 4. 中断和DMA(直接内存访问):在串行通信中,为了提高CPU效率和减少对CPU的中断,可以利用中断服务程序或DMA来处理数据传输。AT91RM9200支持使用中断和DMA来减轻CPU负担,使得CPU可以执行其他任务。 5. 流控制:硬件流控制是用于控制数据传输的机制,它可以通过RTS和CTS信号线来实现。当一方设备的接收缓冲区即将满或已满时,可通过RTS信号向发送方发出暂停发送数据的请求。同样,当接收缓冲区准备好接收数据时,通过CTS信号通知发送方可以继续发送数据。 6. 模式配置:AT91RM9200的串行端口支持多种工作模式,包括正常模式、硬件流控制模式等。在配置过程中,需要根据应用场景选择合适的模式。 7. 错误处理:串行通信中的错误处理同样重要。AT91RM9200提供了多种错误检测机制,包括帧错误、溢出错误和校验错误等。在初始化和通信过程中,开发者需要配置错误处理机制,确保数据传输的准确性。 8. 测试和调试:在完成配置之后,通过编写测试程序并进行通信测试,以验证串行端口的配置是否正确。调试过程中可能会利用串口打印信息来分析和定位问题。 考虑到实际开发中可能遇到的问题和变数,开发者需要仔细阅读AT91RM9200的技术手册和开发指南来确保正确配置。技术手册中提供了详细的信息,包括寄存器的详细描述和配置示例,这对于正确配置串行端口至关重要。 总结来说,AT91RM9200的串行端口配置是实现微控制器与其他设备进行数据交换的基础,开发者需要根据硬件设计和通信需求来精确设置。正确配置的串行端口可以确保嵌入式系统的高效稳定运行。

相关推荐

filetype

/*************************************************************************** * @file hw_timer.h * @brief This file contains all the macros for bsp_timer.c & bsp_timer.h. * **************************************************************************** * @attention * * Created on: 2025-07-18 * Author: YL Monitor Software group * **************************************************************************** * @description * * 定时器的硬件资源映射 * 定时器中断服务,用于高频执行事件任务的服务入口 * ****************************************************************************/ #ifndef __HW_TIMER_H_ #define __HW_TIMER_H_ #ifdef __cplusplus extern "C" { #endif /************************ Includes *************************/ /************************ Exportd types ********************/ /************************ Exportd constants ****************/ /************************ Exportd macros *******************/ /* HMI CAN timer 硬件资源映射*/ #define HW_TIMER TIM4 /* APB1 Timer Clock 72MHz */ #define HW_TIMER_RCC_CLK RCC_APB1Periph_TIM4 #define HW_TIMER_ClockCmd RCC_APB1PeriphClockCmd #define HW_TIMER_PRESCALER 7199 //((uint16_t) ((SystemCoreClock / 1000) - 1))//1ms #define HW_TIMER_PERIOD 9 #define HW_TIMER_IRQn TIM4_IRQn #define HW_TIMER_PreemptionPriority 0 #define HW_TIMER_IRQHandler TIM4_IRQHandler /************************ Exportd variables ****************/ /************************ Exportd Functions ****************/ /************************************************************ * @funName : BSP_HwInitHwTimer * @Input : NULL * @Description : 定时器硬件资源初始化 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-18 *************************************************************/ extern void BSP_HwInitHwTimer(void); extern void Main_Loop_Process(void); #ifdef __cplusplus } #endif #endif /* __HW_TIMER_H_ */ /************************ End of file *************************/ /*************************************************************************** * @file bsp_timer.c * @brief **************************************************************************** * @attention * Created on: 2025-07-18 * Author: YL Monitor Software group **************************************************************************** * @description ****************************************************************************/ /************************ Includes *************************/ #include "main.h" /************************ Private macros *************************/ /************************ Private types **************************/ /*********************** Private constants ***********************/ /************************ Private variables **********************/ /************************ Functions ******************************/ // 发送数据缓冲区(50字节,用于50ms发送阶段) uint8_t g_send_buffer[50] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31}; // 状态变量 typedef enum { SEND_PHASE, // 发送阶段(50ms) DELAY_PHASE // 延时阶段(200ms) } WorkPhase; static WorkPhase current_phase = SEND_PHASE; // 当前阶段,初始为发送阶段 static uint8_t send_index = 0; // 发送字节索引(0-49) static uint8_t delay_counter = 0; // 延时计数器(0-199,对应200ms) static uint8_t timer1ms_flag = 0; // 1ms定时标志 /************************************************************ * @funName : BSP_HwInitHwTimer * @Input : NULL * @Description : 定时器硬件资源初始化 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-18 *************************************************************/ void BSP_HwInitHwTimer(void) { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; NVIC_InitTypeDef NVIC_InitStructure; /* HMI CAN TIM clock enable */ HW_TIMER_ClockCmd(HW_TIMER_RCC_CLK, ENABLE); TIM_InternalClockConfig(HW_TIMER); /* Time base configuration */ TIM_TimeBaseStructure.TIM_Period = HW_TIMER_PERIOD; TIM_TimeBaseStructure.TIM_Prescaler = HW_TIMER_PRESCALER; TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(HW_TIMER, &TIM_TimeBaseStructure); /* TIM IT enable */ TIM_ITConfig(HW_TIMER, TIM_IT_Update, ENABLE); /* Enable the HMI CAN TIM global Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = HW_TIMER_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 4;//HW_TIMER_PreemptionPriority; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;//0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); /* HMI CAN TIM enable counter */ TIM_Cmd(HW_TIMER, ENABLE); } /************************************************************ * @funName : HW_TIMER_IRQHandler * @Input : NULL * @Description : TIM7 中断函数 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025/3/22 *************************************************************/ void HW_TIMER_IRQHandler(void) { if(TIM_GetITStatus(HW_TIMER, TIM_IT_Update)==SET) { /* 清除标志位 */ TIM_ClearITPendingBit(HW_TIMER, TIM_IT_Update); timer1ms_flag = 1; } } /** * @brief 主循环处理函数,根据当前阶段执行对应逻辑 */ void Main_Loop_Process(void) { if (timer1ms_flag) { // 检测到1ms定时 timer1ms_flag = 0; // 清零标志 switch (current_phase) { case SEND_PHASE: // 发送当前索引的字节 BSP_Send2Serial1(&g_send_buffer[send_index], 1); send_index++; // 发送完50字节后,切换到延时阶段 if (send_index >= 50) { send_index = 0; // 重置发送索引 current_phase = DELAY_PHASE; // 切换到延时阶段 delay_counter = 0; // 重置延时计数器 } break; case DELAY_PHASE: delay_counter++; // 延时200ms后,切换回发送阶段 if (delay_counter >= 200) { current_phase = SEND_PHASE; // 切换到发送阶段 delay_counter = 0; // 重置延时计数器 } break; default: current_phase = SEND_PHASE; // 异常状态重置 delay_counter=0; send_index=0; break; } } } /************************ End of file *************************/ /*************************************************************************** * @file hw_serial1.h * @brief This file contains all the macros for bsp_serial1.c & bsp_serial1.h. * **************************************************************************** * @attention * * Created on: 2025-03-18 * Author: YL Monitor Software group * **************************************************************************** * @description * * 串行通信1(与功率部件1内部通信)的硬件资源映射 * ****************************************************************************/ #ifndef __HW_SERIAL1_H_ #define __HW_SERIAL1_H_ #ifdef __cplusplus extern "C" { #endif /************************ Includes *************************/ #include "main.h" /************************ Exportd types ********************/ /************************ Exportd constants ****************/ /************************ Exportd macros *******************/ /* 串行通信1 波特率 */ #define SERIAL1_BAUD_RATE 115200 /* 串口1硬件资源映射 */ #define SERIAL1 USART3 #define SERIAL1_IRQn USART3_IRQn #define SERIAL1_PreemptionPriority 6 #define SERIAL1_IRQHandler USART3_IRQHandler /****************Tx****************/ #define SERIAL1_TX_PORT GPIOB #define SERIAL1_TX_PIN GPIO_Pin_10 /****************Rx****************/ #define SERIAL1_RX_PORT GPIOB #define SERIAL1_RX_PIN GPIO_Pin_11 #define SERIAL1_CLK RCC_APB1Periph_USART3 //USART1 #define SERIAL1_ClockCmd RCC_APB1PeriphClockCmd //USART1时钟 #define SERIAL1_DMA_CLK RCC_AHBPeriph_DMA1 //DMA1 #define SERIAL1_DMA_ClockCmd RCC_AHBPeriphClockCmd //DMA1时钟 /* RM0008 Table 78. Summary of DMA1 requests for each channel */ #define SERIAL1_DMATx_Channel DMA1_Channel2 #define SERIAL1_DMATx_IT_TC DMA1_IT_TC2 #define SERIAL1_DMATx_FLAG DMA1_FLAG_GL2|DMA1_FLAG_TC2|DMA1_FLAG_HT2|DMA1_FLAG_TE2 #define SERIAL1_DMATx_PreemptionPriority 7 #define SERIAL1_DMATx_IRQn DMA1_Channel2_IRQn #define SERIAL1_DMATx_IRQHandler DMA1_Channel2_IRQHandler /* RM0008 Table 78. Summary of DMA1 requests for each channel -- RM0008 * 表78每个通道的DMA1请求摘要*/ #define SERIAL1_DMARx_Channel DMA1_Channel3 #define SERIAL1_DMARx_IT_TC DMA1_IT_TC3 #define SERIAL1_DMARx_FLAG DMA1_FLAG_GL3|DMA1_FLAG_TC3|DMA1_FLAG_HT3|DMA1_FLAG_TE3 #define SERIAL1_DMARx_PreemptionPriority 8 #define SERIAL1_DMARx_IRQn DMA1_Channel3_IRQn #endif /************************ Exportd variables ****************/ /************************ Exportd Functions ****************/ #ifdef __cplusplus } #endif /* __HW_SERIAL1_H_ */ /********************************************************* * @file bsp_serial1.c * Created on: 2025-07-22 * Author: YL Monitor Software group *********************************************************/ /************************ Includes *************************/ #include "main.h" /************************ Private macros *************************/ /************************ Private types **************************/ /*********************** Private constants ***********************/ /************************ Functions ******************************/ /********************* DMA收发缓冲区大小定义*********************/ /* 串行通信 DMA发送缓冲区大小 */ #define SERIAL_TX_BUFF_SIZE 64 /* 串行通信 DMA接收缓冲区大小 */ #define SERIAL_RX_BUFF_SIZE 64 /************************ Private variables **********************/ /* 串行通信 DMA发送缓存 */ static uint8_t DMA_TxBuff[SERIAL_TX_BUFF_SIZE] = {0}; /* 串行通信 DMA接收缓存 */ static uint8_t DMA_RxBuff[SERIAL_RX_BUFF_SIZE] = {0}; /* 串行通信 接收数据队列 */ static QueueHandle_t queueRecvData = NULL; static SemaphoreHandle_t mutexSerialSend = NULL; /* 串行通信1 数据接收离线状态时间计数器 * 在硬件定时器中进行累加 * DMA接收中断中清零 * 当离线超过5ms,接收结束,或者设备离线,可以进行数据转发至上位机*/ /************************ Functions ******************************/ /**************************************** * @funName : BSP_HwInitSerial1 * @Description : 串行通信口1 硬件资源初始化 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 ********************************************/ void BSP_HwInitSerial1(void) { GPIO_InitTypeDef GPIO_InitStructure ={0}; USART_InitTypeDef USART_InitStructure ={0}; NVIC_InitTypeDef NVIC_InitStructure ={0}; DMA_InitTypeDef DMA_InitStructure ={0}; /* 开启所有GPIO 时钟 */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //USART1开时钟 SERIAL1_ClockCmd(SERIAL1_CLK, ENABLE); // 使能DMA1时钟 SERIAL1_DMA_ClockCmd(SERIAL1_DMA_CLK,ENABLE); /****************Tx****************/ GPIO_InitStructure.GPIO_Pin = SERIAL1_TX_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_Init(SERIAL1_TX_PORT, &GPIO_InitStructure); /****************Rx****************/ GPIO_InitStructure.GPIO_Pin = SERIAL1_RX_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; //上拉输入 GPIO_Init(SERIAL1_RX_PORT, &GPIO_InitStructure); /* 配置USART1 */ USART_DeInit(SERIAL1); USART_InitStructure.USART_BaudRate = SERIAL1_BAUD_RATE; //波特率 USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(SERIAL1, &USART_InitStructure); NVIC_InitStructure.NVIC_IRQChannel = SERIAL1_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = SERIAL1_PreemptionPriority; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); // USART_ITConfig(SERIAL1, USART_IT_IDLE, ENABLE); //启用的USART1中断 USART_ITConfig(SERIAL1, USART_IT_RXNE, ENABLE); /* DMA发送初始化 */ DMA_DeInit(SERIAL1_DMATx_Channel); DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)(&SERIAL1->DR); DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)DMA_TxBuff; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST; DMA_InitStructure.DMA_BufferSize = SERIAL_TX_BUFF_SIZE; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;//DMA_Mode_Circular DMA_Mode_Normal DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(SERIAL1_DMATx_Channel, &DMA_InitStructure); /* DMA发送中断优先级设置 */ NVIC_InitStructure.NVIC_IRQChannel = SERIAL1_DMATx_IRQn ; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = SERIAL1_DMATx_PreemptionPriority; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); DMA_ITConfig(SERIAL1_DMATx_Channel, DMA_IT_TC, ENABLE); USART_DMACmd(SERIAL1, USART_DMAReq_Tx, ENABLE); DMA_Cmd(SERIAL1_DMATx_Channel, DISABLE); /* DMA接收初始化 */ DMA_DeInit(SERIAL1_DMARx_Channel); DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)(&SERIAL1->DR); DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)DMA_RxBuff; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = SERIAL_RX_BUFF_SIZE; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;//DMA_Mode_Circular DMA_Mode_Normal DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(SERIAL1_DMARx_Channel, &DMA_InitStructure); /* DMA接收中断优先级设置 */ NVIC_InitStructure.NVIC_IRQChannel = SERIAL1_DMARx_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = SERIAL1_DMARx_PreemptionPriority; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); DMA_ITConfig(SERIAL1_DMARx_Channel, DMA_IT_TC, DISABLE); DMA_Cmd(SERIAL1_DMARx_Channel, ENABLE); USART_DMACmd(SERIAL1, USART_DMAReq_Rx, ENABLE); //启用USAR1T1外设 USART_Cmd(SERIAL1, ENABLE); } /********************************************* * @funName : BSP_SwInitSerial1 * @Description : 串行通信口1 软件资源初始化 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 ************************************************/ void BSP_SwInitSerial1(void) { // 创建接收队列(存储uint8_t类型数据) if(NULL == queueRecvData) { queueRecvData = xQueueCreate(SERIAL_DATA_QUEUE_SIZE, sizeof(uint8_t)); /* 数据接收队列创建失败 */ if(NULL == queueRecvData) { } } // 创建发送互斥锁 if(NULL == mutexSerialSend) { mutexSerialSend = xSemaphoreCreateBinary(); // mutexSerialSend = xSemaphoreCreateMutex(); /* 数据发送互斥量创建失败 */ if(NULL == mutexSerialSend) { } else { /* 释放数据发送互斥量 */ xSemaphoreGive(mutexSerialSend); } } } /****************************************** * @funName : SERIAL1_IRQHandler * @Description : 串行通信口1 中断,用于处理空闲接收中断, * 获取DMA接收的数据,并缓存至数据队列 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 **************************************************/ void SERIAL1_IRQHandler(void) { if(USART_GetITStatus(SERIAL1, USART_IT_RXNE) != RESET)//接收数据寄存器不空中断 { uint8_t byte = 0; uint16_t i = 0, rlen = 0; portBASE_TYPE xRecvWoken = pdFALSE; byte = USART_ReceiveData(SERIAL1); rlen = SERIAL_RX_BUFF_SIZE - DMA_GetCurrDataCounter(SERIAL1_DMARx_Channel); DMA_Cmd(SERIAL1_DMARx_Channel, DISABLE); DMA_ClearFlag(SERIAL1_DMATx_FLAG); if (rlen > 0 && queueRecvData != NULL) { // 将DMA接收缓冲区数据存入队列 for (i = 0; i < rlen; i++) { // xQueueSendFromISR(queueRecvData, &DMA_RxBuff[i], NULL); if(errQUEUE_FULL == xQueueSendFromISR(queueRecvData, &DMA_RxBuff[i], &xRecvWoken)) { break; } } } USART_ClearITPendingBit(SERIAL1, USART_IT_IDLE); DMA_SetCurrDataCounter(SERIAL1_DMARx_Channel, SERIAL_RX_BUFF_SIZE); DMA_Cmd(SERIAL1_DMARx_Channel, ENABLE); } /* 全部数据发送完成,产生该标记 */ if (USART_GetITStatus(SERIAL1, USART_IT_TC) != RESET) //检查USART3中断是否发生 { USART_ClearITPendingBit(SERIAL1, USART_IT_TC); //清除USART3的中断挂起位-传输完全中断 } } /***************************************** * @funName : SERIAL1_DMATx_IRQHandler * @Description : 串行通信口1 DMA 发送中断 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 *******************************************/ void SERIAL1_DMATx_IRQHandler(void) { portBASE_TYPE xSendWoken = pdFALSE; if(RESET != DMA_GetITStatus(SERIAL1_DMATx_IT_TC)) { /* 关闭 DMA */ DMA_Cmd(SERIAL1_DMATx_Channel, DISABLE); /* 清除完成标记 */ DMA_ClearITPendingBit(SERIAL1_DMATx_IT_TC); /* 清除数据长度 */ DMA_SetCurrDataCounter(SERIAL1_DMATx_Channel, 0); USART_ITConfig(SERIAL1, USART_IT_TC, DISABLE); if(NULL != mutexSerialSend) { /* 释放 OS 数据发送权限 */ xSemaphoreGiveFromISR(mutexSerialSend, &xSendWoken); portYIELD_FROM_ISR(xSendWoken); } } } /********************************************** * @funName : BSP_Send2Serial1 * @Description : 串行通信口1 DMA发送启动 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 **********************************************/ void BSP_Send2Serial1(uint8_t* sbuf, const uint16_t slen) { uint16_t len = slen; if(len == 0 ||NULL == sbuf) { return; } /******************************************** *获取OS 数据发送权限 * <DMA发送完成后,在串行通信中断服务中释放> *********************************************/ if(NULL != mutexSerialSend) { xSemaphoreTake(mutexSerialSend, portMAX_DELAY); } else { //检查是否设置了DMA1通道标志 DMA1_IT_TC2 while(!DMA_GetFlagStatus(SERIAL1_DMATx_IT_TC)); } /*发送DMA流的地址不自增-不使用*/ //SERIAL1_DMATx_Channel->CCR |= (1 << 10); /*设置接收和发送的内存地址*/ SERIAL1_DMATx_Channel->CMAR = (uint32_t)sbuf; //设置当前DMA1通道传输中的数据单元数 DMA_SetCurrDataCounter(SERIAL1_DMATx_Channel, len);//DMA1_Channel4 //启用DMA1通道4 DMA_Cmd(SERIAL1_DMATx_Channel, ENABLE); //启用USART1的DMA接口 USART DMA传输请求 USART_DMACmd(SERIAL1, USART_DMAReq_Tx, ENABLE); } /******************************************** * @funName : BSP_Recv4Serial1 * @Description : 从串口1接收数据队列获取数据 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025-07-22 **********************************************/ void BSP_Recv4Serial1(uint8_t * rbuf, uint16_t* rlen) { uint16_t iCnt = 0; *rlen = 0; if(NULL == queueRecvData || NULL == rbuf) { return; } for(iCnt = 0; iCnt < SERIAL_DATA_QUEUE_SIZE; ++iCnt){ if(pdFALSE == xQueueReceive(queueRecvData, &rbuf[iCnt], 0)){ break; } } *rlen = iCnt; } /************************ End of file *************************/ /*************************************************************************** * @file main.c * @attention * Created on: 2025-03-18 * Author: YL Monitor Software group **************************************************************************** * @description ****************************************************************************/ /************************ Includes ********************************/ #include "main.h" /************************ Private types ***************************/ /************************ Private constants ***********************/ /************************ Private macros **************************/ /* 任务优先级定义 */ #define TASK_SCI1_RECV_PRIORITY (tskIDLE_PRIORITY + 7) //任务sci1接收优先级 #define TASK_SCI1_RECV_STACK_SIZE 128 //任务sci1接收堆栈大小 /************************ Private variables ***********************/ /************************ Functions *******************************/ /****************************** * @funName : main * @Description : 系统主函数,完成软硬件初始化 * 产品业务相关任务创建,并启动任务调度 * @Athor : YL Software Group * @Version : V0.0.0 * @Data : 2025/3/27 * ***********************************/ int main( void ) { /* 功率部件1的串行通信驱动-DMA1 */ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); /* Flash1的spi驱动 */ BSP_HwInitFlash1SPI(); //Flash1 存储器 SPI通信接口初始化 /* 功率部件1的串行通信驱动-DMA1 */ BSP_HwInitSerial1(); //串行通信口1 硬件资源初始化-DMA1 BSP_HwInitHwTimer(); //定时器硬件资源初始化 //进入临界区时,首先关闭中断,当退出所有嵌套的临界区后再使能中断 taskENTER_CRITICAL(); /*********** 初始化各个模块使用到的OS相关资源 *********************/ BSP_SwInitSerial1(); /********************* 创建产品业务相关任务 ***********************/ //功率部件1(DSP SCI)通信信息流接收处理任务-USART3-DMA1 /* 功率部件1信息流监听任务 */ //任务创建(任务功能) xTaskCreate((TaskFunction_t ) vTask_SCI1RecvPro, (char* ) "vTask_SCI1RecvPro", (uint16_t ) TASK_SCI1_RECV_STACK_SIZE, (void * ) NULL, (UBaseType_t ) TASK_SCI1_RECV_PRIORITY, //任务控制块-空 (TaskHandle_t* ) NULL); /* 退出任务 */ taskEXIT_CRITICAL(); /* Start the scheduler. */ vTaskStartScheduler(); return 0; } /************************ End of file *************************/ 用keil530版本软件编写STM32F105VCT6芯片单片机中,APB2=72MHZ,APB1=36HZ,针对以上程序,当S-TLINK未连接时,BSP_Send2Serial1发送出来的数据乱码,深度分析程序,从keil5软件和代码中给出有效的解决办法,用标准库写出需要修改的代码和注释

filetype

Done! You can now compile ESP-IDF projects. Go to the project directory and run: idf.py build D:\Espressif\frameworks\esp-idf-v5.5.1>cd D:\ESP32\xiaozhi-esp32-main D:\ESP32\xiaozhi-esp32-main>idf.py build Executing action: all (aliases: build) Running cmake in directory D:\ESP32\xiaozhi-esp32-main\build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=D:\Espressif\python_env\idf5.5_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 D:\ESP32\xiaozhi-esp32-main"... -- IDF_TARGET not set, using default target: esp32 -- Found Git: D:/Espressif/tools/idf-git/2.44.0/cmd/git.exe (found version "2.44.0.windows.1") -- Minimal build - OFF -- ccache will be used for faster recompilation -- The C compiler identification is GNU 14.2.0 -- The CXX compiler identification is GNU 14.2.0 -- The ASM compiler identification is GNU -- Found assembler: D:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: D:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: D:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32 NOTICE: Dependencies lock doesn't exist, solving dependencies. NOTICE: Skipping optional dependency: espressif/esp_lcd_st7701 NOTICE: Skipping optional dependency: espressif/esp_video NOTICE: Skipping optional dependency: wvirgil123/sscma_client NOTICE: Skipping optional dependency: waveshare/esp_lcd_jd9365_10_1 NOTICE: Skipping optional dependency: waveshare/esp_lcd_st7703 NOTICE: Skipping optional dependency: espressif/esp_lcd_ili9881c NOTICE: Skipping optional dependency: espressif/esp_lcd_ek79007 NOTICE: Skipping optional dependency: espressif/esp_hosted NOTICE: Skipping optional dependency: espressif/esp_wifi_remote NOTICE: Skipping optional dependency: espfriends/servo_dog_ctrl NOTICE: Skipping optional dependency: llgok/cpp_bus_driver .................................................................NOTICE: Updating lock file at D:\ESP32\xiaozhi-esp32-main\dependencies.lock NOTICE: Processing 43 dependencies: NOTICE: [1/43] 78/esp-ml307 (3.3.6) NOTICE: [2/43] 78/esp-opus (1.0.5) NOTICE: [3/43] 78/esp-opus-encoder (2.4.1) NOTICE: [4/43] 78/esp-wifi-connect (2.6.0) NOTICE: [5/43] 78/esp_lcd_nv3023 (1.0.0) NOTICE: [6/43] 78/xiaozhi-fonts (1.5.3) NOTICE: [7/43] espressif/adc_battery_estimation (0.2.1) NOTICE: [8/43] espressif/adc_mic (0.2.1) NOTICE: [9/43] espressif/button (4.1.4) NOTICE: [10/43] espressif/cmake_utilities (0.5.3) NOTICE: [11/43] espressif/dl_fft (0.3.1) NOTICE: [12/43] espressif/esp-dsp (1.6.0) NOTICE: [13/43] espressif/esp-sr (2.1.5) NOTICE: [14/43] espressif/esp_codec_dev (1.4.0) NOTICE: [15/43] espressif/esp_io_expander (1.0.1) NOTICE: [16/43] espressif/esp_io_expander_tca9554 (2.0.0) NOTICE: [17/43] espressif/esp_io_expander_tca95xx_16bit (2.0.1) NOTICE: [18/43] espressif/esp_lcd_axs15231b (1.0.1) NOTICE: [19/43] espressif/esp_lcd_gc9a01 (2.0.1) NOTICE: [20/43] espressif/esp_lcd_ili9341 (1.2.0) NOTICE: [21/43] espressif/esp_lcd_panel_io_additions (1.0.1) NOTICE: [22/43] espressif/esp_lcd_spd2010 (1.0.2) NOTICE: [23/43] espressif/esp_lcd_st77916 (1.0.1) NOTICE: [24/43] espressif/esp_lcd_st7796 (1.3.5) NOTICE: [25/43] espressif/esp_lcd_touch (1.1.2) NOTICE: [26/43] espressif/esp_lcd_touch_cst816s (1.1.0) NOTICE: [27/43] espressif/esp_lcd_touch_ft5x06 (1.0.7) NOTICE: [28/43] espressif/esp_lcd_touch_gt1151 (1.0.5~2) NOTICE: [29/43] espressif/esp_lcd_touch_gt911 (1.1.3) NOTICE: [30/43] espressif/esp_lvgl_port (2.6.2) NOTICE: [31/43] espressif/esp_mmap_assets (1.3.2) NOTICE: [32/43] espressif/esp_new_jpeg (0.6.1) NOTICE: [33/43] espressif/freetype (2.13.3~1) NOTICE: [34/43] espressif/knob (1.0.1) NOTICE: [35/43] espressif/led_strip (3.0.1~1) NOTICE: [36/43] espressif2022/esp_emote_gfx (1.2.0~1) NOTICE: [37/43] espressif2022/image_player (1.1.0~1) NOTICE: [38/43] lvgl/lvgl (9.3.0) NOTICE: [39/43] tny-robotics/sh1106-esp-idf (1.0.0) NOTICE: [40/43] txp666/otto-emoji-gif-component (1.0.2) NOTICE: [41/43] waveshare/esp_lcd_sh8601 (1.0.2) NOTICE: [42/43] waveshare/esp_lcd_touch_cst9217 (1.0.3) NOTICE: [43/43] idf (5.5.1) NOTICE: Skipping optional dependency: espressif/esp_lcd_st7701 NOTICE: Skipping optional dependency: espressif/esp_video NOTICE: Skipping optional dependency: wvirgil123/sscma_client NOTICE: Skipping optional dependency: waveshare/esp_lcd_jd9365_10_1 NOTICE: Skipping optional dependency: waveshare/esp_lcd_st7703 NOTICE: Skipping optional dependency: espressif/esp_lcd_ili9881c NOTICE: Skipping optional dependency: espressif/esp_lcd_ek79007 NOTICE: Skipping optional dependency: espressif/esp_hosted NOTICE: Skipping optional dependency: espressif/esp_wifi_remote NOTICE: Skipping optional dependency: espfriends/servo_dog_ctrl NOTICE: Skipping optional dependency: llgok/cpp_bus_driver -- Project sdkconfig file D:/ESP32/xiaozhi-esp32-main/sdkconfig Loading defaults file D:/ESP32/xiaozhi-esp32-main/sdkconfig.defaults... D:/ESP32/xiaozhi-esp32-main/sdkconfig.defaults:32 CONFIG_NEWLIB_NANO_FORMAT was replaced with CONFIG_LIBC_NEWLIB_NANO_FORMAT Loading defaults file D:/ESP32/xiaozhi-esp32-main/sdkconfig.defaults.esp32... -- Compiler supported targets: xtensa-esp-elf -- Found Python3: D:/Espressif/python_env/idf5.5_py3.11_env/Scripts/python.exe (found version "3.11.2") found components: Interpreter -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success -- USING O3 -- App "xiaozhi" version: 2.0.3 -- Adding linker script D:/ESP32/xiaozhi-esp32-main/build/esp-idf/esp_system/ld/memory.ld -- Adding linker script D:/ESP32/xiaozhi-esp32-main/build/esp-idf/esp_system/ld/sections.ld.in -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.api.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.libc-funcs.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom/esp32/ld/esp32.rom.newlib-reent-funcs.ld -- Adding linker script D:/Espressif/frameworks/esp-idf-v5.5.1/components/soc/esp32/ld/esp32.peripherals.ld -- ESP_LCD_NV3023: 1.0.0 -- ADC_BATTERY_ESTIMATION: 0.2.1 -- ADC_MIC: 0.2.1 -- BUTTON: 4.1.4 -- ESP_LCD_AXS15231B: 1.0.1 -- ESP_LCD_GC9A01: 2.0.1 -- ESP_LCD_ILI9341: 1.2.0 -- ESP_LCD_PANEL_IO_ADDITIONS: 1.0.1 -- ESP_LCD_SPD2010: 1.0.2 -- ESP_LCD_ST77916: 1.0.1 -- ESP_LCD_ST7796: 1.3.5 -- LVGL version: 9.3.0 -- ESP_MMAP_ASSETS: 1.3.2 -- KNOB: 1.0.1 -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Otto Emoji GIF Component: -- Found 7 GIF source files -- Include directory: D:/ESP32/xiaozhi-esp32-main/managed_components/txp666__otto-emoji-gif-component/include -- ESP_LCD_SH8601: 1.0.2 -- Default assets build configured: D:/ESP32/xiaozhi-esp32-main/build/generated_assets.bin -- Generated default assets flash configured: D:/ESP32/xiaozhi-esp32-main/build/generated_assets.bin -> assets partition -- Component idf::main will be linked with -Wl,--whole-archive -- Components: 78__esp-ml307 78__esp-opus 78__esp-opus-encoder 78__esp-wifi-connect 78__esp_lcd_nv3023 78__xiaozhi-fonts app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_driver_ana_cmpr esp_driver_bitscrambler esp_driver_cam esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_isp esp_driver_jpeg esp_driver_ledc esp_driver_mcpwm esp_driver_parlio esp_driver_pcnt esp_driver_ppa esp_driver_rmt esp_driver_sdio esp_driver_sdm esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_twai esp_driver_uart esp_driver_usb_serial_jtag esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_security esp_system esp_timer esp_vfs_console esp_wifi espcoredump espressif2022__esp_emote_gfx espressif2022__image_player espressif__adc_battery_estimation espressif__adc_mic espressif__button espressif__cmake_utilities espressif__dl_fft espressif__esp-dsp espressif__esp-sr espressif__esp_codec_dev espressif__esp_io_expander espressif__esp_io_expander_tca9554 espressif__esp_io_expander_tca95xx_16bit espressif__esp_lcd_axs15231b espressif__esp_lcd_gc9a01 espressif__esp_lcd_ili9341 espressif__esp_lcd_panel_io_additions espressif__esp_lcd_spd2010 espressif__esp_lcd_st77916 espressif__esp_lcd_st7796 espressif__esp_lcd_touch espressif__esp_lcd_touch_cst816s espressif__esp_lcd_touch_ft5x06 espressif__esp_lcd_touch_gt1151 espressif__esp_lcd_touch_gt911 espressif__esp_lvgl_port espressif__esp_mmap_assets espressif__esp_new_jpeg espressif__freetype espressif__knob espressif__led_strip esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lvgl__lvgl lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread rt sdmmc soc spi_flash spiffs tcp_transport tny-robotics__sh1106-esp-idf txp666__otto-emoji-gif-component ulp unity usb vfs waveshare__esp_lcd_sh8601 waveshare__esp_lcd_touch_cst9217 wear_levelling wifi_provisioning wpa_supplicant xtensa -- Component paths: D:/ESP32/xiaozhi-esp32-main/managed_components/78__esp-ml307 D:/ESP32/xiaozhi-esp32-main/managed_components/78__esp-opus D:/ESP32/xiaozhi-esp32-main/managed_components/78__esp-opus-encoder D:/ESP32/xiaozhi-esp32-main/managed_components/78__esp-wifi-connect D:/ESP32/xiaozhi-esp32-main/managed_components/78__esp_lcd_nv3023 D:/ESP32/xiaozhi-esp32-main/managed_components/78__xiaozhi-fonts D:/Espressif/frameworks/esp-idf-v5.5.1/components/app_trace D:/Espressif/frameworks/esp-idf-v5.5.1/components/app_update D:/Espressif/frameworks/esp-idf-v5.5.1/components/bootloader D:/Espressif/frameworks/esp-idf-v5.5.1/components/bootloader_support D:/Espressif/frameworks/esp-idf-v5.5.1/components/bt D:/Espressif/frameworks/esp-idf-v5.5.1/components/cmock D:/Espressif/frameworks/esp-idf-v5.5.1/components/console D:/Espressif/frameworks/esp-idf-v5.5.1/components/cxx D:/Espressif/frameworks/esp-idf-v5.5.1/components/driver D:/Espressif/frameworks/esp-idf-v5.5.1/components/efuse D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp-tls D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_adc D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_app_format D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_bootloader_format D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_coex D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_common D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_ana_cmpr D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_bitscrambler D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_cam D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_dac D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_gpio D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_gptimer D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_i2c D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_i2s D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_isp D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_jpeg D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_ledc D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_mcpwm D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_parlio D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_pcnt D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_ppa D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_rmt D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_sdio D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_sdm D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_sdmmc D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_sdspi D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_spi D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_touch_sens D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_tsens D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_twai D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_uart D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_driver_usb_serial_jtag D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_eth D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_event D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_gdbstub D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_hid D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_http_client D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_http_server D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_https_ota D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_https_server D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_hw_support D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_lcd D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_local_ctrl D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_mm D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_netif D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_netif_stack D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_partition D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_phy D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_pm D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_psram D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_ringbuf D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_rom D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_security D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_system D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_timer D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_vfs_console D:/Espressif/frameworks/esp-idf-v5.5.1/components/esp_wifi D:/Espressif/frameworks/esp-idf-v5.5.1/components/espcoredump D:/ESP32/xiaozhi-esp32-main/managed_components/espressif2022__esp_emote_gfx D:/ESP32/xiaozhi-esp32-main/managed_components/espressif2022__image_player D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__adc_battery_estimation D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__adc_mic D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__button D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__cmake_utilities D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__dl_fft D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp-dsp D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp-sr D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_codec_dev D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_io_expander D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_io_expander_tca9554 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_io_expander_tca95xx_16bit D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_axs15231b D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_gc9a01 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_ili9341 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_panel_io_additions D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_spd2010 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_st77916 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_st7796 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_touch D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_touch_cst816s D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_touch_ft5x06 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_touch_gt1151 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lcd_touch_gt911 D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_lvgl_port D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_mmap_assets D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__esp_new_jpeg D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__freetype D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__knob D:/ESP32/xiaozhi-esp32-main/managed_components/espressif__led_strip D:/Espressif/frameworks/esp-idf-v5.5.1/components/esptool_py D:/Espressif/frameworks/esp-idf-v5.5.1/components/fatfs D:/Espressif/frameworks/esp-idf-v5.5.1/components/freertos D:/Espressif/frameworks/esp-idf-v5.5.1/components/hal D:/Espressif/frameworks/esp-idf-v5.5.1/components/heap D:/Espressif/frameworks/esp-idf-v5.5.1/components/http_parser D:/Espressif/frameworks/esp-idf-v5.5.1/components/idf_test D:/Espressif/frameworks/esp-idf-v5.5.1/components/ieee802154 D:/Espressif/frameworks/esp-idf-v5.5.1/components/json D:/Espressif/frameworks/esp-idf-v5.5.1/components/log D:/ESP32/xiaozhi-esp32-main/managed_components/lvgl__lvgl D:/Espressif/frameworks/esp-idf-v5.5.1/components/lwip D:/ESP32/xiaozhi-esp32-main/main D:/Espressif/frameworks/esp-idf-v5.5.1/components/mbedtls D:/Espressif/frameworks/esp-idf-v5.5.1/components/mqtt D:/Espressif/frameworks/esp-idf-v5.5.1/components/newlib D:/Espressif/frameworks/esp-idf-v5.5.1/components/nvs_flash D:/Espressif/frameworks/esp-idf-v5.5.1/components/nvs_sec_provider D:/Espressif/frameworks/esp-idf-v5.5.1/components/openthread D:/Espressif/frameworks/esp-idf-v5.5.1/components/partition_table D:/Espressif/frameworks/esp-idf-v5.5.1/components/perfmon D:/Espressif/frameworks/esp-idf-v5.5.1/components/protobuf-c D:/Espressif/frameworks/esp-idf-v5.5.1/components/protocomm D:/Espressif/frameworks/esp-idf-v5.5.1/components/pthread D:/Espressif/frameworks/esp-idf-v5.5.1/components/rt D:/Espressif/frameworks/esp-idf-v5.5.1/components/sdmmc D:/Espressif/frameworks/esp-idf-v5.5.1/components/soc D:/Espressif/frameworks/esp-idf-v5.5.1/components/spi_flash D:/Espressif/frameworks/esp-idf-v5.5.1/components/spiffs D:/Espressif/frameworks/esp-idf-v5.5.1/components/tcp_transport D:/ESP32/xiaozhi-esp32-main/managed_components/tny-robotics__sh1106-esp-idf D:/ESP32/xiaozhi-esp32-main/managed_components/txp666__otto-emoji-gif-component D:/Espressif/frameworks/esp-idf-v5.5.1/components/ulp D:/Espressif/frameworks/esp-idf-v5.5.1/components/unity D:/Espressif/frameworks/esp-idf-v5.5.1/components/usb D:/Espressif/frameworks/esp-idf-v5.5.1/components/vfs D:/ESP32/xiaozhi-esp32-main/managed_components/waveshare__esp_lcd_sh8601 D:/ESP32/xiaozhi-esp32-main/managed_components/waveshare__esp_lcd_touch_cst9217 D:/Espressif/frameworks/esp-idf-v5.5.1/components/wear_levelling D:/Espressif/frameworks/esp-idf-v5.5.1/components/wifi_provisioning D:/Espressif/frameworks/esp-idf-v5.5.1/components/wpa_supplicant D:/Espressif/frameworks/esp-idf-v5.5.1/components/xtensa -- Configuring done (64.0s) -- Generating done (1.1s) -- Build files have been written to: D:/ESP32/xiaozhi-esp32-main/build Running ninja in directory D:\ESP32\xiaozhi-esp32-main\build Executing "ninja all"... [5/2165] Generating zh-CN language config Processing language: zh-CN Input file path: D:/ESP32/xiaozhi-esp32-main/main\assets\locales\zh-CN\language.json Output file path: D:/ESP32/xiaozhi-esp32-main/main/assets/lang_config.h Loaded base language en-US with 49 strings Language zh-CN string statistics: - Base language (en-US): 49 strings - User language: 48 strings - Total: 49 strings - Fallback to en-US: 1 strings Language zh-CN sound statistics: - Base language (en-US): 16 sounds - User language: 16 sounds - Common sounds: 5 sounds Successfully generated language config file: D:/ESP32/xiaozhi-esp32-main/main/assets/lang_config.h [6/2165] Building default assets.bin based on configuration Building default assets... sdkconfig: D:/ESP32/xiaozhi-esp32-main/sdkconfig builtin_text_font: font_puhui_14_1 emoji_collection: None output: D:/ESP32/xiaozhi-esp32-main/build/generated_assets.bin Note: Found wakenet models ['wn9_nihaoxiaozhi_tts'] but wake word type is not ESP/AFE, skipping Warning: No assets to build (no SR models, text font, emoji collection, extra files, or custom wake word) Created empty assets.bin: D:/ESP32/xiaozhi-esp32-main/build/generated_assets.bin [7/2165] Generating ../../partition_table/partition-table.bin现在卡住了,怎么办

filetype

这是user_setup.h里的文件,你帮我修改,把完整代码发我// USER DEFINED SETTINGS // Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. // // If this file is edited correctly then all the library example sketches should // run without the need to make any more changes for a particular hardware setup! // Note that some sketches are designed for a particular TFT pixel width/height // User defined information reported by "Read_User_Setup" test & diagnostics example #define USER_SETUP_INFO "User_Setup" // Define to disable all #warnings in library (can be put in User_Setup_Select.h) //#define DISABLE_ALL_LIBRARY_WARNINGS // ################################################################################## // // Section 1. Call up the right driver file and any options for it // // ################################################################################## // Define STM32 to invoke optimised processor support (only for STM32) //#define STM32 // Defining the STM32 board allows the library to optimise the performance // for UNO compatible "MCUfriend" style shields //#define NUCLEO_64_TFT //#define NUCLEO_144_TFT // STM32 8-bit parallel only: // If STN32 Port A or B pins 0-7 are used for 8-bit parallel data bus bits 0-7 // then this will improve rendering performance by a factor of ~8x //#define STM_PORTA_DATA_BUS //#define STM_PORTB_DATA_BUS // Tell the library to use parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT //#defined TFT_PARALLEL_16_BIT // **** 16-bit parallel ONLY for RP2040 processor **** // Display type - only define if RPi display //#define RPI_DISPLAY_TYPE // 20MHz maximum SPI // Only define one driver, the other ones must be commented out #define ILI9341_DRIVER // Generic driver for common displays //#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see https://github.com/Bodmer/TFT_eSPI/issues/1172 //#define ST7735_DRIVER // Define additional parameters below for this display //#define ILI9163_DRIVER // Define additional parameters below for this display //#define S6D02A1_DRIVER //#define RPI_ILI9486_DRIVER // 20MHz maximum SPI //#define HX8357D_DRIVER //#define ILI9481_DRIVER //#define ILI9486_DRIVER //#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high) //#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display //#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display //#define R61581_DRIVER //#define RM68140_DRIVER //#define ST7796_DRIVER //#define SSD1351_DRIVER //#define SSD1963_480_DRIVER //#define SSD1963_800_DRIVER //#define SSD1963_800ALT_DRIVER //#define ILI9225_DRIVER #define GC9A01_DRIVER // Some displays support SPI reads via the MISO pin, other displays have a single // bi-directional SDA pin and the library will try to read this via the MOSI line. // To use the SDA line for reading data from the TFT uncomment the following line: // #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 and GC9A01 display only // For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display // Try ONE option at a time to find the correct colour order for your display // #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue // #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red // For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below // #define M5STACK // For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation // #define TFT_WIDTH 80 // #define TFT_WIDTH 128 // #define TFT_WIDTH 172 // ST7789 172 x 320 // #define TFT_WIDTH 170 // ST7789 170 x 320 // #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320 // #define TFT_HEIGHT 160 // #define TFT_HEIGHT 128 // #define TFT_HEIGHT 240 // ST7789 240 x 240 // #define TFT_HEIGHT 320 // ST7789 240 x 320 // #define TFT_HEIGHT 240 // GC9A01 240 x 240 // For ST7735 ONLY, define the type of display, originally this was based on the // colour of the tab on the screen protector film but this is not always true, so try // out the different options below if the screen does not display graphics correctly, // e.g. colours wrong, mirror images, or stray pixels at the edges. // Comment out ALL BUT ONE of these options for a ST7735 display driver, save this // this User_Setup file, then rebuild and upload the sketch to the board again: // #define ST7735_INITB // #define ST7735_GREENTAB // #define ST7735_GREENTAB2 // #define ST7735_GREENTAB3 // #define ST7735_GREENTAB128 // For 128 x 128 display // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) // #define ST7735_ROBOTLCD // For some RobotLCD Arduino shields (128x160, BGR, https://docs.arduino.cc/retired/getting-started-guides/TFT) // #define ST7735_REDTAB // #define ST7735_BLACKTAB // #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset // If colours are inverted (white shows as black) then uncomment one of the next // 2 lines try both options, one of the options should correct the inversion. // #define TFT_INVERSION_ON // #define TFT_INVERSION_OFF // ################################################################################## // // Section 2. Define the pins that are used to interface with the display here // // ################################################################################## // If a backlight control signal is available then define the TFT_BL pin in Section 2 // below. The backlight will be turned ON when tft.begin() is called, but the library // needs to know if the LEDs are ON with the pin HIGH or LOW. If the LEDs are to be // driven with a PWM signal or turned OFF/ON then this must be handled by the user // sketch. e.g. with digitalWrite(TFT_BL, LOW); // #define TFT_BL 32 // LED back-light control pin // #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW) // We must use hardware SPI, a minimum of 3 GPIO pins is needed. // Typical setup for ESP8266 NodeMCU ESP-12 is : // // Display SDO/MISO to NodeMCU pin D6 (or leave disconnected if not reading TFT) // Display LED to NodeMCU pin VIN (or 5V, see below) // Display SCK to NodeMCU pin D5 // Display SDI/MOSI to NodeMCU pin D7 // Display DC (RS/AO)to NodeMCU pin D3 // Display RESET to NodeMCU pin D4 (or RST, see below) // Display CS to NodeMCU pin D8 (or GND, see below) // Display GND to NodeMCU pin GND (0V) // Display VCC to NodeMCU 5V or 3.3V // // The TFT RESET pin can be connected to the NodeMCU RST pin or 3.3V to free up a control pin // // The DC (Data Command) pin may be labelled AO or RS (Register Select) // // With some displays such as the ILI9341 the TFT CS pin can be connected to GND if no more // SPI devices (e.g. an SD Card) are connected, in this case comment out the #define TFT_CS // line below so it is NOT defined. Other displays such at the ST7735 require the TFT CS pin // to be toggled during setup, so in these cases the TFT_CS line must be defined and connected. // // The NodeMCU D0 pin can be used for RST // // // Note: only some versions of the NodeMCU provide the USB 5V on the VIN pin // If 5V is not available at a pin you can use 3.3V but backlight brightness // will be lower. // ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ###### // For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation /*#define TFT_MISO PIN_D6 // Automatically assigned with ESP8266 if not defined #define TFT_MOSI PIN_D7 // Automatically assigned with ESP8266 if not defined #define TFT_SCLK PIN_D5 // Automatically assigned with ESP8266 if not defined #define TFT_CS PIN_D8 // Chip select control pin D8 #define TFT_DC PIN_D3 // Data Command control pin #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)*/ //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V //#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin) //#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen //#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only // ###### FOR ESP8266 OVERLAP MODE EDIT THE PIN NUMBERS IN THE FOLLOWING LINES ###### // Overlap mode shares the ESP8266 FLASH SPI bus with the TFT so has a performance impact // but saves pins for other functions. It is best not to connect MISO as some displays // do not tristate that line when chip select is high! // Note: Only one SPI device can share the FLASH SPI lines, so a SPI touch controller // cannot be connected as well to the same SPI signals. // On NodeMCU 1.0 SD0=MISO, SD1=MOSI, CLK=SCLK to connect to TFT in overlap mode // On NodeMCU V3 S0 =MISO, S1 =MOSI, S2 =SCLK // In ESP8266 overlap mode the following must be defined //#define TFT_SPI_OVERLAP // In ESP8266 overlap mode the TFT chip select MUST connect to pin D3 //#define TFT_CS PIN_D3 //#define TFT_DC PIN_D5 // Data Command control pin //#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V // ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ###### // For ESP32 Dev board (only tested with ILI9341 display) // The hardware SPI can be mapped to any pins //#define TFT_MISO 19 //#define TFT_MOSI 23 //#define TFT_SCLK 18 //#define TFT_CS 15 // Chip select control pin //#define TFT_DC 2 // Data Command control pin //#define TFT_RST 4 // Reset pin (could connect to RST pin) //#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST // For ESP32 Dev board (only tested with GC9A01 display) // The hardware SPI can be mapped to any pins #define TFT_MOSI 3 // In some display driver board, it might be written as "SDA" and so on. #define TFT_SCLK 2 #define TFT_CS 6 // Chip select control pin #define TFT_DC 10 // Data Command control pin #define TFT_RST 7 // Reset pin (could connect to Arduino RESET pin) //#define TFT_BL 22 // LED back-light //#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen //#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only // For the M5Stack module use these #define lines //#define TFT_MISO 19 //#define TFT_MOSI 23 //#define TFT_SCLK 18 //#define TFT_CS 14 // Chip select control pin //#define TFT_DC 27 // Data Command control pin //#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin) //#define TFT_BL 32 // LED back-light (required for M5Stack) // ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ###### // The library supports 8-bit parallel TFTs with the ESP32, the pin // selection below is compatible with ESP32 boards in UNO format. // Wemos D32 boards need to be modified, see diagram in Tools folder. // Only ILI9481 and ILI9341 based displays have been tested! // Parallel bus is only supported for the STM32 and ESP32 // Example below is for ESP32 Parallel interface with UNO displays // Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT // The ESP32 and TFT the pins used for testing are: //#define TFT_CS 33 // Chip select control pin (library pulls permanently low //#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31 //#define TFT_RST 32 // Reset pin, toggles on startup //#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31 //#define TFT_RD 2 // Read strobe control pin //#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus //#define TFT_D1 13 // so a single register write sets/clears all bits. //#define TFT_D2 26 // Pins can be randomly assigned, this does not affect //#define TFT_D3 25 // TFT screen update performance. //#define TFT_D4 17 //#define TFT_D5 16 //#define TFT_D6 27 //#define TFT_D7 14 // ###### EDIT THE PINs BELOW TO SUIT YOUR STM32 SPI TFT SETUP ###### // The TFT can be connected to SPI port 1 or 2 //#define TFT_SPI_PORT 1 // SPI port 1 maximum clock rate is 55MHz //#define TFT_MOSI PA7 //#define TFT_MISO PA6 //#define TFT_SCLK PA5 //#define TFT_SPI_PORT 2 // SPI port 2 maximum clock rate is 27MHz //#define TFT_MOSI PB15 //#define TFT_MISO PB14 //#define TFT_SCLK PB13 // Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select //#define TFT_CS D5 // Chip select control pin to TFT CS //#define TFT_DC D6 // Data Command control pin to TFT DC (may be labelled RS = Register Select) //#define TFT_RST D7 // Reset pin to TFT RST (or RESET) // OR alternatively, we can use STM32 port reference names PXnn //#define TFT_CS PE11 // Nucleo-F767ZI equivalent of D5 //#define TFT_DC PE9 // Nucleo-F767ZI equivalent of D6 //#define TFT_RST PF13 // Nucleo-F767ZI equivalent of D7 //#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to processor reset // Use an Arduino pin for initial testing as connecting to processor reset // may not work (pulse too short at power up?) // ################################################################################## // // Section 3. Define the fonts that are to be used here // // ################################################################################## // Comment out the #defines below with // to stop that font being loaded // The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not // normally necessary. If all fonts are loaded the extra FLASH space required is // about 17Kbytes. To save FLASH space only enable the fonts you need! #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts // Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded // this will save ~20kbytes of FLASH #define SMOOTH_FONT // ################################################################################## // // Section 4. Other options // // ################################################################################## // For RP2040 processor and SPI displays, uncomment the following line to use the PIO interface. //#define RP2040_PIO_SPI // Leave commented out to use standard RP2040 SPI port interface // For RP2040 processor and 8 or 16-bit parallel displays: // The parallel interface write cycle period is derived from a division of the CPU clock // speed so scales with the processor clock. This means that the divider ratio may need // to be increased when overclocking. It may also need to be adjusted dependant on the // display controller type (ILI94341, HX8357C etc.). If RP2040_PIO_CLK_DIV is not defined // the library will set default values which may not suit your display. // The display controller data sheet will specify the minimum write cycle period. The // controllers often work reliably for shorter periods, however if the period is too short // the display may not initialise or graphics will become corrupted. // PIO write cycle frequency = (CPU clock/(4 * RP2040_PIO_CLK_DIV)) //#define RP2040_PIO_CLK_DIV 1 // 32ns write cycle at 125MHz CPU clock //#define RP2040_PIO_CLK_DIV 2 // 64ns write cycle at 125MHz CPU clock //#define RP2040_PIO_CLK_DIV 3 // 96ns write cycle at 125MHz CPU clock // For the RP2040 processor define the SPI port channel used (default 0 if undefined) //#define TFT_SPI_PORT 1 // Set to 0 if SPI0 pins are used, or 1 if spi1 pins used // For the STM32 processor define the SPI port channel used (default 1 if undefined) //#define TFT_SPI_PORT 2 // Set to 1 for SPI port 1, or 2 for SPI port 2 // Define the SPI clock frequency, this affects the graphics rendering speed. Too // fast and the TFT driver will not keep up and display corruption appears. // With an ILI9341 display 40MHz works OK, 80MHz sometimes fails // With a ST7735 display more than 27MHz may not work (spurious pixels and lines) // With an ILI9163 display 27 MHz works OK. // #define SPI_FREQUENCY 1000000 // #define SPI_FREQUENCY 5000000 // #define SPI_FREQUENCY 10000000 // #define SPI_FREQUENCY 20000000 #define SPI_FREQUENCY 27000000 // #define SPI_FREQUENCY 40000000 // #define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz) // #define SPI_FREQUENCY 80000000 // Optional reduced SPI frequency for reading TFT #define SPI_READ_FREQUENCY 20000000 // The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here: #define SPI_TOUCH_FREQUENCY 2500000 // The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default. // If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam) // then uncomment the following line: //#define USE_HSPI_PORT // Comment out the following #define if "SPI Transactions" do not need to be // supported. When commented out the code size will be smaller and sketches will // run slightly faster, so leave it commented out unless you need it! // Transaction support is needed to work with SD library but not needed with TFT_SdFat // Transaction support is required if other SPI devices are connected. // Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex) // so changing it here has no effect // #define SUPPORT_TRANSACTIONS

filetype

oid LCD_ShowxNum(u16 x,u16 y,u8 size,u8 mode,u32 num,u8 len,u16 PColor,u16 BColor) { u8 t; u32 temp; u8 enshow=0; u8 show[11]={0}; for(t=0;t<len;t++) { if(mode<2) //Ê®½øÖÆ { temp=(num/LCD_Pow(10,len-t-1))%10; if(enshow==0&&t<(len-1)) { if(temp==0) { if(mode) show[t] ='0'; else show[t]=' '; continue; }else enshow=1; } show[t] ='0'+temp; } else //Ê®Áù½øÖÆ { if(t==0) { show[0] ='0';show[1] ='x'; } temp=(num/LCD_Pow(2,(len-t-1)*4))%16; if(enshow==0&&t<(len-1)) { if(temp==0) { if(mode==3) show[t+2] ='0'; else show[t+2]=' '; continue; }else enshow=1; } if(temp<10) show[t+2] ='0'+temp; else show[t+2] ='7'+temp; } } if(mode<2) show[t]='\0'; else show[t+2]='\0'; LCD_ShowString(x,y,size,show,PColor,BColor) ; } void test_display(void) { delay_ms(1000); LCD_Clear(GREEN); delay_ms(1000); LCD_Clear(YELLOW); delay_ms(1000); LCD_Clear(RED); delay_ms(1000); LCD_Clear(BLUE); delay_ms(1000); LCD_Clear(GRAY); delay_ms(1000); LCD_Clear(BLACK); delay_ms(1000); LCD_Clear(WHITE); } void show_head(void) { //ºº×Ö×Ö¿âfont.hÎļþÖ»ÓÐ16ºÅµÄºº×Ö LCD_ColorBox(0,0,lcddev.width_x,20,WHITE); LCD_ShowString(0,0,2,(u8*)"-----Î人Ò×˼´ï¿Æ¼¼ÓÐÏÞ¹«Ë¾»¶Ó­Äú£¡-----",RED,GREEN); LCD_DrawLine(0,20,lcddev.width_x,20,5,BLUE); } void sys_init(void) { u16 lcdId=0; delay_init(); //ÑÓʱº¯Êý³õʼ»¯ NVIC_Configuration(); //ÉèÖÃNVICÖжϷÖ×é2:2λÇÀÕ¼ÓÅÏȼ¶£¬2λÏìÓ¦ÓÅÏȼ¶ usart_io_init(); //´®¿ÚIO³õʼ»¯ usart_config(USART1,115200); usart_config(USART2,115200); delay_ms(1500); usart_printf(USART1,"2222\r\n"); //´®¿ÚÖúÊÖÉÏ´òÓ¡2222µÄº¯Êý¡£ delay_ms(1500); // iic_init(0); //IIC³õʼ»¯ :Ó²¼þI2C lcdId=lcd_init(0); usart_printf(USART1,"LCD Drive Id:%x\r\n",lcdId); TP_Init(0); } void atk_rm04_quit_trans(void) { delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR='+'; delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR='+'; delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR='+'; delay_ms(500); //µÈ´ý500ms while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR=0X1B; delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR=0X1B; delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) while((USART2->SR&0X40)==0); //µÈ´ý·¢ËÍ¿Õ USART2->DR=0X1B; delay_ms(15); //´óÓÚ´®¿Ú×é֡ʱ¼ä(10ms) } vu8 get_touch_key(int touchX, int touchY) { if (touchY > 240 && touchY < 288) { if (touchX > 0 && touchX < 112) return 1; else if (touchX > 112 && touchX < 224) return 2; else if (touchX > 224 && touchX < 380) return 3; } else if (touchY > 288 && touchY < 336) { if (touchX > 0 && touchX < 112) return 4; else if (touchX > 112 && touchX < 224) return 5; else if (touchX > 224 && touchX < 380) return 6; } else if (touchY > 336 && touchY < 384) { if (touchX > 0 && touchX < 112) return 7; else if (touchX > 112 && touchX < 224) return 8; else if (touchX > 224 && touchX < 380) return 9; } else if (touchY > 384 && touchY < 432) { if (touchX > 0 && touchX < 112) return 10; else if (touchX > 112 && touchX < 224) return 11; else if (touchX > 224 && touchX < 380) return 12; } else if (touchY > 432 && touchY < 480) { if (touchX > 0 && touchX < 112) return 13; else if (touchX > 112 && touchX < 224) return 14; else if (touchX > 224 && touchX < 380) return 15; } return 0; } void touchmain(void) { u8 set_flag = 0; u8 touch = 0; u8 pos1 = 0; char passnum[15] = {'\0'}; atk_rm04_load_keyboard(0, 240); LCD_ShowString(0, 7, 3, "WIFI SSID :", YELLOW, BLACK); while (1) { tp_dev.scan(0); if (tp_dev.sta & TP_ONCE_PRES) { tp_dev.sta &= ~TP_ONCE_PRES; touch = get_touch_key(tp_dev.touchX[1], tp_dev.touchY[1]); if (touch != 0) { // ?????? break; } } } switch(touch) { case 0: // ?0:"1" LCD_ColorBox(0, 0, 53, 34, BLUE); // ??????(x1=0,y1=0,x2=53,y2=34) LCD_ShowString(22, 9, 2, "1", GREEN, BLUE); // ????(x=22,y=9) delay_ms(100); LCD_ColorBox(0, 0, 53, 34, YELLOW); // ?????? LCD_ShowString(22, 9, 2, "1", GREEN, YELLOW); strcat(passnum,"1"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); // ?????? pos1++; break; case 1: // ?1:"2" LCD_ColorBox(53, 0, 106, 34, BLUE); LCD_ShowString(75, 9, 2, "2", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 0, 106, 34, YELLOW); LCD_ShowString(75, 9, 2, "2", GREEN, YELLOW); strcat(passnum,"2"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 2: // ?2:"3" LCD_ColorBox(106, 0, 159, 34, BLUE); LCD_ShowString(128, 9, 2, "3", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 0, 159, 34, YELLOW); LCD_ShowString(128, 9, 2, "3", GREEN, YELLOW); strcat(passnum,"3"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 3: // ?3:"A" LCD_ColorBox(159, 0, 212, 34, BLUE); LCD_ShowString(181, 9, 2, "A", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 0, 212, 34, YELLOW); LCD_ShowString(181, 9, 2, "A", GREEN, YELLOW); strcat(passnum,"A"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 4: // ?4:"B" LCD_ColorBox(212, 0, 265, 34, BLUE); LCD_ShowString(234, 9, 2, "B", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 0, 265, 34, YELLOW); LCD_ShowString(234, 9, 2, "B", GREEN, YELLOW); strcat(passnum,"B"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 5: // ?5:"C"(?55px) LCD_ColorBox(265, 0, 320, 34, BLUE); LCD_ShowString(290, 9, 2, "C", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 0, 320, 34, YELLOW); LCD_ShowString(290, 9, 2, "C", GREEN, YELLOW); strcat(passnum,"C"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?1?(row=1,y=34~68)====================== case 6: // ?0:"4" LCD_ColorBox(0, 34, 53, 68, BLUE); LCD_ShowString(22, 43, 2, "4", GREEN, BLUE); delay_ms(100); LCD_ColorBox(0, 34, 53, 68, YELLOW); LCD_ShowString(22, 43, 2, "4", GREEN, YELLOW); strcat(passnum,"4"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 7: // ?1:"5" LCD_ColorBox(53, 34, 106, 68, BLUE); LCD_ShowString(75, 43, 2, "5", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 34, 106, 68, YELLOW); LCD_ShowString(75, 43, 2, "5", GREEN, YELLOW); strcat(passnum,"5"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 8: // ?2:"6" LCD_ColorBox(106, 34, 159, 68, BLUE); LCD_ShowString(128, 43, 2, "6", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 34, 159, 68, YELLOW); LCD_ShowString(128, 43, 2, "6", GREEN, YELLOW); strcat(passnum,"6"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 9: // ?3:"D" LCD_ColorBox(159, 34, 212, 68, BLUE); LCD_ShowString(181, 43, 2, "D", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 34, 212, 68, YELLOW); LCD_ShowString(181, 43, 2, "D", GREEN, YELLOW); strcat(passnum,"D"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 10: // ?4:"E" LCD_ColorBox(212, 34, 265, 68, BLUE); LCD_ShowString(234, 43, 2, "E", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 34, 265, 68, YELLOW); LCD_ShowString(234, 43, 2, "E", GREEN, YELLOW); strcat(passnum,"E"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 11: // ?5:"F" LCD_ColorBox(265, 34, 320, 68, BLUE); LCD_ShowString(290, 43, 2, "F", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 34, 320, 68, YELLOW); LCD_ShowString(290, 43, 2, "F", GREEN, YELLOW); strcat(passnum,"F"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?2?(row=2,y=68~102)====================== case 12: // ?0:"7" LCD_ColorBox(0, 68, 53, 102, BLUE); LCD_ShowString(22, 77, 2, "7", GREEN, BLUE); delay_ms(100); LCD_ColorBox(0, 68, 53, 102, YELLOW); LCD_ShowString(22, 77, 2, "7", GREEN, YELLOW); strcat(passnum,"7"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 13: // ?1:"8" LCD_ColorBox(53, 68, 106, 102, BLUE); LCD_ShowString(75, 77, 2, "8", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 68, 106, 102, YELLOW); LCD_ShowString(75, 77, 2, "8", GREEN, YELLOW); strcat(passnum,"8"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 14: // ?2:"9" LCD_ColorBox(106, 68, 159, 102, BLUE); LCD_ShowString(128, 77, 2, "9", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 68, 159, 102, YELLOW); LCD_ShowString(128, 77, 2, "9", GREEN, YELLOW); strcat(passnum,"9"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 15: // ?3:"G" LCD_ColorBox(159, 68, 212, 102, BLUE); LCD_ShowString(181, 77, 2, "G", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 68, 212, 102, YELLOW); LCD_ShowString(181, 77, 2, "G", GREEN, YELLOW); strcat(passnum,"G"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 16: // ?4:"H" LCD_ColorBox(212, 68, 265, 102, BLUE); LCD_ShowString(234, 77, 2, "H", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 68, 265, 102, YELLOW); LCD_ShowString(234, 77, 2, "H", GREEN, YELLOW); strcat(passnum,"H"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 17: // ?5:"I" LCD_ColorBox(265, 68, 320, 102, BLUE); LCD_ShowString(290, 77, 2, "I", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 68, 320, 102, YELLOW); LCD_ShowString(290, 77, 2, "I", GREEN, YELLOW); strcat(passnum,"I"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?3?(row=3,y=102~136)====================== case 18: // ?0:"*" LCD_ColorBox(0, 102, 53, 136, BLUE); LCD_ShowString(22, 111, 2, "*", GREEN, BLUE); delay_ms(100); LCD_ColorBox(0, 102, 53, 136, YELLOW); LCD_ShowString(22, 111, 2, "*", GREEN, YELLOW); strcat(passnum,"*"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 19: // ?1:"0" LCD_ColorBox(53, 102, 106, 136, BLUE); LCD_ShowString(75, 111, 2, "0", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 102, 106, 136, YELLOW); LCD_ShowString(75, 111, 2, "0", GREEN, YELLOW); strcat(passnum,"0"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 20: // ?2:"#" LCD_ColorBox(106, 102, 159, 136, BLUE); LCD_ShowString(128, 111, 2, "#", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 102, 159, 136, YELLOW); LCD_ShowString(128, 111, 2, "#", GREEN, YELLOW); strcat(passnum,"#"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 21: // ?3:"J" LCD_ColorBox(159, 102, 212, 136, BLUE); LCD_ShowString(181, 111, 2, "J", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 102, 212, 136, YELLOW); LCD_ShowString(181, 111, 2, "J", GREEN, YELLOW); strcat(passnum,"J"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 22: // ?4:"K" LCD_ColorBox(212, 102, 265, 136, BLUE); LCD_ShowString(234, 111, 2, "K", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 102, 265, 136, YELLOW); LCD_ShowString(234, 111, 2, "K", GREEN, YELLOW); strcat(passnum,"K"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 23: // ?5:"L" LCD_ColorBox(265, 102, 320, 136, BLUE); LCD_ShowString(290, 111, 2, "L", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 102, 320, 136, YELLOW); LCD_ShowString(290, 111, 2, "L", GREEN, YELLOW); strcat(passnum,"L"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?4?(row=4,y=136~170)====================== case 24: // ?0:"." LCD_ColorBox(0, 136, 53, 170, BLUE); LCD_ShowString(22, 145, 2, ".", GREEN, BLUE); delay_ms(100); LCD_ColorBox(0, 136, 53, 170, YELLOW); LCD_ShowString(22, 145, 2, ".", GREEN, YELLOW); strcat(passnum,"."); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 25: // ?1:"-" LCD_ColorBox(53, 136, 106, 170, BLUE); LCD_ShowString(75, 145, 2, "V", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 136, 106, 170, YELLOW); LCD_ShowString(75, 145, 2, "V", GREEN, YELLOW); strcat(passnum,"V"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 26: // ?2:"+" LCD_ColorBox(106, 136, 159, 170, BLUE); LCD_ShowString(128, 145, 2, "Z", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 136, 159, 170, YELLOW); LCD_ShowString(128, 145, 2, "Z", GREEN, YELLOW); strcat(passnum,"Z"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 27: // ?3:"M" LCD_ColorBox(159, 136, 212, 170, BLUE); LCD_ShowString(181, 145, 2, "M", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 136, 212, 170, YELLOW); LCD_ShowString(181, 145, 2, "M", GREEN, YELLOW); strcat(passnum,"M"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 28: // ?4:"N" LCD_ColorBox(212, 136, 265, 170, BLUE); LCD_ShowString(234, 145, 2, "N", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 136, 265, 170, YELLOW); LCD_ShowString(234, 145, 2, "N", GREEN, YELLOW); strcat(passnum,"N"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 29: // ?5:"O" LCD_ColorBox(265, 136, 320, 170, BLUE); LCD_ShowString(290, 145, 2, "O", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 136, 320, 170, YELLOW); LCD_ShowString(290, 145, 2, "O", GREEN, YELLOW); strcat(passnum,"O"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?5?(row=5,y=170~204)====================== case 30: // ?0:"/" LCD_ColorBox(0, 170, 53, 204, BLUE); LCD_ShowString(22, 179, 2, "Y", GREEN, BLUE); delay_ms(100); LCD_ColorBox(0, 170, 53, 204, YELLOW); LCD_ShowString(22, 179, 2, "Y", GREEN, YELLOW); strcat(passnum,"Y"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 31: // ?1:"×" LCD_ColorBox(53, 170, 106, 204, BLUE); LCD_ShowString(75, 179, 2, "X", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 170, 106, 204, YELLOW); LCD_ShowString(75, 179, 2, "X", GREEN, YELLOW); strcat(passnum,"X"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 32: // ?2:"=" LCD_ColorBox(106, 170, 159, 204, BLUE); LCD_ShowString(128, 179, 2, "W", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 170, 159, 204, YELLOW); LCD_ShowString(128, 179, 2, "W", GREEN, YELLOW); strcat(passnum,"W"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 33: // ?3:"P" LCD_ColorBox(159, 170, 212, 204, BLUE); LCD_ShowString(181, 179, 2, "P", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 170, 212, 204, YELLOW); LCD_ShowString(181, 179, 2, "P", GREEN, YELLOW); strcat(passnum,"P"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 34: // ?4:"Q" LCD_ColorBox(212, 170, 265, 204, BLUE); LCD_ShowString(234, 179, 2, "Q", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 170, 265, 204, YELLOW); LCD_ShowString(234, 179, 2, "Q", GREEN, YELLOW); strcat(passnum,"Q"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 35: // ?5:"R" LCD_ColorBox(265, 170, 320, 204, BLUE); LCD_ShowString(290, 179, 2, "R", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 170, 320, 204, YELLOW); LCD_ShowString(290, 179, 2, "R", GREEN, YELLOW); strcat(passnum,"R"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; // ====================== ?6?(row=6,y=204~240,?36px)====================== case 36: // ?0:"DEL"(??) LCD_ColorBox(0, 204, 53, 240, BLUE); LCD_ShowString(14, 216, 2, "DEL", GREEN, BLUE); // ????? delay_ms(100); LCD_ColorBox(0, 204, 53, 240, YELLOW); LCD_ShowString(14, 216, 2, "DEL", GREEN, YELLOW); if(pos1 > 0) { pos1--; passnum[pos1] = '\0'; LCD_ColorBox(100 + pos1*8, 7, 100 + (pos1+1)*8, 23, BLACK); // ??????? LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); } break; case 37: // ?1:"CLEAR"(??) LCD_ColorBox(53, 204, 106, 240, BLUE); LCD_ShowString(66, 216, 2, "CLEAR", GREEN, BLUE); delay_ms(100); LCD_ColorBox(53, 204, 106, 240, YELLOW); LCD_ShowString(66, 216, 2, "CLEAR", GREEN, YELLOW); pos1 = 0; memset(passnum, '\0', sizeof(passnum)); LCD_ColorBox(100, 7, 310, 23, BLACK); // ?????? usart_printf(USART1,"\r\nClear all input!"); break; case 38: // ?2:"OK"(??,????set) LCD_ColorBox(106, 204, 159, 240, BLUE); LCD_ShowString(119, 216, 2, "OK", GREEN, BLUE); delay_ms(100); LCD_ColorBox(106, 204, 159, 240, YELLOW); LCD_ShowString(119, 216, 2, "OK", GREEN, YELLOW); set_flag=1; break; case 39: // ?3:"S" LCD_ColorBox(159, 204, 212, 240, BLUE); LCD_ShowString(181, 216, 2, "S", GREEN, BLUE); delay_ms(100); LCD_ColorBox(159, 204, 212, 240, YELLOW); LCD_ShowString(181, 216, 2, "S", GREEN, YELLOW); strcat(passnum,"S"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 40: // ?4:"T" LCD_ColorBox(212, 204, 265, 240, BLUE); LCD_ShowString(234, 216, 2, "T", GREEN, BLUE); delay_ms(100); LCD_ColorBox(212, 204, 265, 240, YELLOW); LCD_ShowString(234, 216, 2, "T", GREEN, YELLOW); strcat(passnum,"T"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; case 41: // ?5:"U" LCD_ColorBox(265, 204, 320, 240, BLUE); LCD_ShowString(290, 216, 2, "U", GREEN, BLUE); delay_ms(100); LCD_ColorBox(265, 204, 320, 240, YELLOW); LCD_ShowString(290, 216, 2, "U", GREEN, YELLOW); strcat(passnum,"U"); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum); LCD_ShowString(100, 7, 2, passnum, YELLOW, BLACK); pos1++; break; default:break; } if(set_flag) {set_flag=0; strcat(passnum_pro,passnum); usart_printf(USART1,"\r\n"); usart_printf(USART1,passnum_pro); LCD_Clear(BLACK); show_head(); } } void WIFI_aptest(void); u16 n=150;//ºê¶¨ÒåÑÓʱ²ÎÊýn LCD_ShowString(0,5,2,"·¢Ë͵ÄATÖ¸ÁîΪ£º",BLUE,BLACK); usart_printf(USART2,"at+netmode=3\r\n"); LCD_ShowString(0,6,2,"at+netmode=3",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd=1\r\n"); //×Ô¼º¼ÓµÄ ΪÁËÅäÖóÉAPģʽ LCD_ShowString(0,7,2,"at+dhcpd=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_ip=192.168.18.1,192.168.18.254,255.255.255.0,192.168.18.203\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,8,2,"at+dhcpd_ip=192.168.18.1,192.168.18.254,255.255.255.0,192.168.18.203",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_dns=192.168.18.203,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,10,2,"at+dhcpd_dns=192.168.18.203,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_time=86400\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,11,2,"at+dhcpd_time=86400",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,ceshi_pro); //×Ô¼º¼ÓµÄ LCD_ShowString(0,12,2,ceshi_pro,YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpc=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,14,2,"at+dhcpc=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_ip=192.168.18.203,255.255.255.0,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,15,2,"at+net_ip=192.168.18.203,255.255.255.0,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_dns=0.0.0.0,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,17,2,"at+net_dns=0.0.0.0,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remotepro=tcp\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,18,2,"at+remotepro=tcp",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+mode=server\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,19,2,"at+mode=server",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remoteip=192.168.11.245\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,20,2,"at+remoteip=192.168.11.245",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remoteport=8080\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,21,2,"at+remoteport=8080",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+CLport=\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,22,2,"at+CLport=",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+timeout=0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,23,2,"at+timeout=0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uart=115200,8,n,1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,24,2,"at+uart=115200,8,n,1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uartpacklen=64\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,25,2,"at+uartpacklen=64",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uartpacktimeout=10\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,26,2,"at+uartpacktimeout=10",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_commit=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,27,2,"at+net_commit=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+reconn=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,28,2,"at+reconn=1",YELLOW,BLACK); if(USART2_RX_STA &0x8000) { usart_printf(USART1,"\r\nFrom Usart1:"); usart_printf_len(USART1,USART2_RX_BUF,USART2_RX_STA&0X3FFF); LCD_ShowString(16,5,2,"ok APģʽÒÑÆô¶¯",YELLOW,RED); //Show AP ²ÎÊý LCD_ColorBox(0,80,320,400,BLACK); LCD_ColorBox(32,120,256,320,RED); LCD_ColorBox(40,128,240,304,WHITE); LCD_SetShowArea(40,128,280,348); LCD_ShowString_Area("·ÓÉÆ÷ģʽ²ÎÊýÐÅÏ¢"); LCD_ShowString_Area("WIFIÕ˺Å:"); LCD_ShowString_Area(ipnum_pro); LCD_ShowString_Area("¼ÓÃÜ·½Ê½:WPA/WPA2_AES"); LCD_ShowString_Area("WIFIÃÜÂë:"); LCD_ShowString_Area(passnum_pro); LCD_ShowString_Area("¶Ë¿ÚºÅ:8080"); LCD_ShowString(16,5,2,"ok APģʽÒÑÆô¶¯",YELLOW,RED); //end show USART2_RX_STA=0; }else LCD_ShowString(16,5,2,"bad Æô¶¯Ê§°Ü",YELLOW,RED); delay_ms(n); } void WIFI_ap(void); u16 n=150;//ºê¶¨ÒåÑÓʱ²ÎÊýn LCD_ShowString(0,5,2,"·¢Ë͵ÄATÖ¸ÁîΪ£º",BLUE,BLACK); usart_printf(USART2,"at+netmode=3\r\n"); LCD_ShowString(0,6,2,"at+netmode=3",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd=1\r\n"); //×Ô¼º¼ÓµÄ ΪÁËÅäÖóÉAPģʽ LCD_ShowString(0,7,2,"at+dhcpd=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_ip=192.168.18.1,192.168.18.254,255.255.255.0,192.168.18.203\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,8,2,"at+dhcpd_ip=192.168.18.1,192.168.18.254,255.255.255.0,192.168.18.203",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_dns=192.168.18.203,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,10,2,"at+dhcpd_dns=192.168.18.203,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpd_time=86400\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,11,2,"at+dhcpd_time=86400",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+wifi_conf=EasyStart,wpawpa2_aes,123456789\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,12,2,"at+wifi_conf=EasyStart,wpawpa2_aes,123456789",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+dhcpc=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,14,2,"at+dhcpc=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_ip=192.168.18.203,255.255.255.0,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,15,2,"at+net_ip=192.168.18.203,255.255.255.0,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_dns=0.0.0.0,0.0.0.0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,17,2,"at+net_dns=0.0.0.0,0.0.0.0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remotepro=tcp\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,18,2,"at+remotepro=tcp",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+mode=server\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,19,2,"at+mode=server",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remoteip=192.168.11.245\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,20,2,"at+remoteip=192.168.11.245",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+remoteport=8080\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,21,2,"at+remoteport=8080",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+CLport=\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,22,2,"at+CLport=",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+timeout=0\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,23,2,"at+timeout=0",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uart=115200,8,n,1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,24,2,"at+uart=115200,8,n,1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uartpacklen=64\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,25,2,"at+uartpacklen=64",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+uartpacktimeout=10\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,26,2,"at+uartpacktimeout=10",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+net_commit=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,27,2,"at+net_commit=1",YELLOW,BLACK); delay_ms(n); usart_printf(USART2,"at+reconn=1\r\n"); //×Ô¼º¼ÓµÄ LCD_ShowString(0,28,2,"at+reconn=1",YELLOW,BLACK); if(USART2_RX_STA &0x8000) { usart_printf(USART1,"\r\nFrom Usart1:"); usart_printf_len(USART1,USART2_RX_BUF,USART2_RX_STA&0X3FFF); LCD_ShowString(16,5,2,"ok",YELLOW,RED); USART2_RX_STA=0; }else LCD_ShowString(16,5,2,"bad",YELLOW,RED); delay_ms(n); } /* * º¯ÊýÃû£ºLCD_GPIO_Config * ÃèÊö £º¸ù¾ÝFSMCÅäÖÃLCDµÄI/O * ÊäÈë £ºÎÞ * Êä³ö £ºÎÞ * µ÷Óà £ºÄÚ²¿µ÷Óà */ void LCD_GPIO_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; /* Enable the FSMC Clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE); /* config lcd gpio clock base on FSMC */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE , ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; //PB0 ÍÆÍìÊä³ö ±³¹â GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE, &GPIO_InitStructure); //PORTD¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_14|GPIO_Pin_15; // //PORTD¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOD, &GPIO_InitStructure); //PORTE¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15; // //PORTD¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE, &GPIO_InitStructure); // //PORTG12¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; // //PORTD¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE, &GPIO_InitStructure); }

filetype

现在是这样的。怎么修改。我只采信了你前面答案的部分修改。/* NVT board configuration */ #define CONFIG_MEM_SIZE _BOARD_DRAM_SIZE_ #ifndef SZ_1M #define SZ_1M 0x100000 #endif /** * kernel image and all-in-one image size * user can add NVT_CFG_UBOOT_UIMAGE_SIZE and NVT_CFG_UBOOT_ALL_IN_ONE_IMG_SIZE * on nvt-info.dtsi to change them. */ #if (!defined(CONFIG_NVT_UIMAGE_SIZE) && !defined(CONFIG_NVT_UIMAGE_SIZE)) #if (CONFIG_MEM_SIZE == (SZ_1M * 256)) #define CONFIG_NVT_UIMAGE_SIZE (SZ_1M * 25) #define CONFIG_NVT_ALL_IN_ONE_IMG_SIZE (SZ_1M * 120) #elif (CONFIG_MEM_SIZE == (SZ_1M * 128)) #define CONFIG_NVT_UIMAGE_SIZE (SZ_1M * 8) #define CONFIG_NVT_ALL_IN_ONE_IMG_SIZE (SZ_1M * 32) #elif (CONFIG_MEM_SIZE == (SZ_1M * 64)) #define CONFIG_NVT_UIMAGE_SIZE (SZ_1M * 4) #define CONFIG_NVT_ALL_IN_ONE_IMG_SIZE (SZ_1M * 20) #else #define CONFIG_NVT_UIMAGE_SIZE (SZ_1M * 25) #define CONFIG_NVT_ALL_IN_ONE_IMG_SIZE (SZ_1M * 330) #endif #endif /* (!defined(CONFIG_NVT_UIMAGE_SIZE) && !defined(CONFIG_NVT_UIMAGE_SIZE)) */ /* temp buffer for all-in-one T.bin boot requirement */ #define CONFIG_UBOOT_SDRAM_BASE _BOARD_UBOOT_ADDR_ #define CONFIG_UBOOT_SDRAM_SIZE _BOARD_UBOOT_SIZE_ #define CONFIG_LINUX_SDRAM_BASE _BOARD_LINUXTMP_ADDR_ #define CONFIG_LINUX_SDRAM_SIZE _BOARD_LINUXTMP_SIZE_ #if (CONFIG_UBOOT_SDRAM_BASE > CONFIG_LINUX_SDRAM_BASE) #define CONFIG_LINUX_SDRAM_START (CONFIG_UBOOT_SDRAM_BASE - CONFIG_NVT_UIMAGE_SIZE) #else #define CONFIG_LINUX_SDRAM_START (CONFIG_LINUX_SDRAM_BASE + CONFIG_LINUX_SDRAM_SIZE - CONFIG_NVT_UIMAGE_SIZE) #endif #define CONFIG_NVT_RUNFW_SDRAM_BASE (CONFIG_LINUX_SDRAM_START - CONFIG_NVT_ALL_IN_ONE_IMG_SIZE) #define CONFIG_RAMDISK_SDRAM_SIZE (SZ_1M * 30) /* To define maximum ramdisk size */ #define CONFIG_SMEM_SDRAM_BASE _BOARD_SHMEM_ADDR_ #define CONFIG_SMEM_SDRAM_SIZE _BOARD_SHMEM_SIZE_ #define CONFIG_FDT_SDRAM_BASE _BOARD_FDT_ADDR_ #define CONFIG_FDT_SDRAM_SIZE _BOARD_FDT_SIZE_ #if defined(CONFIG_NVT_SPI_NAND) #if (_EMBMEM_BLK_SIZE_ == 0x40000) #define CONFIG_MODELEXT_FLASH_BASE 0x80000 #else #define CONFIG_MODELEXT_FLASH_BASE 0x40000 #endif #elif defined(CONFIG_NVT_IVOT_EMMC) #define CONFIG_MODELEXT_FLASH_BASE (0x40000/512) #else #define CONFIG_MODELEXT_FLASH_BASE 0x10000 #endif /* FLASH FileSystem */ #if defined(CONFIG_NVT_SPI_NAND) || defined(CONFIG_NVT_SPI_NONE) || defined(CONFIG_NVT_SPI_NOR_NAND) #define CONFIG_SYS_MAX_NAND_DEVICE 1 #define CONFIG_SYS_NAND_MAX_CHIPS 1 #endif #define CONFIG_SYS_L2_PL310 #define CONFIG_SYS_PL310_BASE 0xFFE00000 /* #define CONFIG_SYS_CACHELINE_SIZE 32 */ #ifdef CONFIG_NVT_FPGA_EMULATION #define CONFIG_SYS_CPU_CLK 24000000 #define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CPU_CLK #else /* !CONFIG_NVT_FPGA_EMULATION */ #define CONFIG_SYS_CPU_CLK 960000000 #define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CPU_CLK #endif /* CONFIG_NVT_FPGA_EMULATION */ /* * Serial driver init. * */ #define CONFIG_SYS_NS16550_SERIAL #define CONFIG_SYS_NS16550_MEM32 #define CONFIG_SYS_NS16550_REG_SIZE -1 #define CONFIG_SYS_NS16550_COM1 0xf0290000 #define CONFIG_SYS_NS16550_COM2 0xf0300000 #define CONFIG_SYS_NS16550_COM3 0xf0310000 #define CONFIG_SYS_NS16550_COM4 0xf0380000 #define CONFIG_SYS_NS16550_COM5 0xf03E0000 #define CONFIG_SYS_NS16550_COM6 0xf03F0000 #define CONFIG_SYS_NS16550_CLK 24000000 /* COM1: 24M, other COM port 48M */ #define CONFIG_SYS_NS16550_HSCLK 48000000 /* COM1: 24M, other COM port 48M */ /* Secure boot relative option */ #ifdef _ENCRYPT_ATF_ON_ #define CONFIG_ENCRYPT_ATF #endif #ifdef _ENCRYPT_CFG_ON_ #define CONFIG_ENCRYPT_CFG #endif #ifdef _ENCRYPT_UBOOT_ON_ #define CONFIG_ENCRYPT_UBOOT #endif #ifdef _ENCRYPT_KERNEL_ON_ #define CONFIG_ENCRYPT_KERNEL #endif #ifdef _ENCRYPT_RTOS_ON_ #define CONFIG_ENCRYPT_RTOS #endif #ifdef _ENCRYPT_OPTEE_ON_ #define CONFIG_ENCRYPT_OPTEE #endif /sunhaoming@ubuntu:~/ipc_platform/platform/nvmp/build_dir/target-arm-ca9-linux-uclibcgnueabihf-c540-4gv2/linux-nvt9856x_generic/bootloader/normal_boot$ make clean && make V=1 set -e; : ' CHK include/config/uboot.release'; mkdir -p include/config/; echo "2019.04$(/bin/sh ./scripts/setlocalversion .)" < include/config/auto.conf > include/config/uboot.release.tmp; if [ -r include/config/uboot.release ] && cmp -s include/config/uboot.release include/config/uboot.release.tmp; then rm -f include/config/uboot.release.tmp; else : ' UPD include/config/uboot.release'; mv -f include/config/uboot.release.tmp include/config/uboot.release; fi make -f ./scripts/Makefile.autoconf u-boot.cfg if [ -d arch/arm/mach-nvt-na51089_a32/include/mach ]; then \ dest=../../mach-nvt-na51089_a32/include/mach; \ else \ dest=arch-nvt-na51089_a32; \ fi; \ ln -fsn $dest arch/arm/include/asm/arch set -e; : ' CHK include/config.h'; mkdir -p include/; (echo "/* Automatically generated - do not edit */"; for i in $(echo "" | sed 's/,/ /g'); do echo \#define CONFIG_$i | sed '/=/ {s/=/ /;q; } ; { s/$/ 1/; }'; done; echo \#define CONFIG_BOARDDIR board/novatek/nvt-na51089; echo \#include \<config_defaults.h\>; echo \#include \<config_uncmd_spl.h\>; echo \#include \<configs/"nvt-na51089-evb".h\>; echo \#include \<asm/config.h\>; echo \#include \<linux/kconfig.h\>; echo \#include \<config_fallbacks.h\>;) < scripts/Makefile.autoconf > include/config.h.tmp; if [ -r include/config.h ] && cmp -s include/config.h include/config.h.tmp; then rm -f include/config.h.tmp; else : ' UPD include/config.h'; mv -f include/config.h.tmp include/config.h; fi gcc -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -DFLASH_REDBOOT -Os -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time -D__KERNEL__ -D__UBOOT__ -I/libutils/src -I/libsdm/src -D__ARM__ -fno-pic -D_BOARD_DRAM_ADDR_= -D_BOARD_DRAM_SIZE_= -D_BOARD_SHMEM_ADDR_= -D_BOARD_SHMEM_SIZE_= -D_BOARD_FDT_ADDR_= -D_BOARD_FDT_SIZE_= -D_BOARD_LINUXTMP_ADDR_= -D_BOARD_LINUXTMP_SIZE_= -D_BOARD_LINUX_MAXBLK_ADDR_= -D_BOARD_LINUX_MAXBLK_SIZE_= -D_BOARD_LOADER_ADDR_= -D_BOARD_LOADER_SIZE_= -D_BOARD_EXTDRAM_ADDR_= -D_BOARD_EXTDRAM_SIZE_= -D_BOARD_LINUX_ADDR_= -D_BOARD_LINUX_SIZE_= -D_BIN_NAME_='""' -D_BIN_NAME_T_='""' -D_CHIP__ -D_CHIP_NAME_='"NT"' -D__ -D_EMBMEM_BLK_SIZE_= -D__ -D__ -D__ -D__ -D__ -D__ -D__ -D__ -D__ -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -Iinclude -I./arch/arm/include -include ./include/linux/kconfig.h -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/5/include -DDO_DEPS_ONLY -dM ./include/common.h > u-boot.cfg.tmp && { grep 'define CONFIG_' u-boot.cfg.tmp > u-boot.cfg; rm u-boot.cfg.tmp; } || { rm u-boot.cfg.tmp; false; } In file included from include/configs/nvt-na51089-evb.h:108:0, from include/config.h:5, from ./include/common.h:17: include/configs/novatek/na51089_ca9.h:9:22: error: operator '==' has no left operand #if (CONFIG_MEM_SIZE == (SZ_1M * 256)) ^ include/configs/novatek/na51089_ca9.h:12:24: error: operator '==' has no left operand #elif (CONFIG_MEM_SIZE == (SZ_1M * 128)) ^ include/configs/novatek/na51089_ca9.h:15:24: error: operator '==' has no left operand #elif (CONFIG_MEM_SIZE == (SZ_1M * 64)) ^ include/configs/novatek/na51089_ca9.h:29:55: error: operator '>' has no right operand #if (CONFIG_UBOOT_SDRAM_BASE > CONFIG_LINUX_SDRAM_BASE) ^ scripts/Makefile.autoconf:77: recipe for target 'u-boot.cfg' failed make[1]: *** [u-boot.cfg] Error 1 Makefile:836: recipe for target 'u-boot.cfg' failed make: *** [u-boot.cfg] Error 2

filetype

root@zhang:~# dpkg --list | grep -i python ii libpython3-stdlib:amd64 3.12.3-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version) ii libpython3.12-minimal:amd64 3.12.3-1ubuntu0.4 amd64 Minimal subset of the Python language (version 3.12) ii libpython3.12-stdlib:amd64 3.12.3-1ubuntu0.4 amd64 Interactive high-level object-oriented language (standard library, version 3.12) ii libpython3.12t64:amd64 3.12.3-1ubuntu0.4 amd64 Shared Python runtime library (version 3.12) ii python-apt-common 2.7.7ubuntu4 all Python interface to libapt-pkg (locales) ii python-babel-localedata 2.10.3-3build1 all tools for internationalizing Python applications - locale data files ii python3 3.12.3-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version) ii python3-apport 2.28.1-0ubuntu3.3 all Python 3 library for Apport crash report handling ii python3-apt 2.7.7ubuntu4 amd64 Python 3 interface to libapt-pkg ii python3-aptdaemon 1.1.1+bzr982-0ubuntu44 all Python 3 module for the server and client of aptdaemon ii python3-aptdaemon.gtk3widgets 1.1.1+bzr982-0ubuntu44 all Python 3 GTK+ 3 widgets to run an aptdaemon client ii python3-attr 23.2.0-2 all Attributes without boilerplate (Python 3) ii python3-babel 2.10.3-3build1 all tools for internationalizing Python applications - Python 3.x ii python3-blinker 1.7.0-1 all Fast, simple object-to-object and broadcast signaling (Python3) ii python3-bpfcc 0.29.1+ds-1ubuntu7 all Python 3 wrappers for BPF Compiler Collection (BCC) ii python3-brlapi:amd64 6.6-4ubuntu5 amd64 Braille display access via BRLTTY - Python3 bindings ii python3-cairo 1.25.1-2build2 amd64 Python3 bindings for the Cairo vector graphics library ii python3-certifi 2023.11.17-1 all root certificates for validating SSL certs and verifying TLS hosts (python3) ii python3-cffi-backend:amd64 1.16.0-2build1 amd64 Foreign Function Interface for Python 3 calling C code - runtime ii python3-chardet 5.2.0+dfsg-1 all Universal Character Encoding Detector (Python3) ii python3-click 8.1.6-2 all Wrapper around optparse for command line utilities - Python 3.x ii python3-colorama 0.4.6-4 all Cross-platform colored terminal text in Python - Python 3.x ii python3-commandnotfound 23.04.0 all Python 3 bindings for command-not-found. ii python3-configobj 5.0.8-3 all simple but powerful config file reader and writer for Python 3 ii python3-cryptography 41.0.7-4ubuntu0.1 amd64 Python library exposing cryptographic recipes and primitives (Python 3) ii python3-cups:amd64 2.0.1-5build6 amd64 Python3 bindings for CUPS ii python3-cupshelpers 1.5.18-1ubuntu9 all Python utility modules around the CUPS printing system ii python3-dateutil 2.8.2-3ubuntu1 all powerful extensions to the standard Python 3 datetime module ii python3-dbus 1.3.2-5build3 amd64 simple interprocess messaging system (Python 3 interface) ii python3-debconf 1.5.86ubuntu1 all interact with debconf from Python 3 ii python3-debian 0.1.49ubuntu2 all Python 3 modules to work with Debian-related data formats ii python3-defer 1.0.6-2.1ubuntu1 all Small framework for asynchronous programming (Python 3) ii python3-distro 1.9.0-1 all Linux OS platform information API ii python3-distro-info 1.7build1 all information about distributions' releases (Python 3 module) ii python3-distupgrade 1:24.04.26 all manage release upgrades ii python3-gdbm:amd64 3.12.3-0ubuntu1 amd64 GNU dbm database support for Python 3.x ii python3-gi 3.48.2-1 amd64 Python 3 bindings for gobject-introspection libraries ii python3-httplib2 0.20.4-3 all comprehensive HTTP client library written for Python3 ii python3-ibus-1.0 1.5.29-2 all Intelligent Input Bus - introspection overrides for Python (Python 3) ii python3-idna 3.6-2ubuntu0.1 all Python IDNA2008 (RFC 5891) handling (Python 3) ii python3-jinja2 3.1.2-1ubuntu1.2 all small but fast and easy to use stand-alone template engine ii python3-json-pointer 2.0-0ubuntu1 all resolve JSON pointers - Python 3.x ii python3-jsonpatch 1.32-3 all library to apply JSON patches - Python 3.x ii python3-jsonschema 4.10.3-2ubuntu1 all An(other) implementation of JSON Schema (Draft 3, 4, 6, 7) ii python3-jwt 2.7.0-1 all Python 3 implementation of JSON Web Token ii python3-launchpadlib 1.11.0-6 all Launchpad web services client library (Python 3) ii python3-lazr.restfulclient 0.14.6-1 all client for lazr.restful-based web services (Python 3) ii python3-lazr.uri 1.0.6-3 all library for parsing, manipulating, and generating URIs ii python3-louis 3.29.0-1build1 all Python bindings for liblouis ii python3-markdown-it 3.0.0-2 all Python port of markdown-it and some its associated plugins ii python3-markupsafe 2.1.5-1build2 amd64 HTML/XHTML/XML string library ii python3-mdurl 0.1.2-1 all Python port of the JavaScript mdurl package ii python3-minimal 3.12.3-0ubuntu2 amd64 minimal subset of the Python language (default python3 version) ii python3-netaddr 0.8.0-2ubuntu1 all manipulation of various common network address notations (Python 3) ii python3-netifaces:amd64 0.11.0-2build3 amd64 portable network interface information - Python 3.x ii python3-netplan 1.1.1-1~ubuntu24.04.1 amd64 Declarative network configuration Python bindings ii python3-oauthlib 3.2.2-1 all generic, spec-compliant implementation of OAuth for Python3 ii python3-olefile 0.46-3 all Python module to read/write MS OLE2 files ii python3-pexpect 4.9-2 all Python 3 module for automating interactive applications ii python3-pil:amd64 10.2.0-1ubuntu1 amd64 Python Imaging Library (Python3) ii python3-pkg-resources 68.1.2-2ubuntu1.1 all Package Discovery and Resource Access using pkg_resources ii python3-problem-report 2.28.1-0ubuntu3.3 all Python 3 library to handle problem reports ii python3-ptyprocess 0.7.0-5 all Run a subprocess in a pseudo terminal from Python 3 ii python3-pygments 2.17.2+dfsg-1 all syntax highlighting package written in Python 3 ii python3-pyparsing 3.1.1-1 all alternative to creating and executing simple grammars - Python 3.x ii python3-pyrsistent:amd64 0.20.0-1build2 amd64 persistent/functional/immutable data structures for Python ii python3-requests 2.31.0+dfsg-1ubuntu1 all elegant and simple HTTP library for Python3, built for human beings ii python3-rich 13.7.1-1 all render rich text, tables, progress bars, syntax highlighting, markdown and more ii python3-serial 3.5-2 all pyserial - module encapsulating access for the serial port ii python3-six 1.16.0-4 all Python 2 and 3 compatibility library ii python3-software-properties 0.99.49.1 all manage the repositories that you install software from ii python3-speechd 0.12.0~rc2-2build3 all Python interface to Speech Dispatcher ii python3-sss 2.9.4-1.1ubuntu6.2 amd64 Python3 module for the System Security Services Daemon ii python3-systemd 235-1build4 amd64 Python 3 bindings for systemd ii python3-typing-extensions 4.10.0-1 all Backported and Experimental Type Hints for Python ii python3-tz 2024.1-2 all Python3 version of the Olson timezone database ii python3-update-manager 1:24.04.9 all Python 3.x module for update-manager ii python3-urllib3 2.0.7-1ubuntu0.1 all HTTP library with thread-safe connection pooling for Python3 ii python3-wadllib 1.3.6-5 all Python 3 library for navigating WADL files ii python3-xdg 0.28-2 all Python 3 library to access freedesktop.org standards ii python3-xkit 0.5.0ubuntu6 all library for the manipulation of xorg.conf files (Python 3) ii python3-yaml 6.0.1-2build2 amd64 YAML parser and emitter for Python3 ii python3.12 3.12.3-1ubuntu0.4 amd64 Interactive high-level object-oriented language (version 3.12) ii python3.12-minimal 3.12.3-1ubuntu0.4 amd64 Minimal subset of the Python language (version 3.12) root@zhang:~# sudo apt remove python3.12

filetype

C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino: In function 'void setupBTController()': C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:52:10: error: 'esp_bt_controller_get_status' was not declared in this scope if (!esp_bt_controller_get_status()) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:52:10: note: suggested alternative: 'esp_intr_alloc_intrstatus' if (!esp_bt_controller_get_status()) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ esp_intr_alloc_intrstatus C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:53:32: error: 'esp_bt_ctrl_config_t' was not declared in this scope esp_bt_controller_init(esp_bt_ctrl_config_t()); ^~~~~~~~~~~~~~~~~~~~ C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:53:32: note: suggested alternative: 'esp_eth_config_t' esp_bt_controller_init(esp_bt_ctrl_config_t()); ^~~~~~~~~~~~~~~~~~~~ esp_eth_config_t C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:53:9: error: 'esp_bt_controller_init' was not declared in this scope esp_bt_controller_init(esp_bt_ctrl_config_t()); ^~~~~~~~~~~~~~~~~~~~~~ C:\Users\Lenovo\AppData\Local\Temp\.arduinoIDE-unsaved2025413-13664-b71xtr.uz16o\sketch_may13a\sketch_may13a.ino:53:9: note: suggested alternative: 'esp_bt_cod_mode_t' esp_bt_controller_init(esp_bt_ctrl_config_t()); ^~~~~~~~~~~~~~~~~~~~~~ esp_bt_cod_mode_t Multiple libraries were found for "BluetoothSerial.h" Used: C:\Users\Lenovo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.12\libraries\BluetoothSerial Not used: C:\Users\Lenovo\Desktop\Arduino\libraries\BluetoothSerial exit status 1 Compilation error: 'esp_bt_controller_get_status' was not declared in this scope

yxwanglh_yeah
  • 粉丝: 0
上传资源 快速赚钱