Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: PIC18 USB Bootloaders

Re: PIC18 USB Bootloaders 8 years 4 months ago #7531

I hear you - there's not much to go by without the source code. It's early days for this take on the bootloader, Joe is considering going open source down the track - until then the best way to figure out what's going on under the hood is to contact him.

Re: PIC18 USB Bootloaders 8 years 4 months ago #7532

  • jmessina
  • jmessina's Avatar
  • Offline
  • Senior Boarder
  • Posts: 44
  • Thanks received: 189
It would just worry me if the loader runs at power on all by itself. The packet format is VERY simple, and all you need is a single packet that starts with $04 and you've now got an erased device.

I suppose you could use a special VID/PID combination, or a more robust packet format, but if the code's anything like the current Mchip loader I think I'd feel a lot better with having to push a button... maybe two.

Perhaps he's implemented some sort of special command/handshake to get the ball rolling. That might be a bit safer.

Re: PIC18 USB Bootloaders 8 years 4 months ago #7533

I think I'd feel a lot better with having to push a button... maybe two
Gold

Perhaps in the near future we'll see some more documentation, or code

Re: PIC18 USB Bootloaders 8 years 4 months ago #7537

Hi Graham,
You have to remember that the usb hid stack is ONLY used in the bootloader, not in your app, if you write a hid app, it will have it's own usb stack, you can add a cdc stack if you need it. There is no issue with another app calling the loader. If you program, for example, a cdc stack, plug the device into the pc, then without the programming app running, it will immediately enter the program cdc stack, not the hid loader, same with say a hid joystick, without the programming app running, it will immediately be seen as a hid joystick.
The only caveat is that the bootloader PID and your program that you write PID must be different as the loader pc side uses this info. Once can have the same VID though. I have indicated on the wiki for Proton that I will add custon VID and PID to the files for licensed PDS users. This is a service free to those uses in support of Crownhill and as a way of thanks to them. At some point later in the year I will consider releasing the source. In the mean time, if anyone needs something specific then please feel free to contact me.
You can change any config setting you need, or view them, by looking at the config fuse settings on the pickit gui app. included in the settings.txt is an example to alter the loader for any xtal speed you require.
If you then want to alter settings from within your application, you can click the allow config programming button, but you must obviously keep the xtal settings the same and the multiplyer, also adding code protection fuses etc would not be a good idea lol.
So the settings txt shows how to use any xtal frequency to end up with the 48Mhz internal clock, then anything else you want to change is possible. The only thing the user should ever need to change is the xtal frequency in the loader.. WDT etc can be easilly added at aplication programming time.
Hope that helps.?
Joe
The following user(s) said Thank You: Graham Mitchell

Re: PIC18 USB Bootloaders 8 years 4 months ago #7538

  • RangerBob
  • RangerBob's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 18
  • Thanks received: 48
Good loader, although I've had some issues with Swordfish programs. Likely due to configuration settings, hard to tell without the source code.

I've made a variant of the loader that works in a similar way, am adding some final touches to it and will make it available to all soon enough

Interested to see your loader when it is ready too.

I've also found some issues with swordfish and the microchip HID bootloader a long while back. I originally traced it back to some register that gets touched by the bootloader and which swordfish expects to be at some other default value. Thats as far as I got.

As a work around, first thing I do with any program using HID bootloader is set all the registers back to their default value from the datasheet. Not ideal but works for me in a production environment.
The following user(s) said Thank You: Graham Mitchell

Re: PIC18 USB Bootloaders 8 years 4 months ago #7539

Thanks RangerBob, it's good to know I am not alone!

Thank you to Joe - cleared up a couple of areas. Could you shed some light on Jerry's concern:
It would just worry me if the loader runs at power on all by itself. The packet format is VERY simple, and all you need is a single packet that starts with $04 and you've now got an erased device.

I suppose you could use a special VID/PID combination, or a more robust packet format, but if the code's anything like the current Mchip loader I think I'd feel a lot better with having to push a button... maybe two.
Time to create page: 0.239 seconds