I was able to get the bootloader working on 12f1840, however looks like the
hex file overwrites the bootloader making it work only once.
There are compiler options that will let bootloaders like screamer/bloader
and Ric farmers's PIC loader work Also there's an option to force the first
instruction to be a long jump.
But none of it works. I would like to confirm if it's a bootloader or
compiler issue.
Regards,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Dan,
I tried the long jump option. But there's one more option left to be checked. There's also the possibility of a bug in the newer version of the compiler.
Since I don't have the devices to test, I'll update you once I finish my tests.
BTW, I happen to be the author of jaledit mentioned in the post.
Thanks,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the result of the bootloader output of a hexfile programmed with pragma bootloader long_start
Check Device...
Open COM3 serial port at 19200bd
Software reseting Device
Found: 12F 1840
Open HEX file: D:\Dropbox\Projects\hw\PIC\JAL\NightOMatic\src\1307\12F1840_bootldrTestEEMap.hex
Hex file verified, OK
Warning: Config found just writing data
Warning: Config found just writing data
Warning: Config found just writing data
Warning: Config found just writing data
WARNING: pclath not fully initialised before GOTO! ...
WARNING: first 4 words of code could not be fixed
Maybe you should use some directive in your compiler
to enable the use of bootloaders
Transfering flash...
Transfering program memory...
Transfering EEPROM...
Transfert HEX successfull :-)
Close COM3 serial port
Afterwards program works but bootloader doesn't.
Here's the first 4 lines of the asm file
; 1 include 12f1840
org 0
movlp_nop HIGH lmain
goto lmain
nop
addwf v__pcl,f
Regards,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
first 4 words of code could not be fixed.Maybe you should use some directive in your compiler enable the use of bootloaders
inspite of bootloader pragma.
But interestingly my primary problem is solved. What was happening was, I was using RTS reset which is not working reliably in the C# bootloader software. iam using RTS reset with a transistor to switch off and on the power of the PIC. If Iam using MCLR reset I have no issues in reprogramming. So your bootloader hex is perfect. However I suspect some issue with RTS reset of TinyPicboolad exe.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was able to get the bootloader working on 12f1840, however looks like the
hex file overwrites the bootloader making it work only once.
There are compiler options that will let bootloaders like screamer/bloader
and Ric farmers's PIC loader work Also there's an option to force the first
instruction to be a long jump.
But none of it works. I would like to confirm if it's a bootloader or
compiler issue.
Regards,
Sunish
hello,Sunish
Although it is unknown whether this is the answer to,
This page did you see?
http://groups.yahoo.com/neo/groups/jallist/conversations/topics/26280
Hello Dan,
I tried the long jump option. But there's one more option left to be checked. There's also the possibility of a bug in the newer version of the compiler.
Since I don't have the devices to test, I'll update you once I finish my tests.
BTW, I happen to be the author of jaledit mentioned in the post.
Thanks,
Sunish
Hi,Sunish
I tried to makeup exam.
PRAGMA BOOTLOADER LONG_START
With the addition of the above syntax,
Can be carried compile that meets the Tiny AVR/PIC Bootloader+ (Tiny PIC Bootloader).
I'll try PRAGMA BOOTLOADER LONG_START tomorrow at office, but I already tried the long jump commandline option.
Thanks Dan,
Sunish
This is the result of the bootloader output of a hexfile programmed with pragma bootloader long_start
Check Device...
Open COM3 serial port at 19200bd
Software reseting Device
Found: 12F 1840
Open HEX file: D:\Dropbox\Projects\hw\PIC\JAL\NightOMatic\src\1307\12F1840_bootldrTestEEMap.hex
Hex file verified, OK
Warning: Config found just writing data
Warning: Config found just writing data
Warning: Config found just writing data
Warning: Config found just writing data
WARNING: pclath not fully initialised before GOTO! ...
WARNING: first 4 words of code could not be fixed
Maybe you should use some directive in your compiler
to enable the use of bootloaders
Transfering flash...
Transfering program memory...
Transfering EEPROM...
Transfert HEX successfull :-)
Close COM3 serial port
Afterwards program works but bootloader doesn't.
Here's the first 4 lines of the asm file
; 1 include 12f1840
org 0
movlp_nop HIGH lmain
goto lmain
nop
addwf v__pcl,f
Regards,
Sunish
Hi,Sunish
I tried even PIC12F1840.
Add 'PRAGMA BOOTLOADER LONG_START'
Absence of the interrupt routine,I think the bootloader and operating correctly in both cases.
[Case1:without INTERRUPT]
$0000 movlw XXX ;rewrite bootloader
$0001 movwf PCLAT ;rewrite bootloader
$0002 goto bootloader ;rewrite bootloader
$0003 movlb 3 ;(lmain) not rewrite
$0004 clrf v_ansela
v
v
bootloader
v
v
(:exit bootloader)
movlp HIGH lmain ;(source $0000)
goto l__main (->$0003) ;(source $0001)
nop ;(source $0002)
movlb ;(source $0003)
[Case2:with INTERRUPT]
$0000 movlw XXX ;rewrite bootloader
$0001 movwf PCLAT ;rewrite bootloader
$0002 goto bootloader ;rewrite bootloader
$0003 ??
$0004 movlb 0 ;(INTERRUPT)
$0005 movlp HIGH l_identifier
$0006 goto l_identifier
$0007 movlb 3 ;(lmain)
$0008 clrf v_ansela
v
v
bootloader
v
v
(:exit bootloader)
movlp HIGH lmain ;(source $0000)
goto l__main (->$0007) ;(source $0001)
nop ;(source $0002)
movlb ;(source $0003)
Last edit: Dan 2013-11-11
Dan,
Thanks for the reply. I get this message
first 4 words of code could not be fixed.Maybe you should use some directive in your compiler enable the use of bootloaders
inspite of bootloader pragma.
But interestingly my primary problem is solved. What was happening was, I was using RTS reset which is not working reliably in the C# bootloader software. iam using RTS reset with a transistor to switch off and on the power of the PIC. If Iam using MCLR reset I have no issues in reprogramming. So your bootloader hex is perfect. However I suspect some issue with RTS reset of TinyPicboolad exe.
For anyone who's going to use TinyPicBootload+ with jal V2, just add these two lines to your code
pragma bootloader bloader
pragma fuses no
It works with the following log result
Hex file verified, OK
WARNING: pclath not fully initialised before GOTO! ...
Code sucessfully repaired.
Got the inspiration from the jal file of Valter, author of moleculine project
...
Sunish