Pololu P-Star 45K50 Bootloader

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

I need help to setup a third party bootloader in Flowcode 8 for the Pololu P-Star 45K50.

First of all I downloaded the Pololu Bootloader Utility ( https://www.pololu.com/product/3156/resources ) and installed that in my Flowcode 8 Tools folder.

Then I went into compiler options and in the Programmer tab I pointed it to the P-Load application (see picture "Compiler Options")

Since I do not know what to do under the parameters tab I left that as default (see picture "Compiler Options"), but this must be wrong?

When I run the compiler I get an error message, see picture "Compiler Message"

Under device manager the compiler does show see picture "Device Manager"

I have never before tried to setup third party bootloaders since I normally use E-Blocks and Arduino boards that program with the default Flowcode settings.
Attachments
Device Manager
Device Manager
Device manager.jpg (65.54 KiB) Viewed 5659 times
Compiler Options
Compiler Options
Compiler options.jpg (63.21 KiB) Viewed 5659 times
Compiler Message
Compiler Message
Compiler Message.jpg (71.37 KiB) Viewed 5659 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Hello,

The system cannot find the file specified means that it cannot find the p-load.exe application.

The path doesn't seem quite right as it should be inside the Flowcode v8/tools folder.

Try this instead as the path.

$(appdir)tools\Pololu\USB Bootloader Utility\bin\p-load.exe

the Spaces in the USB Bootloader Utility folder might also be causing problems. you could rename the folder to say boot and the path would become.

$(appdir)tools\Pololu\boot\bin\p-load.exe

As for the parameters start with --help and this should detail what is available for you to pass.

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

I tried the options you offered, settling for the second one that you said would be better if I removed the spaces and just use Boot. Now it tells me that the chip is "unknown". Any advice on that?
Attachments
Unknown Chip
Unknown Chip
Unknown Option.jpg (61.34 KiB) Viewed 5648 times
Compiler
Compiler
Compiler.jpg (67.25 KiB) Viewed 5648 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Hello,

First change the parameters to --help and that should tell you what you need to provide. Let us know what this says and I can help from there.

I looked through the source code but couldn't find the right part for the command line parameters.

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

Hallo Benj,

I changed the parameters to --Help and the attached message is what I got. Is this what you were looking for?
Attachments
Help.jpg
Help.jpg (45.69 KiB) Viewed 5617 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Hello,

You've changed the parameters for the compiler not the programmer :(

Restore the compiler parameters back to default and it should compile again.

I also think it needs to be all lowercase --help.

--h should also work.

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

:oops: Now that is an embarrassing mistake!!! Sorry for that :oops:

I did what you said and it came back with 4 examples. Which one do I use and why?

Thank you for all your patience with me!!
Attachments
HELP.jpg
HELP.jpg (51.76 KiB) Viewed 5610 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Hello,

No worries, I've done it myself more than once :D

It looks like not all the options are shown there but I am guessing from the examples you need something like this for your parameters.

-t p-star -w "$(outdir)$(target).hex"

Try that and see how you get on.

The examples seem to do this.

1) Write a .hex file to the device - probably the one you want.
2) Write an unknown file type to the device, could be something specific to p-star?
3) Write the flash of the device leaving EEPROM untouched with a delay and a restart?
4) Erase the device

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

Hallo,

I used the parameters you suggested: -t p-star -w "$(outdir)$(target).hex"

In Flowcode it looks like its working fine, the LED's on the board flashed when it started the upload, but the program is not running on the board. I have tried and tested this program on both an Arduino Uno R3 and a E-Blocks 2 BL0032-1 and it works fine on those. That tells me there must still be a bug in the bootloader for the Pololu? I attached a screenshot.

Is the message "Do Nothing" in the "Launching the linker/assembler...." correct?
Attachments
HELP.jpg
HELP.jpg (69.79 KiB) Viewed 5602 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Looks like you're nearly there now.

Have you checked the board is in bootloader mode?
https://www.pololu.com/docs/0J62/5.2

According to this you also need to use the XC8 code offset parameter to shift the start of your code to avoid the existing bootloader.
https://www.pololu.com/docs/0J62/5.3

I've edited the compiler batch file to do this for you,

Simply copy the attached file into this directory "C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch", you might want to backup the existing file so you can go back if/when needed.
pic_xc8_comp.bat
(278 Bytes) Downloaded 146 times
The linker should be set to donothing, this is correct. Some compiler toolchains require a linker but PIC does not.

Fingers crossed.

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

Hallo,

I have done as you told me and then tried it again, twice, and both times this message came up.
Attachments
HELP.jpg
HELP.jpg (52.39 KiB) Viewed 5589 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by Benj »

Sorry I got the batch file slightly wrong,

I've now fixed it and re-uploaded.

User avatar
andreeksteen
Posts: 12
Joined: Mon Jan 06, 2020 9:55 am
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: Pololu P-Star 45K50 Bootloader

Post by andreeksteen »

Hallo,

Thank you SO-SO much for all your help. It now works perfectly, you are a star!!

For anyone having issues with the Pololu P-Star Bootloader in Flowcode, here is a short summary of what Benj told me to do to get it working:

1: Install P-Load bootloader in your Flowcode8/Tools folder and rename it to "Boot" instead of the default "USB Bootloader Utility" : https://www.pololu.com/product/3156/resources

2: Under Compiler options - Programmer - Location paste the following code: $(appdir)tools\Pololu\boot\bin\p-load.exe

3: Under the Parameters Tab paste the following code: -t p-star -w "$(outdir)$(target).hex"

4: Go to "C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch" and save the existing file as a backup. Now insert the new batch file attached to this post.

You should now be able to program all the Pololu P-Star as well as A-Star boards.

Once again thanks to Benj for all his help and patience.
Attachments
pic_xc8_comp.bat
New batch file by Benj
(278 Bytes) Downloaded 140 times
Compiler setup
Compiler setup
Compiler Options.jpg (44.01 KiB) Viewed 5582 times
Andre Eksteen

Biotech Emporium cc
Reg: 2002/104664/23
P O Box 433
Oudtshoorn
South Africa
6620

Post Reply