Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checksum error [solved]
#1
Hi.

I'm using the DS30 bootloader and am writing my own programmer using the protocol information shown in the documentation.

I changed the Hello character from 0xC1 to 0xD1 in both programmer and bootloader (and in the DS30 programmer source) and I am running the serial interface at 256000 baud. Fast, I know, but it works. The processor is a PICF1938 and the DS30 code is from 1.3.0.

My problem is that I always get a Checksum Error notification back from the bootloader when I'm using my own programmer, but it is fine in the DS30 programmer. The data being sent appears to be fine - here is a dump from Portmon:

(DS30 dump, which works)
162 0.00107774 ds30 Loader GU IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
171 0.00104227 ds30 Loader GU IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
181 0.00100314 ds30 Loader GU IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
183 0.07990158 ds30 Loader GU IOCTL_SERIAL_WAIT_ON_MASK VCP0 SUCCESS
187 0.00000073 ds30 Loader GU IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
188 0.00000329 ds30 Loader GU IRP_MJ_READ VCP0 SUCCESS Length 1: D9
195 0.00000073 ds30 Loader GU IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
196 0.00000110 ds30 Loader GU IRP_MJ_READ VCP0 SUCCESS Length 1: 81
199 0.00000037 ds30 Loader GU IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
200 0.00000110 ds30 Loader GU IRP_MJ_READ VCP0 SUCCESS Length 1: 00
203 0.00000037 ds30 Loader GU IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
204 0.00000256 ds30 Loader GU IRP_MJ_READ VCP0 SUCCESS Length 1: 4B
205 0.00082211 ds30 Loader GU IRP_MJ_WRITE VCP0 SUCCESS Length 6: 00 00 00 01 01 FE
212 0.01591639 ds30 Loader GU IOCTL_SERIAL_WAIT_ON_MASK VCP0 SUCCESS
215 0.00000073 ds30 Loader GU IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
216 0.00000293 ds30 Loader GU IRP_MJ_READ VCP0 SUCCESS Length 1: 4B


(Mine, which doesn't)
0.00089014 Meter Tool.vsh IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
0.00088977 Meter Tool.vsh IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
0.11200316 Meter Tool.vsh IOCTL_SERIAL_WAIT_ON_MASK VCP0 SUCCESS
0.00085612 Meter Tool.vsh IRP_MJ_WRITE VCP0 SUCCESS Length 1: D1
0.00000293 Meter Tool.vsh IRP_MJ_READ VCP0 SUCCESS Length 1: D9
0.00000219 Meter Tool.vsh IRP_MJ_READ VCP0 SUCCESS Length 1: 81
0.00000219 Meter Tool.vsh IRP_MJ_READ VCP0 SUCCESS Length 1: 00
0.00000183 Meter Tool.vsh IRP_MJ_READ VCP0 SUCCESS Length 1: 4B
0.00000110 Meter Tool.vsh IOCTL_SERIAL_SET_TIMEOUTS VCP0 SUCCESS RI:-1 RM:-1 RC:3000 WM:0 WC:0
0.00062097 Meter Tool.vsh IRP_MJ_WRITE VCP0 SUCCESS Length 6: 00 00 00 01 01 FE
0.01587177 Meter Tool.vsh IRP_MJ_READ VCP0 SUCCESS Length 1: 4E

You can see that in both cases I'm receiving the initial version info, etc., from the bootloader (0xD9 0x81 0x00) and the OK (0x4B). Both dumps show that the same data is being sent to the bootloader afterwards (0x00 0x00 0x00 0x01 0x01 0xFE) but the bootloader always responds OK (0x4B) to the DS30 bootloader and always responds Checksum Error (0x4E) to mine.

The timing between receiving the initial OK (0x4B) and sending the command (0x00 0x00 0x00 0x01 0x01 0xFE) is pretty close between the two, but I can't think of anything other than timing that might cause this.

Any suggestions?
Reply
#2
Found the problem. I needed a delay between issuing 'Hello' and checking for the response. Without the delay I was checking immediately and, seeing no reply, issuing another 'Hello'. Meanwhile the reply to the first 'Hello' was being received but my second 'Hello' was being treated as part of the command sequence.
Reply
#3
Great!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)