Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootloader works only once [solved]
#1
I have successfully programmed the bootloader for my PIC18F67J10 running at 20Mhz. When compiling the bootloader source, an error came out when I set CONFIG FOSC = HS. So i removed it and it re-compiles. I manually set the FOSC fuse from MPLAB before programming the device using ICD2.

The bootloader is then detectable by the ds30 Loader GUI and I have successfully loaded my own app hex file and it rebooted and everything works fine.

However, when i manually reset the device, the ds30 Loader GUI app dont seem to be able to detect the bootloader anymore. So, i wasn't able to load another hex file to it via the bootloader.

Please advice.
Reply
#2
Hello,

As you change OSC by FOSC this make conflict with the definition of FOSC in settings.inc just after "radix DEC".
You could change FOSC to FSC in settings.inc and also in ds30loader.asm line 158 & 162.

About your bootloader not respondig after reset, if you set config bits in your program, they are programmed by the bootloader (place config bits only in one place).

Lotusx.
Reply
#3
It's not a problem have configs defined in both places. Just don't check "write configs" in the gui (only available if advanced mode is activated).
Here's the latest version of the PIC18FJ firmware where the FOSC is renamed for better compatibility.
[broken link]

Did you check "write configs"?
Reply
#4
Agree with you mackey, you can have config in both places. Personnaly, I prefer defining config in only one place, because it can lead to some difficulties (If you're dizzy like me Confused ).
Reply
#5
(2010-11-02, 14:55:18)Lotusx Wrote: Hello,

As you change OSC by FOSC this make conflict with the definition of FOSC in settings.inc just after "radix DEC".
You could change FOSC to FSC in settings.inc and also in ds30loader.asm line 158 & 162.

About your bootloader not respondig after reset, if you set config bits in your program, they are programmed by the bootloader (place config bits only in one place).

Lotusx.

Hi Lotusx,

It worked now after using latest version of the PIC18FJ firmware. However there are some modifications:-

1) The GUI doesn't recognize ver1.0.3 yet and doesn't let me proceed, so i renamed it back to ver1.0.2. #define VERREV 2

2) The Configuration bits at settings.inc is not compatible with PIC18F67J10 so I have made some modifications and commented out the unused ones:-

;for pic18f67j10
CONFIG WDTEN = OFF ;wathcdog timer
CONFIG STVREN = OFF ;stack over-/underflow reset
CONFIG XINST = OFF ;extended instruction set
CONFIG CP0 = OFF ;code protect
CONFIG FOSC = HS ;oscillator
;CONFIG T1DIG = OFF ;T1OSCEN enforcement
;CONFIG LPT1OSC = OFF ;low-power timer1 oscillator
CONFIG FCMEN = OFF ;fail-safe clock monitor
CONFIG IESO = OFF ;nternal External Oscillator Switch Over Mode
CONFIG WDTPS = 1 ;watchdog postscaler
;CONFIG DSWDTOSC= INTOSCREF ;dswdt clock select
;CONFIG RTCOSC = INTOSCREF ;rtcc clock select
;CONFIG DSBOREN = OFF ;deep sleep bor
;CONFIG DSWDTEN = OFF ;deep sleep watchdog timer
;CONFIG DSWDTPS = 2 ;deep sleep watchdog postscaler
;CONFIG IOL1WAY = OFF ;iolock one-way set enable bit
;CONFIG MSSP7B_EN=MSK5 ;mssp address masking
;CONFIG WPFP = PAGE_0 ;write/Erase Protect Page Start/End Location:
;CONFIG WPEND = PAGE_0 ;write/Erase Protect Region Select bit (valid when WPDIS = 0):
;CONFIG WPCFG = OFF ;write/Erase Protect Configuration Region
;CONFIG WPDIS = OFF ;write Protect Disable bit

Very Nice Bootloader! No modification needed for my application hex file!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)