Johannes in a Blue Pill
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Got myself a blue pill
So the best way to figure out whether running on a blue pill is turning on GPIOC12 (Led port of Olimex and other HW revisions) and then read it back. Since the port does not exist on the C8 it reads back as 0.
I also checked the FLASH_SIZE register and its actually 0x80 = 128k flash
Finally I found out that TIM4 actually runs, it is just not connected to any pins. So theoretically it would be possible to restore the over current reference pins using TIM2 and doing the scheduling with TIM4.
So the best way to figure out whether running on a blue pill is turning on GPIOC12 (Led port of Olimex and other HW revisions) and then read it back. Since the port does not exist on the C8 it reads back as 0.
I also checked the FLASH_SIZE register and its actually 0x80 = 128k flash
Finally I found out that TIM4 actually runs, it is just not connected to any pins. So theoretically it would be possible to restore the over current reference pins using TIM2 and doing the scheduling with TIM4.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
So in order to restore the over current reference pins I'd have to delete ESTOP (quite unimportant) and remap DCSW to PC15.
Damien, what do you think?
Damien, what do you think?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Jack Bauer
- Posts: 3563
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 1 time
- Been thanked: 87 times
- Contact:
Re: Johannes in a Blue Pill
Well , the only pcb I have done so far for the blue pill is the little gen 2 prius board which i can just hack up my own version to run in a pinch. So i guess it makes sense to bring that feature back if possible.
I'm going to need a hacksaw
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Alright, here is a new pin map and firmware
- Attachments
-
- stm32_sine.zip
- (62.53 KiB) Downloaded 139 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Jack Bauer
- Posts: 3563
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 1 time
- Been thanked: 87 times
- Contact:
Re: Johannes in a Blue Pill
Going to be such a laugh running Model 3 motor with a blue pill:)
I'm going to need a hacksaw
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Next up: the 36-pin part
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 176
- Joined: Tue Aug 13, 2019 4:32 pm
- Location: Russia, Stavropol
- Has thanked: 14 times
- Been thanked: 5 times
Re: Johannes in a Blue Pill
Good evening, I would like to ask if a single-channel encoder will work on it? What is the exciter pin used for?
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Single channel not yet but I think it can be restored.
Exciter pin generates a square wave in resolver mode that is turned into a sine wave by a 3-pole low pass filter and then amplified by an audio amplifier. With that the resolvers primary winding is excited, see wikipedia why this is needed.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 176
- Joined: Tue Aug 13, 2019 4:32 pm
- Location: Russia, Stavropol
- Has thanked: 14 times
- Been thanked: 5 times
Re: Johannes in a Blue Pill
If it is not difficult you can make support for a single-channel encoder.
-
- Posts: 391
- Joined: Sun Aug 25, 2019 12:39 pm
- Location: Finland
- Has thanked: 49 times
- Been thanked: 10 times
Re: Johannes in a Blue Pill
Is it actually possible to run a tesla motor with the blue pill?
A have a handfull of those here at home.
A have a handfull of those here at home.
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
- Jack Bauer
- Posts: 3563
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 1 time
- Been thanked: 87 times
- Contact:
-
- Posts: 176
- Joined: Tue Aug 13, 2019 4:32 pm
- Location: Russia, Stavropol
- Has thanked: 14 times
- Been thanked: 5 times
Re: Johannes in a Blue Pill
Good evening, I collected on such a Board inverter for the test, but there was a mistake DESAT what are the conditions for its appearance?
Re: Johannes in a Blue Pill
Are you getting the desat error flagged every time you try start your dev board? You need to pull the fault line low, I believe the same line is used for a few different faults.
Re: Johannes in a Blue Pill
A number of the Blue Pills for sale on eBay only have the 64k processor, so you won’t be able to save your parameters unless you change the start of the eeprom block.
0x8001fc00 -> 0x800fc00, basically replace the 1 with a zero.
The current firmware is about 38k, so will easily fit inside the smaller memory.
0x8001fc00 -> 0x800fc00, basically replace the 1 with a zero.
The current firmware is about 38k, so will easily fit inside the smaller memory.
-
- Posts: 176
- Joined: Tue Aug 13, 2019 4:32 pm
- Location: Russia, Stavropol
- Has thanked: 14 times
- Been thanked: 5 times
Re: Johannes in a Blue Pill
I think I found the cause, you need to pin pb12 to apply logical unit, as in previous schemes was 0, as then to implement the current protection?
- Bigpie
- Posts: 1595
- Joined: Wed Apr 10, 2019 8:11 pm
- Location: South Yorkshire, UK
- Has thanked: 75 times
- Been thanked: 304 times
Re: Johannes in a Blue Pill
I'm having a little play with my newly arrived Blue Pill, I've moved the little jumper across and run ./stm32flash -r ~/open-inverter/tumanako-inverter-fw-bootloader/stm32_loader.hex /dev/tty.wchusbserial1410
Is there any way of checking this has flashed the inverter fw bootloader as expected?
Is there any way of checking this has flashed the inverter fw bootloader as expected?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
-
- Posts: 260
- Joined: Sat Jan 12, 2019 12:39 am
- Location: UK
Re: Johannes in a Blue Pill
if you don't get any errors reported it's almost certainly worked. You could add the -v argument for stm32flash to get it to verify.
Have you tried flashing a simple blink program that just blinks the LED on the board? that would also prove that flashing works.
I've used one of the cheap st-link clones and st-flash which works well and gives a whole heap of useful output when I've played with the blue pill in the past.
Have you tried flashing a simple blink program that just blinks the LED on the board? that would also prove that flashing works.
I've used one of the cheap st-link clones and st-flash which works well and gives a whole heap of useful output when I've played with the blue pill in the past.
- Bigpie
- Posts: 1595
- Joined: Wed Apr 10, 2019 8:11 pm
- Location: South Yorkshire, UK
- Has thanked: 75 times
- Been thanked: 304 times
Re: Johannes in a Blue Pill
I previously flashed a blink sketch from Arduino IDE using FTDI. I've now flashed both the bootloader and firmware.
I've moved the jumper back over and reset. The LED still blinks, so I'm not 100% convinced it has flashed over.
Code: Select all
~/Downloads/stm32flash/stm32flash -r ~/open-inverter/stm32-sine/stm32_sine.hex /dev/tty.wchusbserial1410
stm32flash 0.5
http://stm32flash.sourceforge.net/
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (STM32F10xxx Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Memory read
Read address 0x08020000 (100.00%) Done.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
-
- Posts: 260
- Joined: Sat Jan 12, 2019 12:39 am
- Location: UK
Re: Johannes in a Blue Pill
According to http://manpages.ubuntu.com/manpages/bio ... ash.1.html -r reads the flash, doesn't write it. You'd need -w to write it, probably best regenerate stm32_sine.hex as it's a blinky now then.
- Bigpie
- Posts: 1595
- Joined: Wed Apr 10, 2019 8:11 pm
- Location: South Yorkshire, UK
- Has thanked: 75 times
- Been thanked: 304 times
Re: Johannes in a Blue Pill
Doh, thanks
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Re: Johannes in a Blue Pill
If Blue-Pill has a built-in bootloader this means we don't really need to flash "tumanako-inverter-fw-bootloader"?stm32flash - Open source cross platform flash program for the STM32 ARM microcontrollers using the built-in ST serial bootloader over UART or I2C
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Depends on whether it listens on UART3. But with stm32flash and the jumpers you can certainly make a JTAG/SWD adapter redundant.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 260
- Joined: Sat Jan 12, 2019 12:39 am
- Location: UK
Re: Johannes in a Blue Pill
To use the serial bootloader you need to set a jumper on top of the board which pulls a pin up to 3.3V. This isn't pin isn't broken out to the pin headers along the sides, so yes you could use that, but you can't pull the pin up easily from an external source.
Re: Johannes in a Blue Pill
I hate to be a party pooper, but is it a good idea to save a few bucks on the ECU?
I definitely prefer a proprietary and fully populated board, with all the necessary pins broken out.
Without some low cost plugin boards.
The cost for making custom boards are not very high now a days.
I definitely prefer a proprietary and fully populated board, with all the necessary pins broken out.
Without some low cost plugin boards.
The cost for making custom boards are not very high now a days.
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
- johu
- Site Admin
- Posts: 5788
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1023 times
- Contact:
Re: Johannes in a Blue Pill
Well the current kit uses the same technique just with an Olimex board. I mean the Blue pill is just an STM32 with its pins broken out. I think it is more DIY friendly to solder a few through hole components than it is to solder an SMD board. If you just want to have a play things are not that serious either.
When it comes to fully populated boards of course SMD is the better option.
When it comes to fully populated boards of course SMD is the better option.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9