Hot!Communicating with Bootloader

Author
BenzApprentice
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2016/06/10 12:32:34
  • Location: YVR
  • Status: offline
2018/04/29 23:09:55 (permalink)
0

Communicating with Bootloader

Hi,
In the appendix B of DS01388, it outlines the procedure for communicating with the bootloader. I'm trying to do this over USB.
 
My understanding of the memo is to put a few frames together and send them. So I send <SOH><DLE><0x01><EOT>. I can see that transfer with USBtrace.
 
01 10 01 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
 
When I look at what's sent when I click on "Bootloader Ver" in the PIC32UBL Bootloader app, it sends 
 
01 10 01 21 10 10 04 00 B6 00 B7 00 B8 00 B9 00 BA 00 BB 00 54 EE 19 00 6E 40
2F 77 94 EE 19 00 FC 00 1A 00 09 00 00 00 00 00 1A 00 58 17 1A 00 00 00 00 00
5C 66 2C 77 38 EF 19 00 EC 1E 1A 00
 
I know the <CRCL><CRCH> are missing, and that's one of my questions, where do I find info on calculating it?
 
But there's something else wrong judging from the number of empty frames sent.
 
Could someone point me in the right direction?
 
Peter
post edited by BenzApprentice - 2018/04/29 23:29:26
#1

7 Replies Related Threads

    Akshayy
    Super Member
    • Total Posts : 351
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Communicating with Bootloader 2018/04/30 00:14:22 (permalink)
    0
    BenzApprentice
     
     
     
     
    01 10 01 21 10 10 04 00 B6 00 B7 00 B8 00 B9 00 BA 00 BB 00 54 EE 19 00 6E 40
    2F 77 94 EE 19 00 FC 00 1A 00 09 00 00 00 00 00 1A 00 58 17 1A 00 00 00 00 00
    5C 66 2C 77 38 EF 19 00 EC 1E 1A 00
     
     


    I dont think that much big string would be sent to get bootloader version.

    Regards,
    Akshay.
    #2
    Akshayy
    Super Member
    • Total Posts : 351
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Communicating with Bootloader 2018/04/30 00:18:05 (permalink)
    0
     
    01 10 01 21 10 10 04
     
    This is the string that is sent to get bootloader version info.
     
     

     

    Regards,
    Akshay.
    #3
    Akshayy
    Super Member
    • Total Posts : 351
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Communicating with Bootloader 2018/04/30 00:20:30 (permalink)
    0
    BenzApprentice
     
     
     
     
    01 10 01 21 10 10 04 00 B6 00 B7 00 B8 00 B9 00 BA 00 BB 00 54 EE 19 00 6E 40
    2F 77 94 EE 19 00 FC 00 1A 00 09 00 00 00 00 00 1A 00 58 17 1A 00 00 00 00 00
    5C 66 2C 77 38 EF 19 00 EC 1E 1A 00
     
     


    This is only the string to get bootloader version info.Other is garbage after '\0'.

    Regards,
    Akshay.
    #4
    BenzApprentice
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2016/06/10 12:32:34
    • Location: YVR
    • Status: offline
    Re: Communicating with Bootloader 2018/04/30 08:42:56 (permalink)
    0
    haha I think you're right. When sending that string from my VB app, the PIC32UBL bootloader adds a line for bootloader version. My VB app doesn't show the correct thing, actually it crashes, so something is wrong there, but the other app is showing signs of life.
     
    Where do I find info on how the <CRCL><CRCH> are calculated? Every command requires it but I don't see it explained anywhere.
     
    Thank a bunch!
    Peter
    #5
    Jim Nickerson
    User 452 _
    • Total Posts : 4992
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Communicating with Bootloader 2018/04/30 08:51:23 (permalink)
    0
    If you have the boot loader code it must have the CRC code within it ?
    #6
    BenzApprentice
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2016/06/10 12:32:34
    • Location: YVR
    • Status: offline
    Re: Communicating with Bootloader 2018/05/17 00:12:53 (permalink)
    0
    Good point! The function APP_CalculateCrc does show the calculation. It requires the data and length as parameters.
     
    01 10 01 21 10 10 04
    <SOH><DLE><Request><CRCL><DLE><CRCH><EOT>
     
    The code shows that <DLE> sets the escape variable, breaks and then increments the length.
     
    So I calculate length to be 6 as <SOH> sets the count to 0.
     
    I'm having trouble finding the comparison of the result from APP_CalculateCrc to the received <CRCL><CRCH> frames. Especially since there is a <DLE> frame in the middle, I can't see where it filters that out.
     
    Or am I thinking about this wrong and it doesn't actually compare to the received data.
    #7
    Jim Nickerson
    User 452 _
    • Total Posts : 4992
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Communicating with Bootloader 2018/05/17 06:53:01 (permalink)
    0
    Though not trivial, you have the source code and you can follow the received bytes as a command is decoded.
    #8
    Jump to:
    © 2018 APG vNext Commercial Version 4.5