Bootloader pic32mx250f128b

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
Adrian gxg
Posts: 7
Joined: 25 Jul 2015 16:17

Bootloader pic32mx250f128b

#1 Post by Adrian gxg » 06 Jul 2020 21:02

I have problems to complie the bootloader proyect for the pic32mx250f128b "not enought memory". Searching in the forum I found the problem is something related with the _Flash_erase, where i need to do some changes, chance to 1024.

The new version of mikroc pro for pic32 have already all those changes but in my case still not working, so i need help to know what is missing. I already checked into the defs files and according the other post the "def" files have the correct data to work.

The next code si the parte of the constante un the current proyecto, as i know this are the changes the proyect needs to have a complete and correcto proyect

//Constants inside the P32MX250F28B.C
const unsigned long __BOOT_FLASH_SIZE = 0x00000BF0;

const unsigned long __FLASH_SIZE = 0x00040000;

// FLASH library legacy constants & requirements
const unsigned int _FLASH_ERASE = 0x0400;
const unsigned int _FLASH_WRITE_LATCH = 0x0080;
const unsigned int __FLASH_ERASE = _FLASH_ERASE;
const unsigned int __FLASH_WRITE_LATCH = _FLASH_WRITE_LATCH;
const unsigned int __FLASH_ERASE_BLOCK = __FLASH_ERASE;
const unsigned int __FLASH_WRITE_BLOCK = __FLASH_WRITE_LATCH;


I hope somebody can help me.

Device: Pic32mx250f128b
MikroC por for pic32
Mikroprog

Thanks

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: Bootloader pic32mx250f128b

#2 Post by stefan.filipovic » 07 Jul 2020 13:24

Hi Adrian,

Have you set the EBASE address in the Edit Project window (Ctrl+Shift+E) to 0x9FC00000 (Boot Flash area)?

Kind regards,
Stefan Filipović

Adrian gxg
Posts: 7
Joined: 25 Jul 2015 16:17

Re: Bootloader pic32mx250f128b

#3 Post by Adrian gxg » 07 Jul 2020 14:42

Hello Stefan thanks for the answer.

I did tomorrow that changes and this are the results

With the EBASE addres equal to 0X9D 00 00 00 or 0x9F C0 10 00 I have

"There is not enough ROM space ( Main.c ; UHD_Driver.c , _lib_System_12.c ; Main.c )

If i Set EBASE to 0x9F C0 00 00

"There is not enough ROM space ( Main.c ; UHD_Driver.c , _lib_System_12.c ; Main.c ) and another 40 lines with the same result ibs, USB,Flasch, etc


i'M USIGN mIKROc pro FOR pic32 V4.0.0 SO I think i have the current version.

Adrian gxg
Posts: 7
Joined: 25 Jul 2015 16:17

Re: Bootloader pic32mx250f128b

#4 Post by Adrian gxg » 07 Jul 2020 14:44

stefan.filipovic wrote:
07 Jul 2020 13:24
Hi Adrian,

Have you set the EBASE address in the Edit Project window (Ctrl+Shift+E) to 0x9FC00000 (Boot Flash area)?

Kind regards,

Hello Stefan thanks for the answer.

I did tomorrow that changes and this are the results

With the EBASE addres equal to 0X9D 00 00 00 or 0x9F C0 10 00 I have

"There is not enough ROM space ( Main.c ; UHD_Driver.c , _lib_System_12.c ; Main.c )

If i Set EBASE to 0x9F C0 00 00

"There is not enough ROM space ( Main.c ; UHD_Driver.c , _lib_System_12.c ; Main.c ) and another 40 lines with the same result ibs, USB,Flasch, etc


i'M USIGN mIKROc pro FOR pic32 V4.0.0 SO I think i have the current version.

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: Bootloader pic32mx250f128b

#5 Post by stefan.filipovic » 08 Jul 2020 13:38

Hi Adrian,

Have you changed anything in the defs, mlk, or USB HID Bootloader project files except the MCU and a configuration in the Edit Project?
If so, I suggest you reinstall the compiler, because it's the easiest way to get it to the default configuration.
With default configuration when you change the MCU device in the bootloader project to PIC32MX250F128B and set EBASE to 0x9FC00000 you should be able to compile the project without errors.

Kind regards,
Stefan Filipović

Adrian gxg
Posts: 7
Joined: 25 Jul 2015 16:17

Re: Bootloader pic32mx250f128b

#6 Post by Adrian gxg » 08 Jul 2020 16:34

stefan.filipovic wrote:
08 Jul 2020 13:38
Hi Adrian,

Have you changed anything in the defs, mlk, or USB HID Bootloader project files except the MCU and a configuration in the Edit Project?
If so, I suggest you reinstall the compiler, because it's the easiest way to get it to the default configuration.
With default configuration when you change the MCU device in the bootloader project to PIC32MX250F128B and set EBASE to 0x9FC00000 you should be able to compile the project without errors.

Kind regards,
Hello Stefan good morning.

Thanks for all the support you give me, now i have working the bootloader with the pic32mx250f128b, only some notes.

1.- The solution was like you mentioned : Reinstall the software and set the EBase to 0x9F C0 00 00, after that i could compile the project without problems, also i already tested my microcontroller charging anoher .hex file using the bootloader and is working.

2.- After reinstall the software and before compile the project i checked what was the default value in the EBASE of the microcontroler and for the pi32mx250f128b was 0x9F C0 10 00, with this for my case not works, only with 0x9F C0 00 00, if i try first with the default Ebase i have some problems to compile the project "not enought memory"

So at the end now is working and i happy for that , thanks Stefan.

Post Reply

Return to “mikroC PRO for PIC32 General”