2010-12-19, 21:23:28
(This post was last modified: 2012-12-22, 13:38:48 by Mikael Gustavsson.)
Hi,
I'm trying to use the bootloader with dsPIC30F6010A.
I'm using "dsPICDEM 80-Pin Starter Development Board" from microchip with dsPIC30F6010A installed on it.
The bootloader can communicate with GUI, but every time I try to program my simple application I get verification error:
Initiating download...
Searching for bl .
Found dsPIC30F6010A fw ver. 3.0.0
Waiting for bootloader to be ready...ok
Writing flash...verification error,1 try
Writing flash...verification error,2 try
Writing flash...download failed
Download finished
Tx 409 bytes / Rx 8 bytes / 0.7s
Any ideas where I can start looking?
In the attached files: One is the bootloader sources that I updated and the PDF for dev board.
Thank you.
Ok,
I commented out the verification routine completely
; Verify upper byte
verloop:tblrdh.b [WADDR2], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Verify low byte
tblrdl.b [WADDR2++], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Verify high byte
tblrdl.b [WADDR2++], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Loop
dec WCNT, WCNT
Obviously I do not get verify errors at this time and I'm able to send my program to dsPIC.
After that I used Real ICE debugger to read program memory back and I can see that my program was written into flash and it is actually executed (the LED starts blinking).
So I assume the problem is somewhere with verification routine not with the writing routine
After playing with the verification routine again, I found that only
; Verify upper byte
verloop:tblrdh.b [WADDR2], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
portion is giving the verification error. If I still verify "low byte" and "high byte" the loader works OK without errors.
Something is missing when acessing the high portion of program word.
I'm trying to use the bootloader with dsPIC30F6010A.
I'm using "dsPICDEM 80-Pin Starter Development Board" from microchip with dsPIC30F6010A installed on it.
The bootloader can communicate with GUI, but every time I try to program my simple application I get verification error:
Initiating download...
Searching for bl .
Found dsPIC30F6010A fw ver. 3.0.0
Waiting for bootloader to be ready...ok
Writing flash...verification error,1 try
Writing flash...verification error,2 try
Writing flash...download failed
Download finished
Tx 409 bytes / Rx 8 bytes / 0.7s
Any ideas where I can start looking?
In the attached files: One is the bootloader sources that I updated and the PDF for dev board.
Thank you.
Ok,
I commented out the verification routine completely
; Verify upper byte
verloop:tblrdh.b [WADDR2], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Verify low byte
tblrdl.b [WADDR2++], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Verify high byte
tblrdl.b [WADDR2++], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
; Loop
dec WCNT, WCNT
Obviously I do not get verify errors at this time and I'm able to send my program to dsPIC.
After that I used Real ICE debugger to read program memory back and I can see that my program was written into flash and it is actually executed (the LED starts blinking).
So I assume the problem is somewhere with verification routine not with the writing routine
After playing with the verification routine again, I found that only
; Verify upper byte
verloop:tblrdh.b [WADDR2], W0
cp.b W0, [WBUFPTR++]
; bra NZ, vfail
portion is giving the verification error. If I still verify "low byte" and "high byte" the loader works OK without errors.
Something is missing when acessing the high portion of program word.