Believe me gentlemen, there are many of us that appreciate the effort you are putting into this.
Not sure how I can help, but I am happy to proofread and ask questions if something isn't clear.
Gary
Believe me gentlemen, there are many of us that appreciate the effort you are putting into this.
Thanks a bunch Damien!
Damien suggested that they're not critical and the motor can be run without them, so that was my plan. But, he notes: "Requires external divider circuit" so I presume that's the same VCC/2 thing you're talking about?Be careful of the current sensor outputs on the gen 2 inverter,
Bear with my ignorance, there's not a lot of answers when someone is asking the wrong questions..c) Get USB <-> UART adapter, install a web interface on your local machine
I follow, but:I highly recommend going with a).
I did b). and c). and d). Lost a lot of time on that..
The hex file is the precompiled firmware or "operating system" for the blue pill. When uploaded it will tell the blue pill what we want it to do and with which pin to do it.- We use ST-LINK to do something to the Blue Pill. We uploaded (?) a hex file. In laymen's terms, what was that hex file? Why was it uploaded? What did it accomplish? Is that hex file just sitting on the Blue Pill now waiting for something, or is the Blue Pill from that moment forward actually using that hex file? Or did the hex file just tell the ST-Link software how to program the Blue Pill, which it did, and the hex file doesn't actually exist on the Blue Pill anywhere, only the result of it being used?
You want to edit settings and parameters to fit your setup - battery voltage, motor current, throttle levels and the like.- The Blue Pill needs some other kind of programming, which can only be done over the UART connection on the Blue Pill (not the ST-Link pins), the convenient way of doing so is to connect it to a computer. The computer can't directly speak or connect "UART", it doesn't have a UART port where you just plug in a UART cable, that doesn't exist, so you need use something you can plug into a computer, I.E. USB. So you have to use a USB-UART converter (another small electronic device you buy), so that the UART pins on the Blue Pill can go through the converter and something out the other end plugs into a USB port on a computer. This can be done over wifi or with wires.
The esp8266 acts like a web server that presents Johannes web interface to you over wifi and will send the values you put in it to the blue pill with the right commands, at the right speed, with the correct formatting.- If you want to do it over wifi, you now need another microcontroller, an ESP8266 (of which there are dozens of variants with various capabilities), most (all?) of which are Arduino code compatible, Arduino being the most popular hobby-level microcontroller. This type of board is also maybe called an Olimex? Presumably you'd need to program the wifi microcontroller that you use to program the Blue Pill microcontroller? So there's a whole series of steps to initializing a virgin ESP8266 to even get to that point? That's where the soldering jumpers and such comes from? The ESP8266 board you use will plug into Damien's Prius Control Board so that it can wire to the UART pins on the Blue Pill and then connect to a computer as a wifi device.
..yes..- The reason for all of this is because the Blue Pill, despite being a versatile microcontroller in other ways that were suitable for the project, does not have its own UART to USB or UART to wifi capability?
If you use USB you need to start a web server on your computer to present the web interface ( and connect it to the right COM port represents your usb->uart interface). The usb->uart interface should be a 3.3V version, most older ones are 5V.- Once you connect to the UART, either via USB or Wifi, you can then use the web interface Johu wrote to make the actual motor/vehicle/oprational -specific programming changes to the software (and also create them in the first place?).
For a first try/HELLO WORLD on the bench it can be useful.- You could also use some kind of basic terminal interface instead of the web-interface Johu wrote, and send 50 commands to the Blue Pill, one at a time. But there's no reason to do this because the web interface is free, easy to install, intuitive, and automates this process.
Consider a microcontroller as a sort of small self-contained computer that can only run one program. That program is contained in the hex file. The ST-Link software uploads it to the blue pill which will then run it whenever it is powered up or reset.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - We use ST-LINK to do something to the Blue Pill. We uploaded (?) a hex file. In laymen's terms, what was that hex file? Why was it uploaded? What did it accomplish? Is that hex file just sitting on the Blue Pill now waiting for something, or is the Blue Pill from that moment forward actually using that hex file? Or did the hex file just tell the ST-Link software how to program the Blue Pill, which it did, and the hex file doesn't actually exist on the Blue Pill anywhere, only the result of it being used?
The program will do different things based on it's settings, these settings are configured over the UART, this is simpler than having to change the code, recompile the program and then re-upload it each time you want to change a setting.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - Even though the ST-LINK was just used to push some kind of hex file to the Blue Pill over wires, it can't be used to push some other kind of code that it also needs? There are two different types of code the Blue Pill needs? (I had previously thought the wifi was only added to remove the necessity of cabling up via ST-Link, this appears false, there is a second type of cabling, a second type of converter, and a second type of programming?)
Correct - see above.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - The Blue Pill needs some other kind of programming, which can only be done over the UART connection on the Blue Pill (not the ST-Link pins), the convenient way of doing so is to connect it to a computer. The computer can't directly speak or connect "UART", it doesn't have a UART port where you just plug in a UART cable, that doesn't exist, so you need use something you can plug into a computer, I.E. USB. So you have to use a USB-UART converter (another small electronic device you buy), so that the UART pins on the Blue Pill can go through the converter and something out the other end plugs into a USB port on a computer. This can be done over wifi or with wires.
All ESP8266 boards are arduino compatible, the only difference between them is which pins on the microcontroller are connected to pins on the board and the physical layout of the board. (The Wemos D1 mini also has a USB interface on the board)MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - If you want to do it over wifi, you now need another microcontroller, an ESP8266 (of which there are dozens of variants with various capabilities), most (all?) of which are Arduino code compatible, Arduino being the most popular hobby-level microcontroller. This type of board is also maybe called an Olimex? Presumably you'd need to program the wifi microcontroller that you use to program the Blue Pill microcontroller? So there's a whole series of steps to initializing a virgin ESP8266 to even get to that point? That's where the soldering jumpers and such comes from? The ESP8266 board you use will plug into Damien's Prius Control Board so that it can wire to the UART pins on the Blue Pill and then connect to a computer as a wifi device.
Correct.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - The reason for all of this is because the Blue Pill, despite being a versatile microcontroller in other ways that were suitable for the project, does not have its own UART to USB or UART to wifi capability?
See above. The web interface just gives you a nicer interface to read the settings from the controller and change them. Johu's program allows a new hex file to be sent to the controller over the UART so you don't need the ST-Link to change the main program (the hex file) any more.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - Once you connect to the UART, either via USB or Wifi, you can then use the web interface Johu wrote to make the actual motor/vehicle/oprational -specific programming changes to the software (and also create them in the first place?).
Correct.MattsAwesomeStuff wrote: ↑Tue Dec 31, 2019 8:04 pm - You could also use some kind of basic terminal interface instead of the web-interface Johu wrote, and send 50 commands to the Blue Pill, one at a time. But there's no reason to do this because the web interface is free, easy to install, intuitive, and automates this process.
What's an Olimex? Is Olimex to ESP8266, what Blue Pill is to STM32?with a procedure to easily upload code onto Olimex chip
Ahhhhhh...
If Open Source was an online shoe store: "There are five different ways to measure your shoe size, all of which use an incompatible set of numbers between 1 and 20. It's important to do some reading on which method you think you've learned. Any pair of shoes could use any of these methods and are not labelled, you'll have to do some research about their manufacturing history to determine what method they likely used." I JUST WANT TO BUY SOME SHOES!That also can be done in various ways, which is the beauty of open source.
Oh, I think I get it after the 3 of you explained what I thought were things I already understood. I was missing a big piece of the puzzle.4. You can use Wifi gizmo and be free of choice which OS or PC you use, you can even use your Apple or Android phone.
Ahh, neat. Well since I can't find my FTDI converter, that's a solid plan B.You could also take advantage of the hard work done by member Dima and install his windows based web interace. Installs on Windows 10 but have not tried earlier versions. Ir avoids the need to install Apache web server.
Yes, the absolute minimum you need to “flash“ (that is, write to the STM32 internal flash memory) is the bootloader. As soon as that happened, the actual firmware can be programmed via uart=serial link=FTDI=CH340=ESP8266.MattsAwesomeStuff wrote: ↑Wed Jan 01, 2020 5:51 am So, the ST-Link is only good for replacing the whole bootloader at a time, and can only be done via pre-compiled hex files?
Understood. But not the handy web interface, you'd be spitting commands one at a time using terminal, (unless you're using Dima's work that Kiwifat linked to above), and, you'd still need a UART-USB converter, which is actually more expensive than a little ESP8266 board, and less convenient.
That would be amazing, thank youMattsAwesomeStuff wrote: ↑Wed Jan 01, 2020 11:46 am I'll try to make sure as many people can benefit from that as possible without anyone having to put in extra or repetitive work.
Ahhhh...MattsAwesomeStuff wrote: ↑Wed Jan 01, 2020 11:46 am So my goal is that at the end of this process I can have a novice sit down at the Prius Gen 2 wiki, make all their purchases in 30 minutes, and when parts arrive go from a pile of parts into something that can spin a motor in about 2-3 hours without having to pester anyone for questions or clarifications. So I want to say thank you again to everyone who's invested time in answering these questions, I'll try to make sure as many people can benefit from that as possible without anyone having to put in extra or repetitive work.