I use pic18f97j60 device and Tiny Multi Bootloader+(v0.10.0 or v0.11.0).
I use XC8 and mplabX.
I has modified tinybld18F24J10_ext16MHz_19200.asm to use with 18f97j60, and add new entry to piccodes.ini.
I build a simple program, set Memory model to 100-500, and try to use Tiny Multi Bootloader+ to send firmware to pic, but I get this errror:
Error: hex file too large, writing bootloader firmware!!!
ERROR: Problem in uploading HEX file to device
Here is tinybld18F24J10_ext16MHz_19200.asm after i modified
radixDEC;changetheselinesaccordinglytoyourapplication#include"p18f97j60.inc"IdTypePIC=0x33;Pleaserefertothetablebelow,mustexistsin"piccodes.ini"#define max_flash 0x20000 ; in bytes, not WORDS!!! Please refer to the table belowxtalEQU25000000;youmayalsowanttochange:_HS_OSC_XT_OSCbaudEQU19200;standardTinyBldbaudrates:115200or19200;Theabove5linescanbechangedandbuidabootloaderforthedesiredfrequency(andPICtype)#include"spbrgselect.inc" ;RoundResultandbaud_rate#define first_address max_flash-264 ;132 wordsconfigWDT=OFF;WDTiscontrolledbySWDTENbitoftheWDTCONregisterconfigSTVR=OFF;Stackfull/underflowwillnotcauseResetconfigXINST=OFF;InstructionsetextensionandIndexedAddressingmodedisabled(Legacymode)configDEBUG=OFF;Backgrounddebuggerdisabled;RB6andRB7configuredasgeneralpurposeI/OpinsconfigCP0=OFF;Programmemoryisnotcode-protectedconfigFOSC=HS;HSoscillatorconfigFOSC2=ON;ClockselectedbyFOSCassystemclockisenabledwhenOSCCON<1:0>=00configFCMEN=OFF;Fail-SafeClockMonitordisabledconfigIESO=OFF;OscillatorSwitchovermodedisabledconfigWDTPS=1;WatchdogTimerPostscaleSelectbits1:1configCCP2MX=ON;CCP2ismultiplexedwithRC1;-----------------------------PROGRAM---------------------------------cblock0crccnt1cnt2cnt3;;flagUflagHflagLendccblock0x0100buffer:256endccountequcrc;0000000000000000000000000RESET00000000000000000000000000ORG0x0000GOTOIntrareBootloader;viewwithTabSize=4;&&&&&&&&&&&&&&&&&&&&&&&START&&&&&&&&&&&&&&&&&&&&&&;----------------------Bootloader----------------------;PC_flash:C1hUHL64...<64bytes>...crc;PC_cfg:C1hUOR80hHL8...<8bytes>...crc;PC_cfg_unnecessary:C1h0crc;PIC_response:type`J`ORGfirst_address;spacetodepositfirst4instr.ofuserprog.nopnopnopnoporgfirst_address+8IntrareBootloader:;skipTRISto0C6movlw((1<<TXEN)|(1<<BRGH));initserialportmovwfTXSTA;useonlySPBRG(8bitmodedefault)notusingBAUDCONmovlwspbrg_valuemovwfSPBRGmovlw((1<<SPEN)|(1<<CREN))movwfRCSTA;waitforcomputerrcallReceivesublw0xC1;ExpectC1hbnzway_to_exitmovlwIdTypePIC;sendPICtypemovwfTXREGmovlw'J';"-Everything OK, ready and waiting."movwfTXREG;;movlw((IntrareBootloader>>16)&0xFF);TBLPTR=IntrareBootloader;;movwfTBLPTRUmovlw((IntrareBootloader>>8)&0xFF)movwfTBLPTRH;;movlw(IntrareBootloader&0xFF);;movwfTBLPTRLclrfcrc;crc=0incfFSR0H;FSR0=bufferTOP(0x0100)TBLRD*-cp_bl:;copyBootloaderandConfigtoRAMTBLRD+*movffTABLAT,POSTINC0tstfszFSR0L;FSR0=0x0200?(copy256bytes?)bracp_bl;rcallReceive;ConfigUpperbtfssWREG,7;isConfig?brachk_crcrcallReceive;ConfigHi(Reciveonly)rcallReceive;ConfigLodecfFSR0H;FSR0=0x0100movwfFSR0L;FSR0=0x01F8rcallReceive;count(Reciveonly)rcv_cfg:;reciveConfigdatarcallReceivemovwfPOSTINC0tstfszFSR0L;FSR0=0x0200?(recive8bytes?)brarcv_cfgchk_crc:rcallReceive;getcrcbnzway_to_exit;crcerrorwr_bl1:;TBLPTR=0x003B00-1(18F24/44J10)rcallwr_bld;TBLPTR=0x007B00-1(18F25/45J10)bra(wr_bl2-1024)wr_bl2:;TBLPTR=0x003F00-1(18F24/44J10)rcallwr_bld;TBLPTR=0x007F00-1(18F25/45J10)bra(set_FSR+1024)set_FSR:decfFSR0H;FSR0=0x0100MainLoop:movlw'J';"-Everything OK, ready and waiting."mainl:movwfTXREGclrfcrc;crc=0rcallReceive;UppermovwfTBLPTRU;;movwfflagU;(forERASE)rcallReceive;HimovwfTBLPTRHmovwfflagH;(forERASE)rcallReceive;LomovwfTBLPTRLmovwfflagL;(forERASE)rcallReceive;count(Reciveonly)clrfFSR0L;FSR0=0x0100rcvoct:;read64bytesrcallReceivemovwfPOSTINC0btfssFSR0L,6;FSR0=0x0140?brarcvoctclrfFSR0L;FSR0=0x0100rcallReceive;getcrcziieroare:;CRCfailedmovlw'N'bnzmainl;writeeraseloop:;bcfSTATUS,C;Carry=0;;rrcfflagU;flagU:flagH:flagL=(flagU:flagH:flagL>>2)rrcfflagHrrcfflagL;bcfSTATUS,C;Carry=0;;rrcfflagUrrcfflagHrrcfflagLbnznoerase;Each1024bytes?movlw((IntrareBootloader>>10)&0xFF);0x0F=0x3C00>>10,0x1F=0x7C00>>10subwfflagH,wbznoerase;LastErasePage?bsfEECON1,FREE;ErasercallWritenoerase:TBLRD*-;pointtoadr-1rcallwrite64byteswaitwre:;btfscEECON1,WR;foreepromwrites(waittofinishwrite);brawaitwre;noneed:roundtriptimewithPCbiggerthan4msbraMainLoop;********procedures******************wr_bld:btgTBLPTRH,2;TBLPTR-1024.orTBLPTR+1024bsfEECON1,FREE;ErasercallWriteclrfTBLPTRLTBLRD*-;pointtoadr-1decfFSR0H;FSR0=0x0100wr_bld_lp:rcallwrite64byteststfszFSR0L;FSR0=0x0200?(write256bytes?)brawr_bld_lpreturnwrite64bytes:bsfcount,6;count=64write64_lp:movffPOSTINC0,TABLAT;put1bytetblwt+*decfszcount;count=0?brawrite64_lpWrite:bsfEECON1,WRENmovlw0x55movwfEECON2movlw0xAAmovwfEECON2bsfEECON1,WR;WRITEnopclrfEECON1returnReceive:movlw(xtal/2000000+1);for20MHz=>11=>1seconddelaymovwfcnt1rpt2:clrfcnt2rpt3:clrfcnt3rptc:btfssPIR1,RCIF;testRXbranotrcvmovfRCREG,w;returnreaddatainWaddwfcrc;computecrcreturnnotrcv:decfszcnt3brarptcdecfszcnt2brarpt3decfszcnt1brarpt2;timeout:way_to_exit:bcfRCSTA,SPEN;deactivateUARTbrafirst_address;*************************************************************;Afterreset;Donotexpectthememorytobezero,;Donotexpectregisterstobeinitialisedlikeincatalog.END
Thankyou for your reply,
I had change the bootloader follow your guide, but it doesn't resolve the the error with Tiny Multi Bootloader+.
Error: hex file too large, writing bootloader firmware!!!
ERROR: Problem in uploading HEX file to device.
Do I need any change to picodes.ini to make it work,
Thanks,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I use pic18f97j60 device and Tiny Multi Bootloader+(v0.10.0 or v0.11.0).
I use XC8 and mplabX.
I has modified tinybld18F24J10_ext16MHz_19200.asm to use with 18f97j60, and add new entry to piccodes.ini.
I build a simple program, set Memory model to 100-500, and try to use Tiny Multi Bootloader+ to send firmware to pic, but I get this errror:
Error: hex file too large, writing bootloader firmware!!!
ERROR: Problem in uploading HEX file to device
Can you help me, please.
Here is my .hex file
Here is tinybld18F24J10_ext16MHz_19200.asm after i modified
This is new line I add to picodes.ini
Hi,Vu Hoang
Although it can not be guaranteed to operate, it is necessary to change the following part.
Hi, Dan,
Thankyou for your reply,
I had change the bootloader follow your guide, but it doesn't resolve the the error with Tiny Multi Bootloader+.
Error: hex file too large, writing bootloader firmware!!!
ERROR: Problem in uploading HEX file to device.
Do I need any change to picodes.ini to make it work,
Thanks,