#include <stm32f10x_map.h>
//#include <stm32f10x_nvic.h>
//#include "led.h"
//////////////////////////////////////////////////////////////////////////////////
//本程序只供学习使用,未经作者许可,不得用于其它任何用途
//Mini STM32开发板
//LED驱动代码
//正点原子@ALIENTEK
//技术论坛:www.openedv.com
//修改日期:2010/5/27
//版本:V1.0
//版权所有,盗版必究。
//Copyright(C) 正点原子 2009-2019
//All rights reserved
//////////////////////////////////////////////////////////////////////////////////
//初始化PA8和PD2为输出口.并使能这两个口的时钟
//LED IO初始化
int main(void)
{
}
void LED_Init(void)
{
RCC->APB2ENR|=1<<2; //使能PORTA时钟
RCC->APB2ENR|=1<<5; //使能PORTD时钟
GPIOA->CRH&=0XFFFFFFF0;
GPIOA->CRH|=0X00000003;//PA8 推挽输出
GPIOA->ODR|=1<<8; //PA8 输出高
GPIOD->CRL&=0XFFFFF0FF;
GPIOD->CRL|=0X00000300;//PD.2推挽输出
GPIOD->ODR|=1<<2; //PD.2输出高
}
上面这段代码放在main里,报错
Build target 'Templade'
compiling main.c...
linking...
..\OBJ\Template.axf: Error: L6266E: RWPI Section anon$$obj.o(PDT$$ptr) cannot be assigned to non-PI Exec region RW_IRAM1.
..\OBJ\Template.axf: Error: L6266E: RWPI Section system_stm32f10x.o(.data) cannot be assigned to non-PI Exec region RW_IRAM1.
..\OBJ\Template.axf: Error: L6266E: RWPI Section libspace.o(.bss) cannot be assigned to non-PI Exec region RW_IRAM1.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function NMI_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function HardFault_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function MemManage_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function BusFault_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function UsageFault_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function SVC_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function DebugMon_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function PendSV_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(RESET) cannot use the address of 'RWPI' function SysTick_Handler as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(.text) cannot use the address of 'RWPI' function SystemInit as the image contains 'USESV6' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f10x_md.o(.text) cannot use the address of 'RWPI' function __main as the image contains 'USESV6' functions.
Target not created |