USB HID Bootloader PIC32MX250F128B

General discussion on mikroC PRO for PIC32.
Author
Message
VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: USB HID Bootloader PIC32MX250F128B

#31 Post by VCC » 16 Dec 2015 19:30

Hi,
maybe it's a surprise, I didn't calculate the EBase address. Just let the compiler do it. When you create a new project for that device (e.g. a blink LED), the EBase address is automatically filled in. Open the project configuration dialogbox and look for it. I used that value and it worked, maybe bothered a bit to put a new value, only to experiment.
I ran into the same problem as you did, because the bootloader written by mikroe is designed for 795F512L, so the EBase is different. I didn't touch PIC32s for about an year, so my memory is not fresh about this stuff. I'm glad that you have a working project. As you said, it's a one step forward. :)

bios85
Posts: 62
Joined: 05 Jan 2014 11:14

Re: USB HID Bootloader PIC32MX250F128B

#32 Post by bios85 » 17 Dec 2015 11:31

Hi, thanks for your reply anyway nothing to do ... for pic32mx270f256d nothing to do ... I can not fill the same mistake .... I'm beginning to think it is a problem of my PC that does not compile well .. ... in fact, I noticed a strange thing, if I take the project provided me VCC for pic32mx250f128b and modify the dimensioning of the bootloader filling me error ... until normal here! but if you get back the original size continues to compile error rom insufficient memory. This is no longer resolved, and I have to re-download dinuovo project of VCC.

The thing that disappoints me the most is how the developers of the forum moderators and NOT have been able to help me solve the problem!

bios85
Posts: 62
Joined: 05 Jan 2014 11:14

Re: USB HID Bootloader PIC32MX250F128B

#33 Post by bios85 » 17 Dec 2015 12:06

I did another test, I opened the project of VCC and I only changed the microcontroller selecting pic32mx270f256d with various config edit project and then I filled in and everything worked properly!
This is what makes me see PIC32 Memory Statistic:

Image

How to see the bootloader code is placed at the end of program memory, however, load the hex file with mikro prog and all is ok and the program recognizes the micro USB HID Bootloader load ... after which the program flashing LED getting this result:

Image

And it will not work any more, not even the fact you have to reprogram the bootloader software with mikro prog.

In the image you can see the files are generated with .list Ebase 0x9d01f000 and Ebase 0x9d03E000 :

Image

I highlighted in red and green thing changes if you change Ebase in orange and the address where he began to write the bootloader.
Why is this happening?

VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: USB HID Bootloader PIC32MX250F128B

#34 Post by VCC » 17 Dec 2015 16:14

Regarding the chart you've posted, did you recompile the project after changing from 250F128B to 270F256D? If not, it is expected to see that the bootloader code is allocated at the middle of program memory. In fact it is allocated at the end of memory for an 250F128B which is the middle of 270F256D.

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: USB HID Bootloader PIC32MX250F128B

#35 Post by biljana.nedeljkovic » 17 Dec 2015 16:54

Hello,

The only changes that are supposed to be made are the bootloader size, and the error we detected.
This was reported to our developers and it will be fixed as soon as possible.

The error that happened might be caused if you had somehow reset, disconnected or aborted the procedure. Can you please tell me how it won't work anymore? Is this error message happening every time, or is there a new message now?

Have you tried to make a new project?
Have you reprogrammed the same bootloader code again or?

Best regards,
Biljana

VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: USB HID Bootloader PIC32MX250F128B

#36 Post by VCC » 17 Dec 2015 16:55

Hi,
can someone confirm that the mlk file for 270F256D is correct?

Code: Select all

<DEVICE_NAME>P32MX270F256D</DEVICE_NAME>
	<ROM>
		<MIN_ADDR>0x1D000000</MIN_ADDR>
		<MAX_ADDR>0x1D03EFFF</MAX_ADDR>
	</ROM>
If I change the MAX_ADDR value to 0x1D03FFFF instead of 0x1D03EFFF, I can compile the bootloader. EBase 9D03F000.
I am using mikroPascal for PIC32 v3.5.0.

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: USB HID Bootloader PIC32MX250F128B

#37 Post by biljana.nedeljkovic » 18 Dec 2015 14:19

Hello,

I reported this, the max address should be changed to 0x1D03FFFF.

To declare Ebase address, take a look at the Virtual Memory Map for your microcontroller (page 42):
http://ww1.microchip.com/downloads/en/D ... 01168H.pdf

The Ebase should be placed within Virtual Boot Flash range. This range is different depending on the microcontroller.
The default value for Ebase is set to 0x9FC01000, which is ok in case of PIC32MX795F512L, but when you change to the microcontroller with the smaller range, such as PIC32MX270F256D, the value of 0x9FC01000 is in the reserved area, which you can see in the memory map, and that is the reason the error is reported.

Please let me know if you made it work after applying those changes.

Kind regards,
Biljana

bios85
Posts: 62
Joined: 05 Jan 2014 11:14

Re: USB HID Bootloader PIC32MX250F128B

#38 Post by bios85 » 18 Dec 2015 15:10

The changes recommended by you solve the problem but then compile the code loaded with bootloader does not work anyway !!!
The error does not allow the proper functioning is in the file "P32MX270F256D.c", in particular __BOOT_FLASH_SIZE be modified as follows:

............................
const char B29 = 29;
const char B30 = 30;
const char B31 = 31;

// const unsigned long __BOOT_FLASH_SIZE = 0x00028000;

const unsigned long __BOOT_FLASH_SIZE = 0x00000BF0;

const unsigned long __FLASH_SIZE = 0x00040000;

// Working space registers
rx unsigned long R0 absolute 0x0000;
rx unsigned long R1 absolute 0x0004;
rx unsigned long R2 absolute 0x0008;
.........................

After that it all works correctly!


Image

VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: USB HID Bootloader PIC32MX250F128B

#39 Post by VCC » 18 Dec 2015 16:44

@Biljana
thank you for looking into this.

@bios85
I'm glad it works after all.
:D

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: USB HID Bootloader PIC32MX250F128B

#40 Post by biljana.nedeljkovic » 21 Dec 2015 08:58

Hello,

I am glad you managed to make it work.

Good luck with your project.

Best regards,
Biljana

VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: USB HID Bootloader PIC32MX250F128B

#41 Post by VCC » 25 Nov 2018 11:32

I was looking into viewtopic.php?f=172&t=73789 and noticed that
const unsigned long __BOOT_FLASH_SIZE = 0x00028000;
in mikroPascal pro for PIC32 v4.0.0, still has this wrong value for PIC32MX270F256D.

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: USB HID Bootloader PIC32MX250F128B

#42 Post by petar.suknjaja » 26 Nov 2018 17:11

Hi,
I'll investigate this and let you know what I've found out.
Kind regards,
Petar

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: USB HID Bootloader PIC32MX250F128B

#43 Post by Dany » 29 Nov 2018 16:25

Post deleted (obsolete)
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroC PRO for PIC32 General”