tmp/ccZtObe3.s: Assembler messages:
/tmp/ccZtObe3.s:25: Error: selected processor does not supportwfi’ in ARM mode
/tmp/ccZtObe3.s:43: Error: selected processor does not support cpsid i' in ARM mode
/tmp/ccZtObe3.s:61: Error: selected processor does not supportcpsie i’ in ARM mode
/tmp/ccZtObe3.s:81: Error: selected processor does not support requested special purpose register – msr MSP,r0'
直接google 错误结果,找到这个提问c - Error: selected processor does not support ARM mode `wfi’;按照其中回答,需要加上
-mcpu=cortex-m3 -mthumb -mno-thumb-interwork -mfpu=vfp -msoft-float -mfix-cortex-m3-ldrd
这些编译参数。
于是修改主目录下的CMakeLists.txt文件,加上这一句
set(CMAKE_C_FLAGS "-mcpu=cortex-m3 -mthumb -mno-thumb-interwork -mfpu=vfp -msoft-float -mfix-cortex-m3-ldrd")
然后 cd build&&cmake ..&make
咔,这个错误没了!!!!!!
然而…….
/home/b/workspace/stm32/share/usart.c:91:3: error: unknown type name 'GPIO_InitTypeDef'
GPIO_InitTypeDef GPIO_InitStructure;
^
/home/b/workspace/stm32/share/usart.c:92:2: error: unknown type name 'USART_InitTypeDef'
USART_InitTypeDef USART_InitStructure;
^
/home/b/workspace/stm32/share/usart.c:93:2: error: unknown type name 'NVIC_InitTypeDef'
NVIC_InitTypeDef NVIC_InitStructure;
^
/home/b/workspace/stm32/share/usart.c:95:25: error: 'RCC_APB2Periph_USART1' undeclared (first use in this function)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE); //ʹ��USART1��GPIOAʱ��
^
/home/b/workspace/stm32/share/usart.c:95:25: note: each undeclared identifier is reported only once for each function it appears in
/home/b/workspace/stm32/share/usart.c:95:47: error: 'RCC_APB2Periph_GPIOA' undeclared (first use in this function)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE); //ʹ��USART1��GPIOAʱ��
^
/home/b/workspace/stm32/share/usart.c:98:21: error: request for member 'GPIO_Pin' in something not a structure or union
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
^
/home/b/workspace/stm32/share/usart.c:98:33: error: 'GPIO_Pin_9' undeclared (first use in this function)
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
^
/home/b/workspace/stm32/share/usart.c:99:21: error: request for member 'GPIO_Speed' in something not a structure or union
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
^
/home/b/workspace/stm32/share/usart.c:99:35: error: 'GPIO_Speed_50MHz' undeclared (first use in this function)
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
^
/home/b/workspace/stm32/share/usart.c:100:21: error: request for member 'GPIO_Mode' in something not a structure or union
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //������������
^
/home/b/workspace/stm32/share/usart.c:100:34: error: 'GPIO_Mode_AF_PP' undeclared (first use in this function)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //������������
^
/home/b/workspace/stm32/share/usart.c:104:21: error: request for member 'GPIO_Pin' in something not a structure or union
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//PA10
^
/home/b/workspace/stm32/share/usart.c:104:33: error: 'GPIO_Pin_10' undeclared (first use in this function)
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//PA10
^
/home/b/workspace/stm32/share/usart.c:105:21: error: request for member 'GPIO_Mode' in something not a structure or union
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//��������
^
/home/b/workspace/stm32/share/usart.c:105:34: error: 'GPIO_Mode_IN_FLOATING' undeclared (first use in this function)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//��������
^
/home/b/workspace/stm32/share/usart.c:109:21: error: request for member 'NVIC_IRQChannel' in something not a structure or union
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
^
/home/b/workspace/stm32/share/usart.c:110:20: error: request for member 'NVIC_IRQChannelPreemptionPriority' in something not a structure or union
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3 ;//��ռ���ȼ�3
^
/home/b/workspace/stm32/share/usart.c:111:20: error: request for member 'NVIC_IRQChannelSubPriority' in something not a structure or union
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //�����ȼ�3
^
/home/b/workspace/stm32/share/usart.c:112:20: error: request for member 'NVIC_IRQChannelCmd' in something not a structure or union
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQͨ��ʹ��
^
/home/b/workspace/stm32/share/usart.c:117:21: error: request for member 'USART_BaudRate' in something not a structure or union
USART_InitStructure.USART_BaudRate = bound;//���ڲ�����
^
/home/b/workspace/stm32/share/usart.c:118:21: error: request for member 'USART_WordLength' in something not a structure or union
USART_InitStructure.USART_WordLength = USART_WordLength_8b;//�ֳ�Ϊ8λ���ݸ�ʽ
^
/home/b/workspace/stm32/share/usart.c:118:41: error: 'USART_WordLength_8b' undeclared (first use in this function)
USART_InitStructure.USART_WordLength = USART_WordLength_8b;//�ֳ�Ϊ8λ���ݸ�ʽ
^
/home/b/workspace/stm32/share/usart.c:119:21: error: request for member 'USART_StopBits' in something not a structure or union
USART_InitStructure.USART_StopBits = USART_StopBits_1;//һ��ֹͣλ
^
/home/b/workspace/stm32/share/usart.c:119:39: error: 'USART_StopBits_1' undeclared (first use in this function)
USART_InitStructure.USART_StopBits = USART_StopBits_1;//һ��ֹͣλ
^
/home/b/workspace/stm32/share/usart.c:120:21: error: request for member 'USART_Parity' in something not a structure or union
USART_InitStructure.USART_Parity = USART_Parity_No;//����żУ��λ
^
/home/b/workspace/stm32/share/usart.c:120:37: error: 'USART_Parity_No' undeclared (first use in this function)
USART_InitStructure.USART_Parity = USART_Parity_No;//����żУ��λ
^
/home/b/workspace/stm32/share/usart.c:121:21: error: request for member 'USART_HardwareFlowControl' in something not a structure or union
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//��Ӳ������������
^
/home/b/workspace/stm32/share/usart.c:121:50: error: 'USART_HardwareFlowControl_None' undeclared (first use in this function)
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//��Ӳ������������
^
/home/b/workspace/stm32/share/usart.c:122:21: error: request for member 'USART_Mode' in something not a structure or union
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //�շ�ģʽ
^
/home/b/workspace/stm32/share/usart.c:122:35: error: 'USART_Mode_Rx' undeclared (first use in this function)
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //�շ�ģʽ
^
/home/b/workspace/stm32/share/usart.c:122:51: error: 'USART_Mode_Tx' undeclared (first use in this function)
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //�շ�ģʽ
^
/home/b/workspace/stm32/share/usart.c:125:26: error: 'USART_IT_RXNE' undeclared (first use in this function)
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//�������ڽ����ж�
^
/home/b/workspace/stm32/share/usart.c: In function 'USART1_IRQHandler':
/home/b/workspace/stm32/share/usart.c:136:31: error: 'USART_IT_RXNE' undeclared (first use in this function)
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) //�����ж�(���յ������ݱ�����0x0d 0x0a��β)
一下给我蹦出这么多东西,还全是乱码….
我要睡午觉了,明天再说…