Johannes in a Blue Pill

User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Johannes in a Blue Pill

Post by bexander »

Ok, thanks, that explains alot!
I've just tested the hardware and it works.

Please, can you tell me how I upload first the bootloader and then the firmware, without erasing the bootloader, using stm32flash.
I guess -s option is needed but at what adress?
User avatar
johu
Site Admin
Posts: 5775
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1018 times
Contact:

Re: Johannes in a Blue Pill

Post by johu »

It's 11 years ago that I used stm32flash :) Boot loader is on 0x08000000 and firmware at 0x08001000
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Johannes in a Blue Pill

Post by bexander »

Hm, I've made some progress, I think.
Did:
stm32flash -w stm32_loader.hex -b 115200 /dev/ttyUSB0
stm32flash -w stm32_sine.hex -e 0 -b 115200 /dev/ttyUSB0
Now the onboard green led blinks!

Update:
It works!

Thank you for all your help!!
aravinth
Posts: 14
Joined: Sun Sep 13, 2020 8:34 am
Been thanked: 1 time

Re: Johannes in a Blue Pill

Post by aravinth »

I have flashed my Bluepill with a USB Bootloader and when I flash it with stm32_sine.bin the green led stays on.
Where do I find the bootloader which supports stm32_sine firmware ??
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Johannes in a Blue Pill

Post by bexander »

aravinth
Posts: 14
Joined: Sun Sep 13, 2020 8:34 am
Been thanked: 1 time

Re: Johannes in a Blue Pill

Post by aravinth »

Hello, I've got response from the bluepill.
My Current setup is Bluepill connected with USB to TTL Convertor, I used Putty on linux ubuntu for serial terminal.
I cant seem to start inverter in manual mode, typing start 2 on the terminal gives response as Inverter started, set fslipspnt 10 , set ampnom 10 and response is Set ok, and when I try to select the direction as set dir 1 it says value out of range, so I couldn't see any pwm pulses on any pwm pins.

Someone please tell me how to select the direction.
Thank you.
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Johannes in a Blue Pill

Post by Isaac96 »

Pull the FWD pin to positive (3.3v).
Not sure which pin that is, check the schematics.
User avatar
Bigpie
Posts: 1594
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

Post by Bigpie »

Usart seems funky on my bluepills. Not sure why, if I use USB TTL the communication works, using Olimex mod wifi or demos d1 the communication doesn't work.

Anyone any idea why? These cheap bluepills seem very hit and miss.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Johannes in a Blue Pill

Post by bexander »

Bigpie wrote: Sat Oct 31, 2020 4:38 pm Usart seems funky on my bluepills. Not sure why, if I use USB TTL the communication works, using Olimex mod wifi or demos d1 the communication doesn't work.

Anyone any idea why? These cheap bluepills seem very hit and miss.
What do you mean with seial communication doesn't work with WiFi-module. Please be more specific, is there no transmissions, signals are there but can't receive anything etc.
Have you tried to reverse postion of Tx and Rx when using the WiFi-modules?
User avatar
Bigpie
Posts: 1594
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

Post by Bigpie »

Oops, I get an error on index.html, cannot parse json.

If I look at request or hit 'http://x.x.x.x/cmd?cmd=json' I get

Code: Select all

j��)
I've tried with the Olimex Mod-WiFi that I know works as I pulled it from my inverter.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
aravinth
Posts: 14
Joined: Sun Sep 13, 2020 8:34 am
Been thanked: 1 time

Re: Johannes in a Blue Pill

Post by aravinth »

Hello Isaac96, thanks for your reply.
FWD pin is pb7 on bluepill, I tied pb7 to 3.3v still got no pwm output when I enter start 2 on terminal, I get response as Inverter started but no PWM output.. And also when i type get dir it says 0.
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Johannes in a Blue Pill

Post by bexander »

You need to pull PB1 high as well. Also pull PB6 high for a short period to start the inverter.
Now if you have no errors you should get PWM.
You proably will have to use a potentiometer for current feedback and DC-bus feedback, otherwise overcurrent and udclow error is likely, and no PWM.
aravinth
Posts: 14
Joined: Sun Sep 13, 2020 8:34 am
Been thanked: 1 time

Re: Johannes in a Blue Pill

Post by aravinth »

I finally got PWM in manual mode.
Here's what I did To Start the Inverter in manual mode on bluepill, might help newbie like me.
Bluepill on breadboard with 5v, 3.3v and GND pulled out.
Pull B1 to 3.3v , B7 to 3.3v , and B6 to 3.3v momentarily. (B1_ MPROT/UAUX), (B6-Start),(B7-FWD).
Pull B8 to GND . (B8-REV)
Then issue "start 2" on terminal
Then type set "fslipspnt 1"
Then "ampnom 1"
This outputs a clean 50/50 duty cycle on all 6 PWM outputs.
Next I'm gonna try connecting the bluepill to the ESP8266, Wish me luck.
Post Reply