thirtythreeforty / bullycpp

A Bully Bootloader PC driver program
GNU General Public License v3.0
12 stars 6 forks source link

Programming via commmand line #15

Closed vidavidorra closed 8 years ago

vidavidorra commented 8 years ago

Hi, First of all great work! I'm using the BullyCPP program and it's working great and looks nice! I really like the feature of having the MCLR button and be able to keep the MCU in reset.

Info

BullyCPP build: 0.8.1-win32 Windows version: 10.0.10240 Bootloader BaudRate: 115200

Problem

I'm trying to setup MPLAB X to program using the BullyCPP program and was starting with manually programming a .hex file using the command line. So I tried the command BullyCPP-0.8.1-win32.exe --baud 115200 --mclr file.hex which runs the GUI and indeed shows that the baud rate is set to 115200 and test.hex is opened. But however it doesn't program it, until I press the Program! button. Also not working when I use the full path to the hex file or add the --no-gui option. Only one COM port is attached to the PC and is selected in the GUI, and adding -D COM4 doesn't help either.

Any ideas why?

vidavidorra commented 8 years ago

Just tried it on my MacBook and ran the command ./BullyCPP --baud 115200 --no-gui --device usbserial-DAZ1IE8T --mclr /Users/username/Downloads/test.hex and it programmed the MCU there. However when not using the --no-gui flag, the GUI is shown and it's not programming until the Program! button is pressed manually.

So with the gui disabled it works and the terminal is giving information about what it's programming and stuff. @thirtythreeforty maybe an idea to explicitly put it in the README that when using the command line the option --no-gui must be used?

Also tested it back on my Windows 10 PC and it's working there as well using the command BullyCPP-0.8.1-win32.exe --baud 115200 --no-gui --device COM4 --mclr test.hex However the command prompt is not showing any feedback about the program status (I.e. what page it is programming, errors that have ocurred, etc.). Any way to make that happen?

BTW the --help option is not printing any info on the command prompt, even not when using --help --no-gui. Maby that is related to not printing the program status?

thirtythreeforty commented 8 years ago

Thanks for the feedback!

You definitely need the --no-gui argument, or it'll just open the GUI (and fill out the fields with the various values passed in, as you saw). You also need --device when programming from the command line, even if there's only one COM port; if that's irritating, let me know and I could probably make it auto-choose if there's only one port. With --no-gui, it should program the device and exit, exactly like you'd want if you're integrating it with MPLAB.

So. Can you try the following command from a terminal?

BullyCPP-0.8.1-win32.exe --no-gui --device COM4 --baud 115200 --mclr file.hex
thirtythreeforty commented 8 years ago

Ah, you sniped me! Yeah, I'll clarify that you need --no-gui for all command-line operations.

I'll have to get back to you about the Windows programming feedback; I'm normally on a Linux machine. I'm also impressed that --help doesn't print anything (it definitely does on Linux and probably also on OS X); I would imagine that it's the same problem that's preventing the progress from being printed.

vidavidorra commented 8 years ago

Thank you for your quick response!

See my previous comment, you were probably typing your comment when I was posting mine, haha. I've tried it on my Mac earlier and --help works there! One more thing, I've just done some more testing on my Windows machine and the command you showed in your previous comment does not work. I think it has something to do with the order of the options because

BullyCPP-0.8.1-win32.exe --no-gui --device COM4 --baud 115200 --mclr file.hex

is not programming and is just resetting the device, but

BullyCPP-0.8.1-win32.exe --baud 115200 --no-gui --device COM4 --mclr test.hex

is programming.

thirtythreeforty commented 8 years ago

Oh, that's interesting. So there are a couple bugs here then:

vidavidorra commented 8 years ago

Yes that's right! I could do some more testing on the different options and order if you'll want me to. I could also test it on a (virtual) Windows 7 machine to see if the program behaves the same way there if you think that is useful. Just let me know! I'm running Windows 10.

Also do you want me to create separate issues for those?

thirtythreeforty commented 8 years ago

If you don't mind creating separate issues, that would be great. I have a Win7 and a Win10 box but I need to get VS installed (not to mention my university workload), so this might take me a couple days to get to. At any rate, I'm glad there's a workaround for you.

vidavidorra commented 8 years ago

I'll create the issues somewhere tomorrow. Take your time, I get it! I'm in university as well, school goes first!

thirtythreeforty commented 8 years ago

Thanks! I'll close this in favor of those two issues.