USB Bootloader, usign absolute jump?

Re: USB Bootloader, usign absolute jump?

Postby Pekotte » Wed Oct 22, 2014 3:29 pm

Phil,

I'm using a pic18F97J94, I'll check it if something is overwriting the configurations bits and I'll let you know.

EDIT: I realise that the memory space for the configurations bits is protect in all linker's files, so this shouldn't be the problem. However I'll try to check them somehow.

Regards
Pekotte
 
Posts: 8
Joined: Thu Aug 28, 2014 12:38 pm
Location: Manchester, UK
PIC experience: Professional 1+ years with MCHP products

Re: USB Bootloader, usign absolute jump?

Postby PhilB » Wed Oct 22, 2014 4:18 pm

Pekotte,
I would expect the bootloaded configuration bits to be incorrect. The ICD3 bits should be OK. You can check the configuration bits by reading back the memory with either the ICD3 as a programmer from MPLAB 8, or you could use the IPE application which you get with MPLAB X. With IPE, you can see the memory view in advanced mode - the password is 'microchip'.
The bootloader should not erase the top-most block of flash memory. I made that mistake once so I speak from experience.
Regards,
Phil
PhilB
 
Posts: 12
Joined: Fri Aug 29, 2014 9:06 am
PIC experience: Professional 2-5 years with MCHP products

Re: USB Bootloader, usign absolute jump?

Postby Pekotte » Thu Oct 23, 2014 9:22 am

Good morning Phil, (at least in UK)

I check three times different configurations bits when I program with ICD3 and I compared them those three times when I program with the bootloader and on those three cases the config bits were the same. I checked as well the clock frequency when the bootloader is waiting for plug in the usb (I take off the delay routine) and I realised that the bootloader is working in the slow frequency, so I think the bootloader isn't overwriting the configuration bits, don't you think? The problem have to be the bootloader itself, but if the problem is the bootloader and the bootloader and my app are separately programs, why is it affecting to my app as well?

I'm using the default configuration bits and my own bits (in the bootloader and in my app) but it's still the same.

EDIT: I'll try to post this problem in Microchip forum (even if when in that forum I never had answer), and I back to post here any suggestion.

Regards
Last edited by Pekotte on Thu Oct 23, 2014 9:55 am, edited 1 time in total.
Pekotte
 
Posts: 8
Joined: Thu Aug 28, 2014 12:38 pm
Location: Manchester, UK
PIC experience: Professional 1+ years with MCHP products

Re: USB Bootloader, usign absolute jump?

Postby PhilB » Thu Oct 23, 2014 9:52 am

Hi Pekotte,
It seems that you are getting closer to finding out your problem. Great.
Why don't you try to set the oscillator mode that you want in your bootloader program? I think that you can change oscillator modes by modifying the appropriate registers. It's detailed in the data sheet probably. So if for some reason the bootloader comes up in the wrong mode, your code should be able to put it right.
Then you might be able to work out where the oscillator has gone wrong.
Is there a post-scaler on the fast RC oscillator. Is that set at the wrong value?
Regards,
Phil
PhilB
 
Posts: 12
Joined: Fri Aug 29, 2014 9:06 am
PIC experience: Professional 2-5 years with MCHP products

Re: USB Bootloader, usign absolute jump?

Postby Pekotte » Thu Oct 23, 2014 11:45 am

Hi Phil,

You're right, the problem was that I had to configure the oscillator's registers (now it seems so obvious) and it's looks like it's fix. I'll keep the slow frequency for the bootloader (for USB comms) but I'll change it for my app. I didn't finish with this part (I'm still have to test it and check it) so I'll post the new advances and if I've a new problem (hopefully not) because maybe it's could be helpful for someone.

Thank you Phil for your help,

Regards
Pekotte
 
Posts: 8
Joined: Thu Aug 28, 2014 12:38 pm
Location: Manchester, UK
PIC experience: Professional 1+ years with MCHP products

Re: USB Bootloader, usign absolute jump?

Postby PhilB » Thu Oct 23, 2014 12:08 pm

You're welcome. Good luck with the project.
Regards,
Phil
PhilB
 
Posts: 12
Joined: Fri Aug 29, 2014 9:06 am
PIC experience: Professional 2-5 years with MCHP products

Previous

Return to USB

Who is online

Users browsing this forum: No registered users and 1 guest

cron