Contiki编译错误,“错误:地址0x820003超出范围的行1740的...” [英] Contiki compile error, " ERROR: address 0x820003 out of range at line 1740 of..."

查看:104
本文介绍了Contiki编译错误,“错误:地址0x820003超出范围的行1740的...”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在atmel atmega128rfa1上使用contiki操作系统。
我可以编译我的示例,但是十六进制文件不好。错误是:
错误:地址0x820003超出ipso.hex的第1740行的范围(我未使用IPSO,只是我保留了此名称)。

I started to use contiki operating system with atmel atmega128rfa1. I can compile my example, but the hex file is bad. The error is: ERROR: address 0x820003 out of range at line 1740 of ipso.hex (i am not using IPSO, just i kept this name).

在linux系统中编译时,程序大小为27804字节,数据为4809byte。

When I compile in linux system the code is program size is 27804 byte and the data is 4809byte.

在Windows中编译时,程序为28292,数据为4791

When I compile in windows the program is 28292 and the data is 4791.

我只使用一个进程和一个etimer,我想打开和关闭1个led。
的makefile包含以下内容:
`

I use only one process and one etimer, I would like to turn on and off 1 led. the makefile consinst of: `

TARGET=avr-atmega128rfa1
CONTIKI = ../..
include $(CONTIKI)/Makefile.include

all: 
make -f Makefile.ipso TARGET=avr-atmega128rfa1 ipso.elf 
avr-objcopy -O ihex -R .eeprom ipso.elf ipso.hex 
avr-size -C --mcu=atmega128rfa1 ipso.elf `

我无法对控制器进行编程。有什么问题?

i can't program the controller. What is the problem?

谢谢。

推荐答案

特殊部分.elf文件中的文件从0x810000开始,并且在生成用于对特定内存进行编程的十六进制文件时必须将其删除,例如

Special sections in the .elf file start above 0x810000 and must be removed when generating a hex file for programming a particular memory, e.g.

$ avr-objdump -h webserver6.avr-atmega128rfa1

webserver6.avr-atmega128rfa1:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         00001bda  00800200  0000e938  0000ea2c  2**0
              CONTENTS, ALLOC, LOAD, DATA
  1 .text         0000e938  00000000  00000000  000000f4  2**1
              CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .bss          000031a6  00801dda  00801dda  00010606  2**0
              ALLOC
  3 .eeprom       00000029  00810000  00810000  00010606  2**0
              CONTENTS, ALLOC, LOAD, DATA
  4 .fuse         00000003  00820000  00820000  0001062f  2**0
              CONTENTS, ALLOC, LOAD, DATA
  5 .signature    00000003  00840000  00840000  00010632  2**0
              CONTENTS, ALLOC, LOAD, READONLY, DATA

所以,

avr-objcopy -O ihex -R .eeprom -R .fuse -R signature ipso.elf ipso.hex

或者,仅复制所需的部分:

alternately, only copy the desired sections:

avr-objcopy -O ihex -j .text -j .data ipso.elf ipso.hex

这篇关于Contiki编译错误,“错误:地址0x820003超出范围的行1740的...”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆