OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 6529|回复: 10

STM32F407串口3一直不好使!!!!

[复制链接]

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
57
金钱
57
注册时间
2015-6-9
在线时间
6 小时
发表于 2016-2-25 14:01:59 | 显示全部楼层 |阅读模式
1金钱
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "beep.h"
#include "key.h"


//ALIENTEK ̽Ë÷ÕßSTM32F407¿ª·¢°å ʵÑé4
//´®¿ÚͨÐÅʵÑé -¿âº¯Êý°æ±¾
//¼¼ÊõÖ§³Ö£ºwww.openedv.com
//ÌÔ±¦µêÆÌ£ºhttp://eboard.taobao.com
//¹ãÖÝÊÐÐÇÒíµç×ӿƼ¼ÓÐÏÞ¹«Ë¾  
//×÷ÕߣºÕýµãÔ­×Ó @ALIENTEK




int main(void)
{

u8 t;
u8 len;
u16 times=0;  
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//ÉèÖÃϵͳÖжÏÓÅÏȼ¶·Ö×é2

uart_init(115200); //´®¿Ú³õʼ»¯²¨ÌØÂÊΪ115200
delay_init(168);  //ÑÓʱ³õʼ»¯
//   LED_Init();      //³õʼ»¯ÓëLEDÁ¬½ÓµÄÓ²¼þ½Ó¿Ú  
while(1)
{
  if(USART_RX_STA&0x8000)
  {        
   len=USART_RX_STA&0x3fff;//µÃµ½´Ë´Î½ÓÊÕµ½µÄÊý¾Ý³¤¶È
   printf("\r\nÄú·¢Ë͵ÄÏûϢΪ:\r\n");
   for(t=0;t<len;t++)
   {
    USART_SendData(USART3, USART_RX_BUF[t]);         //&Iuml;ò&acute;&reg;&iquest;&Uacute;1·&cent;&Euml;&Iacute;&Ecirc;&yacute;&frac34;&Yacute;
    while(USART_GetFlagStatus(USART3,USART_FLAG_TC)!=SET);//&micro;&Egrave;&acute;&yacute;·&cent;&Euml;&Iacute;&frac12;á&Ecirc;&oslash;
   }
   printf("\r\n\r\n");//&sup2;&aring;&Egrave;&euml;&raquo;&raquo;&ETH;&ETH;
   USART_RX_STA=0;
  }else
  {
   times++;
   if(times%5000==0)
   {
    printf("\r\nALIENTEK &Igrave;&frac12;&Euml;÷&Otilde;&szlig;STM32F407&iquest;&ordf;·&cent;°&aring; &acute;&reg;&iquest;&Uacute;&Ecirc;&micro;&Ntilde;é\r\n");
    printf("&Otilde;&yacute;&micro;&atilde;&Ocirc;&shy;×&Oacute;@ALIENTEK\r\n\r\n\r\n");
   }
   if(times%200==0)printf("&Ccedil;&euml;&Ecirc;&auml;&Egrave;&euml;&Ecirc;&yacute;&frac34;&Yacute;,&Ograve;&Ocirc;&raquo;&Oslash;&sup3;&micro;&frac14;ü&frac12;á&Ecirc;&oslash;\r\n");  
   if(times%30==0)LED0=!LED0;//&Eacute;&Aacute;&Euml;&cedil;LED,&Igrave;á&Ecirc;&frac34;&Iuml;&micro;&Iacute;&sup3;&Otilde;&yacute;&Ocirc;&Uacute;&Ocirc;&Euml;&ETH;&ETH;.
   delay_ms(10);   
  }
}
}




#include "sys.h"
#include "usart.h"
//////////////////////////////////////////////////////////////////////////////////   
//&Egrave;&ccedil;&sup1;&ucirc;&Ecirc;&sup1;&Oacute;&Atilde;ucos,&Ocirc;ò°ü&Agrave;¨&Iuml;&Acirc;&Atilde;&aelig;&micro;&Auml;&Iacute;·&Icirc;&Auml;&frac14;&thorn;&frac14;&acute;&iquest;&Eacute;.
#if SYSTEM_SUPPORT_UCOS
#include "includes.h"     //ucos &Ecirc;&sup1;&Oacute;&Atilde;   
#endif

#if 1
#pragma import(__use_no_semihosting)            
//±ê×&frac14;&iquest;&acirc;&ETH;è&Ograve;&ordf;&micro;&Auml;&Ouml;§&sup3;&Ouml;&ordm;&macr;&Ecirc;&yacute;                 
struct __FILE
{
int handle;
};

FILE __stdout;      
//&para;¨&Ograve;&aring;_sys_exit()&Ograve;&Ocirc;±&Uuml;&Atilde;&acirc;&Ecirc;&sup1;&Oacute;&Atilde;°&euml;&Ouml;÷&raquo;ú&Auml;&pound;&Ecirc;&frac12;   
_sys_exit(int x)
{
x = x;
}
//&Ouml;&Oslash;&para;¨&Ograve;&aring;fputc&ordm;&macr;&Ecirc;&yacute;
int fputc(int ch, FILE *f)
{  
while((USART3->SR&0X40)==0);//&Ntilde;&shy;&raquo;··&cent;&Euml;&Iacute;,&Ouml;±&micro;&frac12;·&cent;&Euml;&Iacute;&Iacute;ê±&Iuml;   
USART3->DR = (u8) ch;      
return ch;
}
#endif

#if EN_USART3_RX   //&Egrave;&ccedil;&sup1;&ucirc;&Ecirc;&sup1;&Auml;&Uuml;&Aacute;&Euml;&frac12;&Oacute;&Ecirc;&Otilde;
//&acute;&reg;&iquest;&Uacute;1&Ouml;&ETH;&para;&Iuml;·&thorn;&Icirc;&ntilde;&sup3;&Igrave;&ETH;ò
//×&cent;&Ograve;&acirc;,&para;&Aacute;&Egrave;&iexcl;USARTx->SR&Auml;&Uuml;±&Uuml;&Atilde;&acirc;&Auml;&ordf;&Atilde;&ucirc;&AElig;&auml;&Atilde;&icirc;&micro;&Auml;&acute;í&Icirc;ó   
u8 USART_RX_BUF[USART_REC_LEN];     //&frac12;&Oacute;&Ecirc;&Otilde;&raquo;&ordm;&sup3;&aring;,×&icirc;&acute;óUSART_REC_LEN&cedil;&ouml;×&Ouml;&frac12;&Uacute;.
//&frac12;&Oacute;&Ecirc;&Otilde;×&acute;&Igrave;&not;
//bit15&pound;&not; &frac12;&Oacute;&Ecirc;&Otilde;&Iacute;ê&sup3;&Eacute;±ê&Ouml;&frac34;
//bit14&pound;&not; &frac12;&Oacute;&Ecirc;&Otilde;&micro;&frac12;0x0d
//bit13~0&pound;&not; &frac12;&Oacute;&Ecirc;&Otilde;&micro;&frac12;&micro;&Auml;&Oacute;&ETH;&ETH;§×&Ouml;&frac12;&Uacute;&Ecirc;&yacute;&Auml;&iquest;
u16 USART_RX_STA=0;       //&frac12;&Oacute;&Ecirc;&Otilde;×&acute;&Igrave;&not;±ê&frac14;&Ccedil;

//&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;IO &acute;&reg;&iquest;&Uacute;1
//bound:&sup2;¨&Igrave;&Oslash;&Acirc;&Ecirc;
void uart_init(u32 bound){
   //GPIO&para;&Euml;&iquest;&Uacute;&Eacute;è&Ouml;&Atilde;
  GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB,ENABLE); //&Ecirc;&sup1;&Auml;&Uuml;GPIOA&Ecirc;±&Ouml;&Oacute;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,ENABLE);//&Ecirc;&sup1;&Auml;&Uuml;USART1&Ecirc;±&Ouml;&Oacute;

//&acute;&reg;&iquest;&Uacute;1&para;&Ocirc;&Oacute;&brvbar;&Ograve;&yacute;&frac12;&Aring;&cedil;&acute;&Oacute;&Atilde;&Oacute;&sup3;&Eacute;&auml;
GPIO_PinAFConfig(GPIOB,GPIO_PinSource11,GPIO_AF_USART3); //GPIOA9&cedil;&acute;&Oacute;&Atilde;&Icirc;&ordf;USART1
GPIO_PinAFConfig(GPIOB,GPIO_PinSource10,GPIO_AF_USART3); //GPIOA10&cedil;&acute;&Oacute;&Atilde;&Icirc;&ordf;USART1

//USART1&para;&Euml;&iquest;&Uacute;&Aring;&auml;&Ouml;&Atilde;
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_10; //GPIOA9&Oacute;&euml;GPIOA10
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//&cedil;&acute;&Oacute;&Atilde;&sup1;&brvbar;&Auml;&Uuml;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //&Euml;&Ugrave;&para;&Egrave;50MHz
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; //&Iacute;&AElig;&Iacute;ì&cedil;&acute;&Oacute;&Atilde;&Ecirc;&auml;&sup3;&ouml;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; //&Eacute;&Iuml;&Agrave;&shy;
GPIO_Init(GPIOB,&GPIO_InitStructure); //&sup3;&otilde;&Ecirc;&frac14;&raquo;&macrB11&pound;&notB10
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_Init(GPIOB,&GPIO_InitStructure);
GPIO_SetBits(GPIOB,GPIO_Pin_5);//GPIO_Pin_10|GPIO_Pin_11|
   //USART1 &sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&Eacute;è&Ouml;&Atilde;
USART_InitStructure.USART_BaudRate = bound;//&sup2;¨&Igrave;&Oslash;&Acirc;&Ecirc;&Eacute;è&Ouml;&Atilde;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;//×&Ouml;&sup3;¤&Icirc;&ordf;8&Icirc;&raquo;&Ecirc;&yacute;&frac34;&Yacute;&cedil;&ntilde;&Ecirc;&frac12;
USART_InitStructure.USART_StopBits = USART_StopBits_1;//&Ograve;&raquo;&cedil;&ouml;&Iacute;&pound;&Ouml;&sup1;&Icirc;&raquo;
USART_InitStructure.USART_Parity = USART_Parity_No;//&Icirc;&THORN;&AElig;&aelig;&Aring;&frac14;&ETH;&pound;&Ntilde;é&Icirc;&raquo;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//&Icirc;&THORN;&Oacute;&sup2;&frac14;&thorn;&Ecirc;&yacute;&frac34;&Yacute;&Aacute;÷&iquest;&Oslash;&Ouml;&AElig;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //&Ecirc;&Otilde;·&cent;&Auml;&pound;&Ecirc;&frac12;
  USART_Init(USART3, &USART_InitStructure); //&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&acute;&reg;&iquest;&Uacute;1

  USART_Cmd(USART3, ENABLE);  //&Ecirc;&sup1;&Auml;&Uuml;&acute;&reg;&iquest;&Uacute;1

USART_ClearFlag(USART3, USART_FLAG_TC);

#if EN_USART3_RX
USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);//&iquest;&ordf;&AElig;&ocirc;&Iuml;à&sup1;&Oslash;&Ouml;&ETH;&para;&Iuml;

//Usart1 NVIC &Aring;&auml;&Ouml;&Atilde;
  NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;//&acute;&reg;&iquest;&Uacute;1&Ouml;&ETH;&para;&Iuml;&Iacute;¨&micro;&Agrave;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3;//&Ccedil;&Agrave;&Otilde;&frac14;&Oacute;&Aring;&Iuml;&Egrave;&frac14;&para;3
NVIC_InitStructure.NVIC_IRQChannelSubPriority =3;  //×&Oacute;&Oacute;&Aring;&Iuml;&Egrave;&frac14;&para;3
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;   //IRQ&Iacute;¨&micro;&Agrave;&Ecirc;&sup1;&Auml;&Uuml;
NVIC_Init(&NVIC_InitStructure); //&cedil;ù&frac34;&Yacute;&Ouml;&cedil;&para;¨&micro;&Auml;&sup2;&Icirc;&Ecirc;&yacute;&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;VIC&frac14;&Auml;&acute;&aelig;&AElig;÷&iexcl;&cent;

#endif

}


void USART3_IRQHandler(void)                 //&acute;&reg;&iquest;&Uacute;1&Ouml;&ETH;&para;&Iuml;·&thorn;&Icirc;&ntilde;&sup3;&Igrave;&ETH;ò
{
u8 Res;
#ifdef OS_TICKS_PER_SEC   //&Egrave;&ccedil;&sup1;&ucirc;&Ecirc;±&Ouml;&Oacute;&frac12;&Uacute;&Aring;&Auml;&Ecirc;&yacute;&para;¨&Ograve;&aring;&Aacute;&Euml;,&Euml;&micro;&Atilde;÷&Ograve;&ordf;&Ecirc;&sup1;&Oacute;&Atilde;ucosII&Aacute;&Euml;.
OSIntEnter();   
#endif
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)  //&frac12;&Oacute;&Ecirc;&Otilde;&Ouml;&ETH;&para;&Iuml;(&frac12;&Oacute;&Ecirc;&Otilde;&micro;&frac12;&micro;&Auml;&Ecirc;&yacute;&frac34;&Yacute;±&Oslash;&ETH;&euml;&Ecirc;&Ccedil;0x0d 0x0a&frac12;á&Icirc;&sup2;)
{
  Res =USART_ReceiveData(USART3);//(USART1->DR); //&para;&Aacute;&Egrave;&iexcl;&frac12;&Oacute;&Ecirc;&Otilde;&micro;&frac12;&micro;&Auml;&Ecirc;&yacute;&frac34;&Yacute;
  
  if((USART_RX_STA&0x8000)==0)//&frac12;&Oacute;&Ecirc;&Otilde;&Icirc;&acute;&Iacute;ê&sup3;&Eacute;
  {
   if(USART_RX_STA&0x4000)//&frac12;&Oacute;&Ecirc;&Otilde;&micro;&frac12;&Aacute;&Euml;0x0d
   {
    if(Res!=0x0a)USART_RX_STA=0;//&frac12;&Oacute;&Ecirc;&Otilde;&acute;í&Icirc;ó,&Ouml;&Oslash;&ETH;&Acirc;&iquest;&ordf;&Ecirc;&frac14;
    else USART_RX_STA|=0x8000; //&frac12;&Oacute;&Ecirc;&Otilde;&Iacute;ê&sup3;&Eacute;&Aacute;&Euml;
   }
   else //&raquo;&sup1;&Atilde;&raquo;&Ecirc;&Otilde;&micro;&frac12;0X0D
   {
    if(Res==0x0d)USART_RX_STA|=0x4000;
    else
    {
     USART_RX_BUF[USART_RX_STA&0X3FFF]=Res ;
     USART_RX_STA++;
     if(USART_RX_STA>(USART_REC_LEN-1))USART_RX_STA=0;//&frac12;&Oacute;&Ecirc;&Otilde;&Ecirc;&yacute;&frac34;&Yacute;&acute;í&Icirc;ó,&Ouml;&Oslash;&ETH;&Acirc;&iquest;&ordf;&Ecirc;&frac14;&frac12;&Oacute;&Ecirc;&Otilde;   
    }   
   }
  }      
  }
#ifdef OS_TICKS_PER_SEC   //&Egrave;&ccedil;&sup1;&ucirc;&Ecirc;±&Ouml;&Oacute;&frac12;&Uacute;&Aring;&Auml;&Ecirc;&yacute;&para;¨&Ograve;&aring;&Aacute;&Euml;,&Euml;&micro;&Atilde;÷&Ograve;&ordf;&Ecirc;&sup1;&Oacute;&Atilde;ucosII&Aacute;&Euml;.
OSIntExit();              
#endif
}
#endif






最佳答案

查看完整内容[请看2#楼]

void uart3_init(u32 bound){ //GPIO¶Ë¿úéèÖà GPIO_InitTypeDef GPIO_InitStructure; USART_InitTypeDef USART_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD,ENABLE); //ê1ÄüGPIOAê±Öó RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,ENABLE);//ê1ÄüUSART1ê±Öó //′®¿ú1& ...
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

62

主题

902

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3559
金钱
3559
注册时间
2016-1-8
在线时间
543 小时
发表于 2016-2-25 14:02:00 | 显示全部楼层
董董 发表于 2016-6-14 16:58
怎么重映射,能给个代码吗?最近在调试串口3,没调通。谢谢


void uart3_init(u32 bound){
   //GPIO&#182;&#203;&#191;úéè&#214;&#195;
  GPIO_InitTypeDef GPIO_InitStructure;
        USART_InitTypeDef USART_InitStructure;
        NVIC_InitTypeDef NVIC_InitStructure;
       
        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD,ENABLE); //ê1&#196;üGPIOAê±&#214;ó
        RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,ENABLE);//ê1&#196;üUSART1ê±&#214;ó

        //′&#174;&#191;ú1&#182;&#212;ó|òy&#189;&#197;&#184;′ó&#195;ó3é&#228;
        GPIO_PinAFConfig(GPIOD,GPIO_PinSource8,GPIO_AF_USART1); //GPIOA9&#184;′ó&#195;&#206;aUSART1
        GPIO_PinAFConfig(GPIOD,GPIO_PinSource9,GPIO_AF_USART1); //GPIOA10&#184;′ó&#195;&#206;aUSART1
       
        //USART1&#182;&#203;&#191;ú&#197;&#228;&#214;&#195;
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9; //GPIOA9ó&#235;GPIOA10
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//&#184;′ó&#195;1|&#196;ü
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;        //&#203;ù&#182;è50MHz
        GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; //í&#198;íì&#184;′ó&#195;ê&#228;3&#246;
        GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; //é&#207;à-
        GPIO_Init(GPIOD,&GPIO_InitStructure); //3&#245;ê&#188;&#187;ˉPA9£&#172A10

   //USART1 3&#245;ê&#188;&#187;ˉéè&#214;&#195;
        USART_InitStructure.USART_BaudRate = bound;//2¨ì&#216;&#194;êéè&#214;&#195;
        USART_InitStructure.USART_WordLength = USART_WordLength_8b;//×&#214;3¤&#206;a8&#206;&#187;êy&#190;Y&#184;&#241;ê&#189;
        USART_InitStructure.USART_StopBits = USART_StopBits_1;//ò&#187;&#184;&#246;í£&#214;1&#206;&#187;
        USART_InitStructure.USART_Parity = USART_Parity_No;//&#206;T&#198;&#230;&#197;&#188;D£&#209;é&#206;&#187;
        USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//&#206;Tó2&#188;têy&#190;Yá÷&#191;&#216;&#214;&#198;
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;        //ê&#213;·¢&#196;£ê&#189;
  USART_Init(USART3, &USART_InitStructure); //3&#245;ê&#188;&#187;ˉ′&#174;&#191;ú1
       
  USART_Cmd(USART3, ENABLE);  //ê1&#196;ü′&#174;&#191;ú1
       
        //USART_ClearFlag(USART1, USART_FLAG_TC);
       

        USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);//&#191;a&#198;&#244;&#207;à1&#216;&#214;D&#182;&#207;

        //Usart1 NVIC &#197;&#228;&#214;&#195;
  NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;//′&#174;&#191;ú1&#214;D&#182;&#207;í¨μà
        NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=2;//&#199;à&#213;&#188;ó&#197;&#207;è&#188;&#182;3
        NVIC_InitStructure.NVIC_IRQChannelSubPriority =1;                //×óó&#197;&#207;è&#188;&#182;3
        NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;                        //IRQí¨μàê1&#196;ü
        NVIC_Init(&NVIC_InitStructure);        //&#184;ù&#190;Y&#214;&#184;&#182;¨μ&#196;2&#206;êy3&#245;ê&#188;&#187;ˉVIC&#188;&#196;′&#230;&#198;÷&#161;¢


       
}
回复

使用道具 举报

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
57
金钱
57
注册时间
2015-6-9
在线时间
6 小时
 楼主| 发表于 2016-2-25 14:02:29 | 显示全部楼层
醉了还是乱码
回复

使用道具 举报

15

主题

786

帖子

5

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
3223
金钱
3223
注册时间
2015-7-26
在线时间
811 小时
发表于 2016-2-25 14:29:07 | 显示全部楼层
我晕,你上段这样的代码能说明什么,直接说明一下出现的问题就好了,另外麻烦你粘贴代码的时候更换下编译器的字体吧
我的博客:http://blog.csdn.net/itdo_just
回复

使用道具 举报

62

主题

902

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3559
金钱
3559
注册时间
2016-1-8
在线时间
543 小时
发表于 2016-2-25 14:54:23 | 显示全部楼层
串口3,需要重映射,加一句代码就可以了
回复

使用道具 举报

15

主题

118

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3059
金钱
3059
注册时间
2015-12-20
在线时间
299 小时
发表于 2016-6-14 16:58:10 | 显示全部楼层
Sun_Fly 发表于 2016-2-25 14:54
串口3,需要重映射,加一句代码就可以了

怎么重映射,能给个代码吗?最近在调试串口3,没调通。谢谢
回复

使用道具 举报

62

主题

902

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3559
金钱
3559
注册时间
2016-1-8
在线时间
543 小时
发表于 2016-6-14 17:29:08 | 显示全部楼层
Sun_Fly 发表于 2016-6-14 17:28
void uart3_init(u32 bound){
   //GPIO&#182;&#203;&#191;úéè&#214;&#195;
  GPIO_InitTypeDef G ...

我代码中的,肯定通,不通就是你硬件问题了
回复

使用道具 举报

62

主题

902

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3559
金钱
3559
注册时间
2016-1-8
在线时间
543 小时
发表于 2016-6-14 17:29:24 | 显示全部楼层
Sun_Fly 发表于 2016-6-14 17:29
我代码中的,肯定通,不通就是你硬件问题了

这是F407的
回复

使用道具 举报

15

主题

118

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3059
金钱
3059
注册时间
2015-12-20
在线时间
299 小时
发表于 2016-6-16 09:14:21 | 显示全部楼层

我的还是不通,能给个你的全部代码吗?
回复

使用道具 举报

15

主题

118

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3059
金钱
3059
注册时间
2015-12-20
在线时间
299 小时
发表于 2016-6-16 09:14:52 | 显示全部楼层

我的板子也是F407的
回复

使用道具 举报

62

主题

902

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
3559
金钱
3559
注册时间
2016-1-8
在线时间
543 小时
发表于 2016-6-16 18:03:31 | 显示全部楼层
董董 发表于 2016-6-16 09:14
我的板子也是F407的

如果还是不通就是你硬件问题了,看看中断优先级对不对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-2-27 14:05

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表