BLANKCHK equ $05BYTEPG equ $20BYTEBURSTPG equ $25PAGEERASE equ $40MASSERASE equ $41;OK equ $00;ERR equ $01FADDR equ $8000CARDADR ds 1FLCMD ds 1 ;--------------------;Flash Erase/Program;--------------------;acca = adr; accx = cmdflash psha pshx brclr FSTAT_FACCERR,FSTAT,flash1 ;FACCERR = 0— bset FSTAT_FACCERR,FSTAT ;clr errorflash1 bset FSTAT_FCBEF,FSTAT ;set FCBEF lda CARDADR ;load buffer adr & data sta FADDR ldx FLCMD ;write cmd to FCMD sta FCMD nop ;wait 7 cycle nop nop nop nop nop nop bset FSTAT_FCBEF,FSTAT ;set FCBEF nop ;wait 7 cycle nop nop nop nop nop nop brset FSTAT_FACCERR,FSTAT,flashend ;if FPVIOL = 1 – brset FSTAT_FPVIOL,FSTAT,flashend ;if FACCERR = 1 ˜ feed_watchdog brclr FSTAT_FCCF,FSTAT,* ;if FCCF = 0 ™ flashend pulx pula rts
Solved! Go to Solution.
Message Edited by bigmac on 2008-03-17 05:14 PM
Message Edited by bigmac on 2008-03-17 05:14 PM
Link Error : L1119: Vector allocated at absolute address 0xFFFE overlaps with sections placed in segment .absSeg2
I've done my code as below.I've gone through the help file & i found this example.
Code:ERROR: Vector allocated at absolute address 0xFFFE overlaps with sections placed in segment ROM_2 LINK fibo.abs NAMES fibo.o startup.o END SEGMENTS MY_RAM = READ_WRITE 0x800 TO 0x80F; MY_ROM = READ_ONLY 0x810 TO 0xAFF; MY_STK = READ_WRITE 0xB00 TO 0xBFF; ROM_2 = READ_ONLY 0xFF00 TO 0xFFFF; END PLACEMENT .text INTO MY_ROM; .data INTO MY_RAM; .stack INTO MY_STK; .rodata INTO ROM_2; END /* Set reset vector on _Startup */ VECTOR ADDRESS 0xFFFE _Startup ********************************************************************* LINK fibo.abs NAMES fibo.o startup.o END SEGMENTS MY_RAM = READ_WRITE 0x800 TO 0x80F; MY_ROM = READ_ONLY 0x810 TO 0xAFF; MY_STK = READ_WRITE 0xB00 TO 0xBFF; ROM_2 = READ_ONLY 0xC00 TO 0xCFF; END PLACEMENT .text INTO MY_ROM; .data INTO MY_RAM; .stack INTO MY_STK; .rodata INTO ROM_2; END /* Set reset vector on _Startup */ VECTOR ADDRESS 0xFFFE _Startup
I tried playing aroound with the ROM2 it still show the same error message.Please advise.
Thanks.
Regards,MY
Z_RAM = READ_WRITE 0x0070 TO 0x00FF; RAM1 = READ_WRITE 0x0100 TO 0x010F; /* Reserve for RAM based code */ RAM = READ_WRITE 0x0110 TO 0x081F; SSTACK = READ_WRITE 0x0820 TO 0x086F; /* Reserve for stack */ NVDATA = READ_ONLY 0x1860 TO 0x19FF; /* Reserve for NV data */ ROM = READ_ONLY 0x1A00 TO 0xFFAF; ROM1 = READ_ONLY 0x0870 TO 0x17FF; ROM2 = READ_ONLY 0xFFC0 TO 0xFFCB;
*********************************************************************************************SECTION-ALLOCATION SECTIONSection Name Size Type From To Segment---------------------------------------------------------------------------------------------MY_ZEROPAGE 103 R/W 0x70 0xD6 Z_RAMMCUinit.asm__ORG00001 1 R 0xFFBD 0xFFBD .absSeg0MCUinit.asm__ORG00002 1 R 0xFFBF 0xFFBF .absSeg1MCUinit.asm__ORG00003 52 R 0xFFCC 0xFFFF .absSeg2.init 101 R 0x1A00 0x1A64 ROMCODE_SECT 372 R 0x1A65 0x1BD8 ROMDEFAULT_CODE 103 R 0x1BD9 0x1C3F ROM.stack 80 R/W 0x820 0x86F SSTACKSummary of section sizes per section type:READ_ONLY (R): 276 (dec: 630)READ_WRITE (R/W): B7 (dec: 183)
Message Edited by mingyee on 2008-03-20 10:19 AM
hello bigmac We are developing an ECU for the seat of a car using MC9S08AC16 We are using 2 sectors of Flash (512 bytes each) as emulated EEPROM. After that, we have a 16 byte gap before the Program area. About the Problem: During sector swapping, the ECU resets due to watchdog time-out. (We did not use the callback function because we are not using internal watchdog, we use external watchdog from SBC80A6624 Atmel) (This problem was solved later on the succeeding software releases by disabling the watchdog prior to writing. Problem might be 99% solved ) When this happens, 2 resulting problems might happen: 1) EEPROM data loss 2) overwriting 1 byte at start of Program area, making the ECU non-functional. atached file is the eeprom driver source code. any suggestion would be a great help.. thank you
Message Edited by alex1 on 2008-05-17 04:38 AM
; System clock initialization ; ICGC1: HGO=0,RANGE=1,REFS=0,CLKS1=0,CLKS0=1,OSCSTEN=1,LOCD=0 MOV #$4C,ICGC1 ; ICGC2: LOLRE=0,MFD2=1,MFD1=0,MFD0=1,LOCRE=0,RFD2=0,RFD1=1,RFD0=0 MOV #$52,ICGC2 ; ICGTRM: Initialize internal clock trim from a non volatile memory LDA $FFBE STA ICGTRM
; ### Init_FLASH init code ; FCDIV: DIVLD=0,PRDIV8=1,DIV5=0,DIV4=0,DIV3=0,DIV2=0,DIV1=1,DIV0=0 LDA #$42 ; 162kHz STA FCDIV ; Set clock divider ; ### CLI ; Enable interrupts RTS