OpenEdv-开源电子网

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

按照第4讲,建立MDK STM32的工程模板,报错,

[复制链接]

32

主题

77

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
225
金钱
225
注册时间
2014-1-4
在线时间
0 小时
发表于 2014-2-2 16:44:23 | 显示全部楼层 |阅读模式
..\OBJ\Template.axf: Error: L6218E: Undefined symbol main (referred from rtentry2.o).

按照第4讲,基于MDK的  STM32的工程模板,报错,怎样解决
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

32

主题

77

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
225
金钱
225
注册时间
2014-1-4
在线时间
0 小时
 楼主| 发表于 2014-2-2 16:58:55 | 显示全部楼层
 在代码最后加回车符号,怎样加
回复 支持 反对

使用道具 举报

32

主题

77

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
225
金钱
225
注册时间
2014-1-4
在线时间
0 小时
 楼主| 发表于 2014-2-2 20:54:39 | 显示全部楼层
 我用的是Mini型的板,用开发板例程,放到工程里还是报错
回复 支持 反对

使用道具 举报

17

主题

470

帖子

1

精华

高级会员

Rank: 4

积分
718
金钱
718
注册时间
2013-11-23
在线时间
0 小时
发表于 2014-2-2 23:03:21 | 显示全部楼层
回复【4楼】万水千山:
---------------------------------
int main(void)
回复 支持 反对

使用道具 举报

32

主题

77

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
225
金钱
225
注册时间
2014-1-4
在线时间
0 小时
 楼主| 发表于 2014-2-2 23:34:04 | 显示全部楼层

#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

回复 支持 反对

使用道具 举报

32

主题

77

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
225
金钱
225
注册时间
2014-1-4
在线时间
0 小时
 楼主| 发表于 2014-2-3 12:18:12 | 显示全部楼层

我按照 基于STM32固件库V3.5建立keil工程详细步骤.pdf,

main.c文件里输入

        #include "stm32f10x.h"

       int main(void)
  {
       while(1)
      {
           ;
      }
   }
 编译报错:
显示Build target 'Template'
compiling main.c...
*** Error: Referred Memory Range 'ROM1' is undefined.
Target not created


 

回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-12 19:08

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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