Page 1 of 1
Pololu P-Star 45K50 Bootloader
Posted: Wed Feb 05, 2020 3:55 pm
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.
Re: Pololu P-Star 45K50 Bootloader
Posted: Wed Feb 05, 2020 4:15 pm
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.
Re: Pololu P-Star 45K50 Bootloader
Posted: Wed Feb 05, 2020 6:01 pm
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?
Re: Pololu P-Star 45K50 Bootloader
Posted: Wed Feb 05, 2020 7:01 pm
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.
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 10:49 am
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?
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 11:00 am
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.
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 11:23 am
by andreeksteen

Now that is an embarrassing mistake!!! Sorry for that
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!!
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 11:32 am
by Benj
Hello,
No worries, I've done it myself more than once
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
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 11:56 am
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?
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 12:08 pm
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.
The linker should be set to donothing, this is correct. Some compiler toolchains require a linker but PIC does not.
Fingers crossed.
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 12:22 pm
by andreeksteen
Hallo,
I have done as you told me and then tried it again, twice, and both times this message came up.
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 12:42 pm
by Benj
Sorry I got the batch file slightly wrong,
I've now fixed it and re-uploaded.
Re: Pololu P-Star 45K50 Bootloader
Posted: Thu Feb 06, 2020 1:08 pm
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.