Silicon Laboratories 에서 build 된 hex 파일을 다운로드 할 때 Warning message
Warning! An attempt was made to modify address 2200 which is restricted!
Continue download?
말 그대로 수정이 금지된 메모리 주소인 2200 을 수정하려고 한다는 이미이며
실제 사용 가능하지 않는 메모리 영역에 쓰려고 할 때 이 문제가 발생 하였다.
구체적으로는 어떤 상황이었나면
1. C8051F582(64k flash) 에서 사용하던 코드를 C8051F547(8k flash) 에서 사용하려고 해서 위 Warning이 떴고 실제 Code영역의 크기가 10k 를 넘었다.
2. 프로그램의 버전을 Linker 의 옵션으로 주었고 "CODE(?CO?VER(0x7FF6))" 이 때 사용하는 영역인 0x7FF6 이 사용 가능한 메모리 크기를 넘어 위 메시지가 떴다.
2018년 2월 26일 월요일
2018년 2월 23일 금요일
Cross Compiler
크로스 컴파일러(cross compiler)는 컴파일러가 실행되는 플랫폼이 아닌 다른 플랫폼에서 실행 가능한 코드를 생성할 수 있는 컴파일러이다. 크로스 컴파일러 툴은 임베디드 시스템 혹은 여러 플랫폼에서 실행파일을 생성하는데 사용된다. 이것은 운영 체제를 지원하지 않는 마이크로컨트롤러와 같이 컴파일이 실현 불가능한 플랫폼에 컴파일하는데 사용된다. 이것은 시스템이 사용하는데 하나 이상의 플랫폼을 쓰는 반가상화에 이 도구를 사용하는 것이 더 일반적이게 되었다.
내 PC에서 Compile 할 때 특정 Chip 에서 돌아가는 명령을 만들고 싶다면(Assembly, Binary) 해당 Chip 에서 받아들일 수 있는 명령을 만드는 Compiler를 만들어야 한다.
내 PC에서 Compile 할 때 특정 Chip 에서 돌아가는 명령을 만들고 싶다면(Assembly, Binary) 해당 Chip 에서 받아들일 수 있는 명령을 만드는 Compiler를 만들어야 한다.
2017년 11월 29일 수요일
Memory demystify
Program Size: data=109.5 xdata=256 const=3503 code=4401
LX51 RUN COMPLETE. 0 WARNING(S), 0 ERROR(S)
두 개의 Gap 을 빼면 109.5 byte 이다.
모두 더하면 256 byte 이다.
0 및 - 를 제외한 것을 모두 더하면 7901 여서 빌드 결과인 7904와 3 byte 다르다.
?CO? CONST:
- ?CO?SERDES: 3495
- ?CO?FLASH: 8
을 더하면 3503 이 되므로 이것이 Build 결과와 같은것 같다.
?PR? CODE
LX51 RUN COMPLETE. 0 WARNING(S), 0 ERROR(S)
START STOP
LENGTH ALIGN RELOC
MEMORY CLASS SEGMENT NAME
=========================================================================
* * * * * * *
* * * * D A T A M E M O R Y
* * * * * * * * * * * * *
000000H 000007H
000008H --- AT..
DATA "REG BANK
0"
000008H 000009H
000002H BYTE UNIT
DATA
?DT?_FLASH_BYTEWRITE?FLASH
00000AH 00000BH
000002H BYTE UNIT
DATA
?DT?_FLASH_BYTEREAD?FLASH
00000CH 00000DH
000002H BYTE UNIT
DATA
?DT?_FLASH_PAGEERASE?FLASH
00000EH.0
00001FH.7 000012H.0 --- --- **GAP**
000020H.0
000020H.0 000000H.1 BIT UNIT BIT ?BI?_FLASH_BYTEWRITE?FLASH
000020H.1
000020H.1 000000H.1 BIT UNIT BIT ?BI?_FLASH_BYTEREAD?FLASH
000020H.2
000020H.2 000000H.1 BIT UNIT BIT ?BI?_FLASH_PAGEERASE?FLASH
000020H.3
000020H.3 000000H.1 BIT UNIT BIT ?BI?SMBUS0_ISR?SMB
000020H.4
000020H.4 000000H.1 BIT UNIT BIT ?BI?SMB
000020H.5
000020H 000000H.3 --- ---
**GAP**
000021H 00007EH
00005EH BYTE UNIT
DATA ?DT?DATAMANAGER
00007FH 00007FH
000001H BYTE UNIT
IDATA ?STACK
두 개의 Gap 을 빼면 109.5 byte 이다.
* * * * * * *
* * * * X D A T A M E M O R Y
* * * * * * * * * * * * *
000000H 000040H
000041H BYTE UNIT
XDATA ?XD?DATAMANAGER
000041H 000078H
000038H BYTE UNIT
XDATA ?XD?UART
000079H 000092H
00001AH BYTE UNIT
XDATA ?XD?SMB
000093H 00009BH
000009H BYTE UNIT
XDATA
?XD?_FLASH_WRITE?FLASH
00009CH 0000A4H
000009H BYTE UNIT
XDATA
?XD?_FLASH_READ?FLASH
0000A5H 0000ADH
000009H BYTE UNIT
XDATA ?XD?_DATAMANAGER_FILLBUFFER?DATAMANAGER
0000AEH 0000B6H
000009H BYTE UNIT
XDATA
?XD?SERDES_INITPROCA?SERDES
0000B7H 0000BEH
000008H BYTE UNIT
XDATA
?XD?FLASH_INIT?FLASH
0000BFH 0000C6H
000008H BYTE UNIT
XDATA
?XD?_TIMER_REVOCABLEDELAY?TIMER
0000C7H 0000CDH
000007H BYTE UNIT
XDATA ?XD?TIMER
0000CEH 0000D4H
000007H BYTE UNIT
XDATA
?XD?_BYTE2HEX?COMMON
0000D5H 0000DAH
000006H BYTE UNIT
XDATA
?XD?_SMB_WRITEREGISTER?SMB
0000DBH 0000E0H
000006H BYTE UNIT
XDATA
?XD?_SERDES_READREGISTER?SERDES
0000E1H 0000E5H
000005H BYTE UNIT
XDATA
?XD?_SERDES_WRITEREGISTER?SERDES
0000E6H 0000E9H
000004H BYTE UNIT
XDATA
?XD?_SMB_READREGISTER?SMB
0000EAH 0000EDH
000004H BYTE UNIT
XDATA
?XD?_TIMER_DELAY?TIMER
0000EEH 0000F1H
000004H BYTE UNIT
XDATA ?XD?_UART_TX?UART
0000F2H 0000F4H
000003H BYTE UNIT
XDATA
?XD?_SMB_SLAVETXDATA?SMB
0000F5H 0000F7H
000003H BYTE UNIT
XDATA
?XD?_DATAMANAGER_CLRBUFFER?DATAMANAGER
0000F8H 0000F9H
000002H BYTE UNIT
XDATA ?XD?EXTINT
0000FAH 0000FBH
000002H BYTE UNIT
XDATA
?XD?SERDES_INITPROCC?SERDES
0000FCH 0000FCH
000001H BYTE UNIT
XDATA
?XD?_FLASH_BYTEWRITE?FLASH
0000FDH 0000FDH
000001H BYTE UNIT
XDATA ?XD?_SMB_INIT?SMB
0000FEH 0000FEH
000001H BYTE UNIT
XDATA ?XD?MAIN
0000FFH 0000FFH
000001H BYTE UNIT
XDATA ?XD?SERDES
모두 더하면 256 byte 이다.
* * * * * * *
* * * * C O D E M E M O R Y
* * * * * * * * * * * * *
000000H 000002H
000003H --- OFFS..
CODE ?CO?SILABS_STARTUP?3
000003H 000005H
000003H BYTE OFFS..
CODE ?EXTINT?00003
000006H 000009H
000004H BYTE UNIT
CODE
?PR?MCU_RSTSRC_INIT?MCU
00000AH 00000AH
000001H --- ---
**GAP**
00000BH 00000DH
000003H BYTE OFFS..
CODE ?TIMER?0000B
00000EH 000022H
000015H BYTE UNIT
CODE ?C_INITSEG
000023H 000025H
000003H BYTE OFFS..
CODE ?UART?00023
000026H 00003AH
000015H BYTE UNIT CODE ?PR?MCU_INIT?MCU
00003BH 00003DH
000003H BYTE OFFS..
CODE ?SMB?0003B
00003EH 000072H
000035H BYTE UNIT
CODE
?PR?_FLASH_BYTEWRITE?FLASH
000073H 000075H
000003H BYTE OFFS..
CODE ?TIMER?00073
000076H 000213H
00019EH BYTE UNIT
CODE
?PR?DATAMANAGER_TRANSMITDATATODISPLAY?DATAMANAGER
000214H 0003ABH
000198H BYTE UNIT
CODE ?C?LIB_CODE
0003ACH 00045EH
0000B3H BYTE UNIT
CODE ?PR?_BYTE2HEX?COMMON
00045FH 000508H
0000AAH BYTE UNIT
CODE
?PR?_SMB_WRITEREGISTER?SMB
000509H 0005ACH
0000A4H BYTE UNIT
CODE
?PR?SERDES_INITPROCC?SERDES
0005ADH 000640H
000094H BYTE UNIT
CODE ?PR?_SERDES_WRITEREGISTER?SERDES
000641H 0006D1H
000091H BYTE UNIT
CODE ?PR?SMBUS0_ISR?SMB
0006D2H 00075DH
00008CH BYTE UNIT
CODE ?C_C51STARTUP
00075EH 0007E2H
000085H BYTE UNIT
CODE ?PR?UART0_ISR?UART
0007E3H 000858H
000076H BYTE UNIT
CODE
?PR?_SMB_READREGISTER?SMB
000859H 0008C3H
00006BH BYTE UNIT
CODE
?PR?_FLASH_READ?FLASH
0008C4H 000928H
000065H BYTE UNIT
CODE
?PR?_FLASH_WRITE?FLASH
000929H 00098CH
000064H BYTE UNIT
CODE ?PR?_UART_TX?UART
00098DH 0009F0H
000064H BYTE UNIT
CODE
?PR?_DATAMANAGER_FILLBUFFER?DATAMANAGER
0009F1H 000A4CH
00005CH BYTE UNIT
CODE
?PR?_TIMER_REVOCABLEDELAY?TIMER
LX51
LINKER/LOCATER V4.66.30.0
11/29/2017 18:16:47 PAGE 3
000A4DH 000AA1H
000055H BYTE UNIT CODE ?PR?_SERDES_READREGISTER?SERDES
000AA2H 000AF5H
000054H BYTE UNIT
CODE ?PR?SMB_TX?SMB
000AF6H 000B48H
000053H BYTE UNIT
CODE
?PR?DATAMANAGER_CHECKSMBMESSAGE?DATAMANAGER
000B49H 000B97H
00004FH BYTE UNIT
CODE
?PR?SERDES_INIT?SERDES
000B98H 000BE2H
00004BH BYTE UNIT
CODE
?PR?TIMER0_ISR?TIMER
000BE3H 000C27H
000045H BYTE UNIT
CODE
?PR?_SMB_SLAVETXDATA?SMB
000C28H 000C6CH
000045H BYTE
UNIT CODE ?PR?SERDES_INITPROCA?SERDES
000C6DH 000CAAH
00003EH BYTE UNIT
CODE
?PR?TIMER3_ISR?TIMER
000CABH 000CE6H
00003CH BYTE UNIT
CODE
?PR?FLASH_INIT?FLASH
000CE7H 000D1DH
000037H BYTE UNIT
CODE ?CO?DATAMANAGER
000D1EH 000D4FH
000032H BYTE UNIT
CODE
?PR?_DATAMANAGER_CLRBUFFER?DATAMANAGER
000D50H 000D7EH
00002FH BYTE UNIT
CODE
?PR?_FLASH_PAGEERASE?FLASH
000D7FH 000DACH
00002EH BYTE UNIT
CODE
?PR?_TIMER_DELAY?TIMER
000DADH 000DD5H
000029H BYTE UNIT
CODE
?PR?DATAMANAGER_CHECKINT0MESSAGE?DATAMANAGER
000DD6H 000DFCH
000027H BYTE UNIT
CODE
?PR?SMB_CLEARDATA?SMB
000DFDH 000E23H
000027H BYTE UNIT
CODE ?PR?SMB_RX?SMB
000E24H 000E48H
000025H BYTE UNIT
CODE ?PR?SMB_STX?SMB
000E49H 000E6DH
000025H BYTE UNIT
CODE
?PR?MAIN_BASETASK?MAIN
000E6EH 000E92H
000025H BYTE UNIT
CODE
?PR?MAIN_SCHEDULER?MAIN
000E93H 000EB6H
000024H BYTE UNIT
CODE
?PR?SMB_SADDRCHECK?SMB
000EB7H 000ED9H
000023H BYTE UNIT
CODE ?PR?_SMB_INIT?SMB
000EDAH 000EF8H
00001FH BYTE UNIT
CODE
?PR?SERDES_INITPROCD?SERDES
000EF9H 000F14H
00001CH BYTE UNIT
CODE ?PR?UART_INIT?UART
000F15H 000F2EH
00001AH BYTE UNIT
CODE
?PR?_PORT_1_CHANGECONFIG?PORT
000F2FH 000F47H
000019H BYTE UNIT
CODE ?PR?SMB_START?SMB
000F48H 000F60H
000019H BYTE UNIT
CODE
?PR?TIMER_0_INIT?TIMER
000F61H 000F77H
000017H BYTE UNIT
CODE ?PR?INT0_ISR?EXTINT
000F78H 000F8DH
000016H BYTE UNIT
CODE ?PR?_FLASH_BYTEREAD?FLASH
000F8EH 000FA1H
000014H BYTE UNIT
CODE ?PR?SMB_READ?SMB
000FA2H 000FB5H
000014H BYTE UNIT
CODE ?PR?SMB_SRX?SMB
000FB6H 000FC9H
000014H BYTE UNIT
CODE
?PR?UART_TXBUFCLEAR?UART
000FCAH 000FDBH
000012H BYTE UNIT
CODE
?PR?SERDES_INITPROCB?SERDES
000FDCH 000FECH
000011H BYTE UNIT
CODE
?PR?MAIN_INITTASK?MAIN
000FEDH 000FFCH
000010H BYTE UNIT
CODE
?PR?EXTINT_INIT?EXTINT
000FFDH 00100CH
000010H BYTE UNIT
CODE
?PR?TIMER_1_INIT?TIMER
00100DH 00101CH
000010H BYTE UNIT
CODE
?PR?TIMER_2_INIT?TIMER
00101DH 00102BH
00000FH BYTE UNIT
CODE ?PR?SMB_RESET?SMB
00102CH 00103AH
00000FH BYTE UNIT
CODE
?PR?TIMER_INIT?TIMER
00103BH 001048H
00000EH BYTE UNIT
CODE ?CO?MAIN
001049H 001056H
00000EH BYTE UNIT
CODE ?PR?DATAMANAGER_INIT?DATAMANAGER
001057H 001063H
00000DH BYTE UNIT
CODE ?PR?SMB_WRITE?SMB
001064H 001070H
00000DH BYTE UNIT
CODE
?PR?SMB_WAITBUSY?SMB
001071H 00107DH
00000DH BYTE UNIT
CODE ?PR?TIMER_3_INIT?TIMER
00107EH 001089H
00000CH BYTE UNIT
CODE
?PR?_SMB_RCVEVENTADD?SMB
00108AH 001093H
00000AH BYTE UNIT
CODE
?PR?PORT_0_INIT?PORT
001094H 00109CH
000009H BYTE UNIT
CODE ?PR?PORT_INIT?PORT
00109DH 0010A5H
000009H BYTE UNIT
CODE
?PR?TIMER_GETDELAYCOUNT?TIMER
0010A6H 0010AEH
000009H BYTE UNIT
CODE
?PR?TIMER_GETSCHEDULECOUNT500MS?TIMER
0010AFH 0010B7H
000009H BYTE UNIT
CODE
?PR?TIMER_GETSCHEDULECOUNT1000MS?TIMER
0010B8H 0010BFH
000008H BYTE UNIT
CODE
?PR?TIMER_CLEARDELAYCOUNT?TIMER
0010C0H 0010C7H
000008H BYTE UNIT
CODE ?PR?TIMER_CLEARSCHEDULECOUNT500MS?TIMER
0010C8H 0010CFH
000008H BYTE UNIT
CODE
?PR?TIMER_CLEARSCHEDULECOUNT1000MS?TIMER
0010D0H 0010D7H
000008H BYTE UNIT
CODE
?PR?MCU_PERIPHERALINIT?MCU
0010D8H 0010DEH
000007H BYTE UNIT
CODE
?PR?PORT_1_INIT?PORT
0010DFH 0010E5H
000007H BYTE UNIT
CODE ?PR?XBAR_INIT?PORT
0010E6H 0010ECH
000007H BYTE UNIT
CODE
?PR?SMB_GETSMBBUSY?SMB
0010EDH 0010F3H
000007H BYTE UNIT
CODE
?PR?TIMER_CLK_INIT?TIMER
0010F4H 0010FAH
000007H BYTE UNIT
CODE
?PR?MCU_WDT_INIT?MCU
0010FBH 001101H
000007H BYTE UNIT
CODE
?PR?GLBINT_INIT?GLBINT
001102H 001107H
000006H BYTE UNIT CODE ?PR?SMB_GETFOUNDSLAFLAG?SMB
001108H 00110DH
000006H BYTE UNIT
CODE
?PR?SMB_GETFOUNDSLAADDR?SMB
00110EH 001113H
000006H BYTE UNIT
CODE
?PR?SMB_CLEARFOUNDSLAFLAG?SMB
LX51
LINKER/LOCATER V4.66.30.0
11/29/2017 18:16:47 PAGE 4
001114H 001119H
000006H BYTE UNIT
CODE
?PR?_SMB_SETFOUNDSLAADDR?SMB
00111AH 00111FH
000006H BYTE UNIT
CODE ?PR?TIMER_GETSCHEDULECOUNT100MS?TIMER
001120H 001125H
000006H BYTE UNIT
CODE
?PR?TIMER_CLEARSCHEDULECOUNT100MS?TIMER
001126H 00112BH
000006H BYTE UNIT
CODE ?PR?MAIN?MAIN
00112CH 001131H
000006H BYTE UNIT
CODE ?PR?UART_GETRXBUFFERSIZE?UART
001132H 001ED8H
000DA7H BYTE UNIT
CONST ?CO?SERDES
001ED9H 001EE0H
000008H BYTE UNIT
CONST ?CO?FLASH
0 및 - 를 제외한 것을 모두 더하면 7901 여서 빌드 결과인 7904와 3 byte 다르다.
?CO? CONST:
- ?CO?SERDES: 3495
- ?CO?FLASH: 8
을 더하면 3503 이 되므로 이것이 Build 결과와 같은것 같다.
?PR? CODE
피드 구독하기:
글 (Atom)