Help: Failed programming the Blue Pill


Yen Quy
 

I was able to compiled the OnStep sketch. However, I got this error when trying to flash the STM32 board.  Boot0 is connected to the '1' and boot1 is connected to 0.  Please correct me if I am wrong, boot0 is on top lookiing at the STM board from the USB serial port!
Also, the DS3231 is very hot!
What could be the problem?

Thanks in advance.

Sketch uses 114876 bytes (87%) of program storage space. Maximum is 131072 bytes.
Global variables use 11284 bytes (55%) of dynamic memory, leaving 9196 bytes for local variables. Maximum is 20480 bytes.
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.7.0                  
      -------------------------------------------------------------------
 
Serial Port COM9 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
 
Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... 
 


Khalid Baheyeldin
 

On Sun, Jul 18, 2021 at 11:13 PM, Yen Quy wrote:
Also, the DS3231 is very hot!
This means there is a short somewhere.
Do NOT POWER ON THE PCB AGAIN.

First, check visually for solder bridges anywhere on the board.
Then using a multimeter, check all adjacent pins on all modules, starting with the DS3231.
Make sure nothing is shorted.

There was also recently a case where someone ordered PCBs only to find that the ground
plane is connected to things that should be connected, due to an error in manufacturing
caused by the editor tool at EasyEDA.


Yen Quy
 

Thanks, Khalid.  I found out last night, I missed a very crucial step, I forgot to adjust the voltage of the LM2596 and was sending 11 something volts to the board. I'm sure the STM32 is toasted, the DS3231 probably is too.  I wouldn't be surprised if the motor drivers and the WIFI module are toasted!

it was an over sight on my part, the info is there in the wiki!  It's a good source of info but I think it's very easy to be overlooked!
It was my fault no matter what!



Khalid Baheyeldin
 

On Mon, Jul 19, 2021 at 05:28 PM, Yen Quy wrote:
I found out last night, I missed a very crucial step, I forgot to adjust the voltage of the LM2596 and was sending 11 something volts to the board. I'm sure the STM32 is toasted, the DS3231 probably is too.  I wouldn't be surprised if the motor drivers and the WIFI module are toasted!
I made that same mistake once, despite Dave's document saying explicitly to adjust the power output BEFORE plugging in anything. I noticed that the DS3231 is very hot.

Luckily, I realized this quick enough to not have any damaged modules.


Yen Quy
 

Thanks, Khalid.  I'm sure the STM32 board and the RTC are toasted.  I'm not quite sure about the WIFI module.  Was the WIFI module also damaged in your case?
A good lesson learned. Luckily enough, I kind of anticipate I would screw up somewhere, so I have several of each for replacement :-)


Yen Quy
 

I replaced the STM32, the RTC and reprogrammed again.  Below is the output, how do I know if it is programmed completely? I waited for a few minutes and reset the board, changed the boot jumpers.  The green LED on the STM blinks about half a second interval. I assume it's its heartbeat.  How do I verify it's functioning correctly?

Sketch uses 114876 bytes (87%) of program storage space. Maximum is 131072 bytes.
Global variables use 11284 bytes (55%) of dynamic memory, leaving 9196 bytes for local variables. Maximum is 20480 bytes.
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.7.0                  
      -------------------------------------------------------------------
 
Serial Port COM9 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x410 
BootLoader protocol version: 2.2
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M3
 
 
 
Memory Programming ...
Opening and parsing file: OnStep.ino.bin
  File          : OnStep.ino.bin
  Size          : 115180 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 112]
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:19.339
 
RUNNING Program ... 
  Address:      : 0x8000000
Start operation achieved successfully
 


Khalid Baheyeldin
 

For the WiFi adapter, it is easy to test.
Basically if it blinks for ~ 8-10 seconds then its LED goes solid, then it can connect to OnStep.

For the STM32, output looks good.
Did you turn on auto start tracking in Config.h?
If not, then it should not be blinking.

Using Serial Monitor in the IDE, enter the commands at the end of the this page.
See if you get responses back.


Yen Quy
 

Thanks, Khalid.  I did turn on auto tracking in the config.h.
The WIFI module appears to work, I was able to program it and connect to OnStep.  However, when connect to the computer, it only appears as 'USB to Serial' port 10, as apposed to 'USB to Serial CH340'.  I don't know if that matters.  It also doesn't assign an IP to the PC connected to the Onstep WIFI.  The 2nd Wemos I'm preparing shows the correct enumeration in Device Manager with the 'CH340' in its name.  I'll see it I can get a valid IP when I try this new module.


Khalid Baheyeldin
 

I can't tell you what happens on Windows, because I don't use it.
On Linux, USB drivers are different: they are universal, and builtin. So we don't even notice them.

Regardless, whatever Wemos you are using should be flashed with the Wifi component (or SmartWebServer if you are adventurous). Then when you power on OnStep, the STM32 will blink (because tracking is auto started), then the Wemos will blink for ~ 8 or so seconds, then go solid. At that point you should be able to connect to the ONSTEP access point from a phone.


Yen Quy
 

Yea, I was able to connect to Onstep. But my laptop has a 169 address which is invalid, and I couldn't connect to web server at 192.168.0.1! I wonder if that Wemos has problem because it was exposed to high voltage. So I'll replace it with a new one after work to see.


Khalid Baheyeldin
 

If the Wemos advertises an access points and allows connections to it, then it is probably working.

The 169 address is something reported occasionally here.
Can't remember if using the specific board manager version that is on the Wiki fixed it or what.