1、在使用库函数的时候,我对其的调用为: FSMC_SRAM_Init(); FSMC_SRAM_WriteBuffer(TestStr,0,2); FSMC_SRAM_ReadBuffer(ReadStr,0,10); 对其的读写好像不能同时调用进去,同时调用Write和Read的时候,在调试的时候出现了硬件错误的毛病,进入HardFaultException()这个函数中;
2、在调试USART中的时候,有数据发送出来,但是串口调试终端接收到的数据不对,我的波特率还有相关配置都是按照demo来做的。 我的USART的配置为:
/* PLLCLK = 12MHz * 6 = 72 MHz */ RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_6); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO | RCC_APB2Periph_USART1, ENABLE); void USART_Config( void ) { GPIO_InitTypeDef GPIO_InitStructure; USART_InitTypeDef USART_InitStructure;
/* Configure the GPIO ports( USART1 Transmit and Receive Lines) */ /* Configure the USART1_Tx as Alternate function Push-Pull */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Configure the USART1_Rx as input floating */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 ; // GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure);
/* USART1 configuration ------------------------------------------------------*/ /* USART1 configured as follow: - BaudRate = 9600 baud - Word Length = 8 Bits - One Stop Bit - No parity - Hardware flow control disabled (RTS and CTS signals) - Receive and transmit enabled */ USART_InitStructure.USART_BaudRate = 9600; 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;
/* Configure the USART1 */ USART_Init(USART1, &USART_InitStructure);
/* Enable the USART1 */ USART_Cmd(USART1, ENABLE); } 希望高手可以给予解答。
|