Issues Flashing STM32F401CC with CubeProgrammer DFU - arduino

I'm trying to do a DFU program upload via Arduino for an STM32F401CC. I'm using CubeProgrammer to upload the compiled bin and verify the contents of the STM32's flash is being written starting at 0x8 -- it's all there. I'm using a jumper to pull B0 high and am verifying it shows as STM32 BOOTLOADER in the device manager, then I'm disconnecting it. Everything shows that the program is upload correctly, but my program isn't actually running (make onboard PC13 LED blink). I'm using a board I got off amazon but verified the STM32F401CC is genuine. Is there something I'm missing? I'm coming over to ARM after years of using the ESP32.

I had couple bought and both the same problem,as yours, supposingly they were fake ones and wrong batch,so port in arduino ide wasnt recognized and the same issue as above in stmcubeprogrammer. It was stm32401ccu6 gh27a batch 103, only way was flash with full erase (manually didnt work only automatically in stm32cubeprogrammer ) possible but after each download code to mcu in arduino IDE i couldnt download any more sketches on it and had to upload new firmware / bootloader again and it didnt finish i had to press stop button in stmcube programmer during burning bootloader so trash, cheap peace of all kind of problems, i had to read the chineese documentation From WeAct on git because those with HID bootloader was just crap bad english , so more timre carefully didnt make even sense, so finally figure out how to flash finally bougt same chip 411 and it worked but Arduino ide sketch led didnt Blink another piece of cheap clone, 411ceu6 batch 106, at least could upload firmware sucesfully in stm32programmer but Arduino sketches didnt work , i had one 411 already from different manufacturere and didnt have these issues, and next time i will give it last try with WeAct orig chineese manufacturer which makes suposedly only original nonfake Stm32f411ce ver 3.0 product on aliexpress and they sell since 2022 411ceu6 batch 014 allegedly its only one which should not give all kinds of issues As they state on their git. Had anyone same problem solved to finally blinking led in arduino ide? It even didnt switch the build in on PC13 but i could measure 3,1V on that pin to ground, and everytime i burn the orig Or hid bootloader The led fades in and out, its a mystery to me really whats going wrong, someone on forums wrote issues with timer, it has to be sth with arduino ide 1.8.19 or stmduino , then noticed in board manager i have../raw/master/package_stmicroelectronics_index.json in preferences arduino ide and stated there as depreciated so i there was srated i shall be using raw/main/package_stmicroelectronics_index.json Oh my thing So i changed the word master into main and typed in Board manager STM32 MCU based boards and installed actual version 2.2.So instead of chaos just be patient and check literally everything, arduno could pop up message that mcu package depreciated but didnt ;) oh my...suddenly surprice, i need check yet if all worked and i just underwent wrong rumors, so no, it has 1,20V on PC13 diode doesnt blink with blink sketch only after bootloader upload fading, i hate such a job and bought 3 and all of them the same. Doesnt work eiter Led_buildin nor pc13, It was swg method, if i set led high and upload via serial i measure 1,9v and if I set led low i measure 1,3 v with Vin 5V and voltage drop ,5v results in 4,45v complete rambazamba , so i start tombelieve these boards are fake anyone similar or same experience?

Related

esp8266 on wifi serial board and Arduino Uno board

I bought esp8266 with serial wifi wifi card
I connect RX to TX; TX to RX; VCC to VCC; GRD to GRD;
I cant communicate with the board not if program mode and not in UART mode; the reset do nothing.
the red led on the board is on.
I connected the wifi serial to Arduino uno board.
try to upload sketch i got the following error:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Any help or guides will help me to solve the issue.
Since I have had numorous of problems with my ESP8266 modules, this is what I generally watch for:
Output is 3.3v
Swap over tx and rx. Some boards have them swapped for some reason (searched for days for this!!)
When uploading the code, first the code compiles, then the code uploads. During the compile process, keep the reset button (or pin) pressed. As soon as you see the "uploading" status message, you can release it.
Make sure the GPIO0 is connected to the ground and (depending on which version you have) the GPIO15 as well.
When grounding the GPIO0 and GPIO15, use a resistor for each (between 2K and 10K will do).
I've spent two nights trying to upload firmware so I'll just repeat what helped me since there's not so many solutions:
First in Serial Monitor make sure that your chip responses to AT commands. There's no point in going further without achieving it. If you fail here then it's time to check your commutation, power source, etc.
While uploading: 1. Ground GPIO-0 pin. 2. In Arduino IDE press Upload button. 3. Code starts compiling. 4. As soon as you see that code starts uploading ground RST pin for just a blink. Before I reseted the chip too early so I had sync failed problem as you did. It took me a while to "catch" this moment for resetting the chip. Still I upload new firmware in 4-5 takes.
Before flashing firmware, please hold FLASH button, and press RST button once. When our firmware download tool released, it will flash firmware automatically and needn't press any button
I have this really weird issue where grounding GPIO 0 didn't work for me, but after a lot of trial and error I managed to upload the sketch connecting directly both gpios to ground in the arduino board and it worked. Really strange.
I had the same issue. In my case, I was uploading while in another terminal program I was checking for serial data. After I closed the serial monitor (and let Arduino IDE use the serial port) the problem was resolved partially.
The other half of the problem involves carefully pressing the button GPIO0 and then RESET.
This helped me achieving that.
I had the same issue, but after I set the Programmer to "AVR ISP" in the Arduino IDE/Tools, after that the upload was successful and it worked fine.
Hope it helps.
First you have to make sure that the Arduino IDE has the ESP8266 libraries installed. To do that, go to file>preferences and under Additional Boards Manager URLS, paste this link:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then, go to tools>board>boards manager. Scroll until you find the link for ESP, than download it.
Once you select all the info for the board change the programmer to "AVR ISP"
Finally, to download the code, hold down the GPIO0 button and press the reset button once. Finally, hit download!
To use serial monitor, you may need to use the 115200 speed as it is not the default.
Hope this helps!
Please downlode and install these driver as per OS i spent 6 hours today and finally this was the solution.
https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
Look follow the leads and you will get the proper output as 'OK' in reply to AT command, just search for Arduino15 file in C directory of your computer, it will be in somewhere at C/users/app data and delete it, then set the Arduino to arduino uno board or whatever board you are using and connect the Esp8266 as, UNO --- ESP8266
RX ----- RX
TX ----- TX
GND --- GND
3.3V --- VCC and CH_PD
Once Connected open the Serial Monitor and set "Both NL & CR" and Baud to 9600.
Send "AT" to test. If nothing comes up try different baud rates such as 115200 or 57600 and retest.
If you get "OK" reply then all is working.
I just bought the Wemos D1 and had the same problem: I could not upload my sketches. There were several reasons for this:
1) I did not have the CH340G drivers loaded on my Mac. Both Win and Mac platforms need these drivers. Linux does not. I found my drivers at http://sparks.gogo.co.nz/ch340.html
2) You need to add the board to your Arduino IDE. You can find the steps to do that at http://www.beerandchips.net/2016/01/24/wemos-d1-hands-on-with-the-new-arduino-compatible-esp8266-dev-board/
Once I completed those 2 steps (be sure to select the serial port) everything worked great and I can upload my sketches with no difficulty.
I had (too many/wrong) COM port(s). Find the right one and I't fine.
This worked for me this time in the following way to successfully upload sketch from IDE to esp8266 via arduino:
1) IDE Tools menu: upload speed 115200
2) opt this one in tools menu: Programmer- AVR ISP
3) Keep serial monitor closed. If com port not visible under Tools, disconnect and reconnect USB from laptop
4)Reset Arduino
5)Connect GPIO0 of 8266 to VCC(3.3V) for a blink and remove
6) Connect reset of 8266 to gnd for a blink and remove
7)GPIO0 grounded..keep this one gnded for the upload period
Hope this one works..

Uploading program to teensy not working

i got a brand new Teensy 3.2 with the blinking LED programm on it.
When I now tried to upload another programm on the teensy, Arduino says:
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
The automatically starting window of Teensy, doesn't give me a chance to (for example) reboot the Teensy as well, so something of the connection seems to be wrong or something, but what...
Even if I mannualy press the pushbutton, it's still not possible to upload something. Any ideas why?
I have encountered this problem twice. The first I tossed out the board. This time, when I power it, it runs the last program I burned on it, but when I try to program it again, the LED stops blinking and everything stops.
The claim that it might not be a data cable is not reasonable, because how can it stop the current program unless it was told to. I doubt very much that +5V can provide such commands.
I have tried different cables, different USB ports, rebooting my Linux box, reinstalling (twice), checking the pins on the Teensy and the cable... no clue.
It always boots up in the old app (I left the blinker running to indicate "liveness"). I had programmed a message to come out the hardware serial port. Could that have been the problem? Wait... Is there a way to set the baud rate on the USB? I wonder if that is the problem! --
Banner(void) {
Serial.begin(9600);
Serial1.begin(115200);
};
The example had me programming the USB serial! I bet that is the problem! Better yet, does anyone know what the protocol is for talking to USB serial commander?
Under Ubuntu 18.04 install this https://www.pjrc.com/teensy/49-teensy.rules file into /etc/udev/rules.d

Arduino Standalone

I have an Arduino Uno and I am using arduino 1.0.5 IDE. I followed he procedures for bootloading an atmega328P-PU on a breadboard.
I uploaded the ArduinoISP sketch first, made the connections(using the External Oscillator) and then wired it up. Then, I selected the programmer as Arduino as ISP, selected the board as Arduino duemilanove w/ Atmega328P. Then I selected the correct serial port and clicked Burn Bootloader.
I got the following errors:
avrdude.exe: stk500_program_enable(): protocol error, expect=0x14,
resp=0x50avrdude.exe: initialization failed, rc=-1 Double
check connections and try again, or use -F to override
this check.avrdude.exe: stk500_disable(): protocol error, expect=0x14,
resp=0x51
How to solve this issue? Also, can I upload the bootloader directly by using it on the Uno in place of the original chip. If so, how?
to my understanding the error you have indicates a bad reading from the chip. I experienced that with chips that were either dead or not properly connected, especially to power supply.
You may find more detailed information in th tutorial : https://www.arduino.cc/en/Tutorial/ArduinoISP
Especially those things :
Note for Arduino 1.0: you need to make one small change to the
ArduinoISP code. Find the line in the heartbeat() function that says
"delay(40);" and change it to "delay(20);".
Select the items in the
Tools > Board and Serial Port menus that correspond to the board you
are using as the programmer (not the board being programmed).
Instead of arduino built-in boot loader just go through below link and it will be great for uploading boot loader and verifying board status info
I am replying you this because same issue I got long back and it saved me.
One more thing for arduino boot loader: for atmega328 you need to put capacitor between reset and gnd( in case you missed)
For gammon bootloader you don't need it.
Be Innovative.
For reset line you might me using 100nf(thats what stated in documentation )...but sometimes it doesn't work...try something like 4.7uf, 22uf or 47uf or close values
I had a similar problem and the issue was that my programmer was a bit slow, I used the -B flag for avrdude to slow down the bitrate and it started working, I set the -B20 and works like a charm every time, but I use the USBTinyISP programmer, not the stk500 one, so this might not work for you.
In case someone stuck at this as I did and nothing like changing the cap value helped. Make sure you are using your USB-TTL adapter in a 5v mode (obviously for a 5v powered chip). I always used it in a 3.3v mode in order not to accidentally burn my 3.3v chips and it always worked. Until today, I was trying to flash my custom atmega8 board and everything worked with the ISP but I was having a hard time using the bootloader and after half a day searching and trying different stuff the 5v setting to the rescue.

avrdude : stk500_getsync not in sync:resp=0x87

I am using arduino uno r3 board and arduino 1.6.5 on windows 8. When Itried to upload my program on ATMEGA328 microcontroller it is showing:
avrdude:stk500_getsync not in sync:resp=0x87.
help me to solve this error
This boils down to 3 problems usually..
The bootload on the chip is missing (unlikely if you purchased the board from Arduino).
The serial connection between the arduino and the computer is disconnected or interrupted.
You've simply selected the wrong board type or port when programming, and thus the IDE is searching for a signal that the arduino isn't coming back with.
This problem is most likely due to option 3, however it can occur in odd situations especially on the Arduino Micro where the board does all USB comms on chip and can be flooded by main without an appropriate delay to the point it can't communicate with the IDE. However this is just most likely a bad board selection or a bad port selection.
I've tried many things but this worked for me. If you have a working Arduino lying around (in my case Uno) you can use it as an intermediate in-system programmer (ISP).
Follow this guide to first load the ISP sketch into your working Arduino.
Once you are done, for your non-working Arduino, select from the Tools > Programmer menu and choose Arduino as ISP, and set Board and Processor accordingly. To program choose Sketch > Upload using programmer.
Hope this works.
I think the reason that this work is that it will bypass the CH340/FTDI chip, and all those synchronization issue. Given that that is your problem.

Arduino "avrdude" Error

I have been working with the Arduino system with an Arduino Uno chip for a while, but I recently came upon a problem I cannot solve. The problem is that whenever I attempt to upload a new program to my chip, I get the following error:
avrdude: stk500_getsync(): not in sync: resp=0x00
I have done some research, and I have tried everything that people have suggested. I have checked the COM port, checked the chip type, checked the component installations, updated the FTDI drivers, hit the reset button, tried the latest Arduino software, and yes, I have even made sure the board is plugged into the computer.
Earlier this year I had absolutely no problem uploading code to my board, and almost nothing has changed since I last tried it. The only thing that has changed is the cable I have used to upload the programs, and I have tried several different cables as well. Could it just be a batch of bad cables? This seems unlikely. I have also tried uploading code onto different boards, with the same result.
This is getting quite frustrating, as I really want to continue working on my projects. However, that will not happen if I cannot even print "Hello World!" to the serial monitor.
I am running on a 32-bit Windows 7 machine. Any suggestions to solving this would be greatly appreciated.
If you are expecting a normal upload using Serial then you should ensure your preferences are not set to "Upload using programmer" and that you are not selecting "Upload using programmer" from any of the Arduino menus.
EDIT
If you have not overridden the programmer then you must have the wrong board selected on the tools menu boards list. lpt1 in the error message is not what the Uno uses.
It turns out that the problem was the FTDI cable I was using. I tried a bunch of different cables until I found one that works, and now uploading occurs without any problems.
check the board you have selected in tools-> board . If you selected wrong board error comes as above. If right board being selected still getting same error , then it is definitely boot loader crashed error. You need to upload boot loader.
Sometimes parts connected to digital pin 0 and 1. The parts interfere communication between the computer and arduino so I recommend this procedure.
Check something is connected to D0 and D1.
If something is connected, unplug those.
Upload the sketch.
Plug parts removed at step 2.
your arduino maybe not uno, change board to duemilanove.

Resources