ds30 Loader free edition forums
dsPIC30F6010A verify failed [solved] - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 16-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=6)
+--- Thread: dsPIC30F6010A verify failed [solved] (/showthread.php?tid=30)



dsPIC30F6010A verify failed [solved] - Happy Hunter - 2010-12-19

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.


RE: dsPIC30F6010A verify failed - Mikael Gustavsson - 2010-12-19

Do you use any kind of code protection?
Please activate debug mode and post the output.


RE: dsPIC30F6010A verify failed - Happy Hunter - 2010-12-20

(2010-12-19, 23:54:49)Mikael Gustafsson Wrote: Do you use any kind of code protection?
Please activate debug mode and post the output.

No, No Code protection. I'm able to program the simple hex file using your bootloader. I also can read the data using the debugger.

Here is the output when I go to Options->Debug Mode

Initiating download...
Opening port COM9@9600
Searching for bl .
Found dsPIC30F6010A fw ver. 3.0.0
Bootloader placement: 8
Bootloader size: 8
Waiting for bootloader to be ready...ok
Writing row 0...verification error,1 try
Writing row 0...verification error,2 try
Writing row 0...download failed
Closing port
Download finished
Tx 307 bytes / Rx 7 bytes / 0.7s



RE: dsPIC30F6010A verify failed - Mikael Gustavsson - 2010-12-20

I downloaded the version from the homepage and "unfortunately" it works just fine on my dsPIC30F4011.

I don't really know how to troubleshoot this.
Have you tried on another 6010A?
Could you try on a 6010 or any other dsPIC30 not A?


RE: dsPIC30F6010A verify failed - Happy Hunter - 2010-12-23

Ok, after putting a lot of debug traces I found that writing into the memory is not stable. I'm running this setup with maximum speed of 30Mhz. So I decreased the speed to 15Mhz and now it is stable.

I will be ordering another test board with chip.


RE: dsPIC30F6010A verify failed - Mikael Gustavsson - 2010-12-23

Thanks for the report! One day I will put this experience in a trouble shooting guide.

Btw, what supply voltage do you use? Do you have decoupling and filter capacitors?
Are floating pins configured as outputs?


RE: dsPIC30F6010A verify failed - Happy Hunter - 2010-12-23

Today I got a new dev board and new dsPIC30F6010A.
Quick try with flashing 5 times and verifying found no problems.

Yesterday I compared the input data with the data read from flash and I see occasionally 7-th bit missing in upper program word. So the chip might be damaged.

I'm using dev board as it is with nothing connected to it and 7.5v 300mAmp power supply.

I tried the old board<->old chip with 12v 1Amp power supply still same problem with verifying.

Now each setup tested 5 times and consistently:
* new board <-> new chip works no problem.
* old board <-> new chip works no problem.
* suspiciously the new board <-> old chip works as well.
* old board <-> old chip, does not work

Anyways I will keep using new chip and old board and update if there will be any new problem.

Thank you.

BTW I put speed back to max 30Mhz during above mentioned tests