problems in uploading code to stm32 bluepill

manveen_singh:
i am comming from there only .

I don't understand. Did you mean you asked the question on that forum already? If so, you should say that up front. What answer did you get?

faced same issue weeks ago with FTDI board,

tried with ST Link and worked like a charm

PaulRB:
I don't understand. Did you mean you asked the question on that forum already? If so, you should say that up front. What answer did you get?

My account was not allowed to post anything there as of now.

so when i said that i am comming from there. i meant that i have looked a lot of similar forums there . but none of them worked for me .
i have not posted anything there.

KASSIMSAMJI:
tried with ST Link and worked like a charm

I also ttried that . nothing worked. the core is locked up error cam . then i tried all the jumper settings . again nothing worked. again the same error came.

in on jumper setting. it did show that programed sucessfully . but nothing happened. LED didnt blink.

i looked thru the code in the memory . using thier stlink utility before and after programming. there were some changes in the binary . but still nothing happened,

Have you put the jumpers in the right mode as described in the first link you posted?
There is a position for programming and another position for running programs.
You can upload using ST-link too.

zoomx:
You can upload using ST-link too.

yes

zoomx:
You can upload using ST-link too.

i am techinicaly able to upload the code. but nothing is happening . please see reply #6

Try an example that print on serial like this one that print on all serials and has a blink too, joust to test that maybe the problem is on the LED.

/*
  STM32_serial_test

  Use PC13 instead of PIN13 for generic STM32 boards.
  Print on every serial to identify them.

  Led pin
  BluePill  PC13
  MapleMini PB1
  
*/
#define LED PC13 //PC 13 on BluePill, PB1 on Maple Mini

void blink() {
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(200);              // wait for a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait for a second
}

void setup() {
  // initialize pins PC13, as an output.
  pinMode(LED, OUTPUT);
  Serial.begin(115200);
  Serial1.begin(115200);
  Serial2.begin(115200);
  //Serial3.begin(115200);
  Serial.println("Hello world this is Serial");
  Serial1.println("Hello world this is Serial1");
  Serial2.println("Hello world this is Serial2");
  //Serial3.println("Hello world this is Serial3");

  blink();
}

void loop() {
  blink();              //
  Serial.println("It Works on serial");
  Serial1.println("It Works on serial1");
  Serial2.println("It Works on serial2");
}

tried it. nothing happened.

i seiral didnt not work also.
i attached a usb ttl to uart 1 (hopin that at least something would come up on serial monitor.) nothing happened. serial1 did not print in uart1

:o
I assume that your board is like the one showed in photos.


Check that the MCU is an ST MCU since there are some blue pills that has a sort of "clone" mcu. But You wrote that st-link utility was able to recognize the MCU and this not happens with clones.

Stlink us used for debugging too but I never used it in this way.

Maybe you can use the last version. Remove the core from the IDE using the Board Manager, download the new version from here

just use the download button to get a zip.

In the sketch folder create a new folder named hardware and inside unzio the... zip so you will have
Hardware\Arduino_STM32-master and inside all the files.
Rename Arduino_STM32-master in Arduino_STM32
Launch the IDE.

I used the old version without any problem but you can try.

I don't have a system in front of me, but from your ST-Link log "Device flash Size: 32 Kbytes" doesn't seem right. The Bluepill STM32f103c8t6 is supposed to be a 64 kByte flash device.

What are the markings on the MCU chip?

Karma+ MrMark!
You're right! Flash is almost 64k.
So it is still an STM32 but a LowDensity MCU so the finals letters matter!

yes i will try that and tell you the results

i tried 2 other stms. same problem came up in every one.

then i bought another stm from another shop and used a fresh pc to upload the code.
this worked for now . i am able to upload the code from other pc to a newer stm board.

maybe the problem was in board itself.

maybe the problem was in my older pc.

this issue for now is still not resolved for me. but now lets close this move on .

manveen_singh:
this issue for now is still not resolved for me. but now lets close this move on .

I'm glad that you've got something working. However, the power of this sort of forum is that we can learn from the experience of others to the benefit of all. To that end, I'd suggest the following before "moving on".

  1. What are the chip markings on the board that fail to program with the ST-Link? The program output suggests that you have a STM32F103x6 device rather than the expected STM32F103C8 with 32k flash rather than 64. If this is the case and the vendor advertised it as a C8, they should be notified and allowed to make it right. If they don't it would be nice to know the vendor so others in the community can avoid them.

  2. Assuming the chip is marked as a C8 it would be informative to try programming the "bad" devices with the new PC setup and the "good" device with the old PC setup to isolate the issue to one or the other. It would surprise me if the PC were the issue given the symptoms you've described and I expect the problem will follow the boards. There have been reports of devices with C8 markings having 128k flash (i.e. twice the spec), but I'm not aware of any reported with less than spec.

ya i will try that

zoomx:
I used the old version without any problem but you can try.

I'm getting the same error and I think this ^^^^^ can be the solution. Anybody still keeping this version?

stm32flash Arduino_STM32_0.9

Unfortunately I updated it over the time and didn't keep the old versions.

In my case I had a Chinas Copy Chip CH32F103C8T6 from WCH mounted on my blue pill. Board ordered from AZ Delivery.

After replacing the WCH chip with an original STM32F103C8T6 Chip from ST the programming worked like a charm. Chip ordered from Farnell.

https://community.st.com/s/question/0D50X0000AwWy5ySQC/my-stm32f103c8t6-wont-enter-programming-mode

I think this will help