PIC32 bootloader

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
mpavlica@gmail.com
Posts: 14
Joined: 29 Aug 2023 19:03

PIC32 bootloader

#1 Post by mpavlica@gmail.com » 29 Aug 2023 21:23

Hi everyone
I was wondering, did anyone ever made UART PIC32 bootloader?
I found USB bootloader HID software written in Delphi 7 on libstock by a user named danny, and I wanted to contact him in private message, but my credentials were reset by a mE (oh, by the way, thanks a lot for that!!!) and even that I am old member, now I cant contact users in direct messages. I did try to open his project in Delphi 7 but there were too many errors, so I couldnt manage to adapt that software from USB to serial port.
Any suggestions for PIC32 serial/uart bootloader?
Thanks!
Milan Pavlica
YU7XW

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

Re: PIC32 bootloader

#2 Post by VCC » 30 Aug 2023 11:14

Hi,
there is an old project, writtent in FreePascal, maybe it helps:
viewtopic.php?f=93&t=54346&p=253932&hil ... er#p253932
The compiler used back then, was the official FP + Lazarus. FP was at version 2.x.x, which AFAIK, didn't support Unicode, natively. Now, at version 3.x.x, it is Unicode by default. This may or may not affect the compilation. It required manual installation of a few packages. Personally, I prefer the CodeTyphon edition of FP+Lazarus, from PilotLogic:
https://pilotlogic.com/sitejoom/index.p ... yphon.html It comes as sourcecode, with a lot of packages. You will still have to build the IDE (32 and/or 64-bit), using the CodeTyphon tool (it will have a desktop shortcut after installation).
To build the IDE(s), there are some instructions on their website:
https://pilotlogic.com/sitejoom/index.php/wiki?id=167
https://pilotlogic.com/sitejoom/index.php/wiki?id=202 (Windows)

For this project, I recommend building the 32-bit IDE, which will compile/generate 32-bit executables. At the moment, I don't know (unless I look through the project codebase) if there is any pointer typecast to DWord, which is 32-bit. That would trim pointers on 64-bit, making the 64-bit executables, unusable. When building the "BigIDE", most of the required packages would automatically be installed. If the bootloader project requires packages, which are not in the list, you are kind of on you own.
Also, before loading the project, from the CodeTyphon tool, the existing project has to be "converted" from Lazarus to Typhon (which is, under the hood, renaming the project file extensions). After having a working IDE, you can still install/uninstall packages from the IDE's menu. From Project settings (under the Typhon IDE), you can choose whether to use ANSI or Unicode. Again, without looking at every piece of the codebase, it is hard to tell if using Unicode would work.

:)

mpavlica@gmail.com
Posts: 14
Joined: 29 Aug 2023 19:03

Re: PIC32 bootloader

#3 Post by mpavlica@gmail.com » 30 Aug 2023 18:06

Thanks for a fast reply!

I did download CodeTyphoon but it didnt want to compile, I still have Win7 x64 at that computer where I do all this programming.
Anyway, i managed to install Lazarus FP and libraries and and i can compile software. Also i managed to run code on PIC chip too. Target CPU is PIC32MX170F256D. Now, the only problem that I have is when bootloader connects to PC, I select hex file and in message box it shows "parsing hex file" and it just stops there... Now i just have to figure out where is a problem with parser....
Anyway, moving on.... If you remember any of issues you had before, please share :)

Thanks once again!
Milan Pavlica
YU7XW

mpavlica@gmail.com
Posts: 14
Joined: 29 Aug 2023 19:03

Re: PIC32 bootloader

#4 Post by mpavlica@gmail.com » 30 Aug 2023 20:48

Actually, I have found that version of bootloader in "Archive" folder is not good.
BUT when i try to compile another version which is in PIC32 folder, with original 795 chip it does compile, but when I try to compile for 170F256D i get "Not enough rom"
Any ideas?
Milan Pavlica
YU7XW

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

Re: PIC32 bootloader

#5 Post by VCC » 01 Sep 2023 06:26

mpavlica wrote:
30 Aug 2023 18:06
the only problem that I have is when bootloader connects to PC, I select hex file and in message box it shows "parsing hex file" and it just stops there...
I had some problems with a different (simple) flavour of this parser, when I tried to load a hex file for ARM (see the PIC32MemStatistics tool on Libstock). Not sure if it the same issue. And.. I don't know when I'll have time to look at it. As far as I remember, I've posted the exact parser somewhere here: viewtopic.php?f=93&t=24166&p=121176&hilit=hex#p121176
:)

Post Reply

Return to “mikroC PRO for PIC32 General”