Problem while uploading code in arduino atmega2560 - c

I have arduino atmega2560 when i upload blink code than it shows error
avrdude: stk500v2_ReceiveMessage(): timeout.
I have checked the COM port is correct also that the driver is correctly installed.
Why would I be receiving a timeout error?

The possible reasons:
Faulty communication cable
Wrong com port selected
Wrong device model selected
Baud rate settings
Driver related issues

I think your arduino got bricked. But first try to reconnect it and upload your program.
Second try to disconnect any rx or tx pin connected. Third if your arduino is bricked, try to check this article for full solution of bricked arduino. Programmer is not responding arduino

Related

Sending AT commands over UART

My problem is sending AT commands over UART. I am working with STM32 IDE. I have the hardware: STM32L476 with a sensor shield together with the ESP01 Wifi module.
I got the hardware to work and can already send the first AT command over Uart to ESP01. When I try other commands AT+RST or AT+GMR I don't get any response back.
I use this code to send over UART to ESP01.
void ATsend (char out[]){
HAL_UART_Transmit(&huart4, (uint8_t *)out, strlen(out), 1000);
}
The code below works fine
ATsend("AT");
I get the response OK.
When I try this I get no response.
ATsend("AT+RST")
Any tips?
If you are sure that your UART receiver, or your DCE in RS-232 notation, supports the commands you're sending, this guide might be helpful:
https://docs.espressif.com/projects/esp-at/en/latest/esp32/faq.html#when-the-host-mcu-sends-an-at-command-to-the-esp32-device-there-is-no-response-what-is-the-reason.
The guide indicates as a possible solution also for the ESP8266 products the following: <<When the host MCU sends an AT command to the ESP32 device, there is no response. What is the reason?
A terminator (“ATrn”) must be added after an AT command when the host MCU sending AT commands to an ESP32 device. Please see Check Whether AT Works.>>
There's also this link: https://docs.espressif.com/projects/esp-at/en/latest/esp32/Get_Started/Downloading_guide.html#check-whether-at-works.
I hope these suggestions can solve your problem. At least they can indicate to you if the device is working.
There might be other causes of malfunction, but in this case I need more information to help you solve them and I suggest that you write to my company for professional support.
Yours sincerely,
V.D.

STM32F407 Disc E31 Error message in debugging

I will ask a question about my STM32F407 Discovery board. I want to learn about external interrupts and I was making a small circuit. I connected PH0 to my button and PH1 to the LED. But these pins are connected to the mcu's crystal pins. But I didn't know it at that time. I was press button that is connectet to 5V. And my IDE won't connect to my board for debugging debugging. I can connecting to my board via ST Link Utility and I can do a full chip erase with no errors. Then I turn back to code in Atollic, press the debugging button and I get this error messages:
Error in executing 'cont' command ...
CM4 Failed to read all registers
FAILED to REGISTER Values from the target
Target is not responding, retrying...
*some messages in between*
warning: Remote failure reply: E31
Remote failure reply: E31
Remote connection closed
Quit
And then I turned off the debug screen to try again but I can't because Atollic can't find any ST Link devices. This is the error message:
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
Note: My PC recognize my board in Device Manager.
How can I solve this problem. ST Link Utility connects to my board succesfully, My PC connects to my board. I tried St link firmware upgrade but I got more errors. Like this.
Failure at line: 13 in "Target Software Startup Scripts"
You probably have ST Utility still connected to your MCU. This results in Atollic not beeing able to connet to the MCU. Either close ST Utillity or press the disconnet button.
Since you can erase it your MCU should be ok and you chose one of the few 5V tolerant pins but it would be better practice to use 3V.
Another reason might be the option bytes if the read out protection got set to level 1 or 2 the debugger is sometimes not able to reset those and is therefore not able to read out the register.
I was solve a lot of problem. Firstly I found a problem. This is a my DCMI_Config function. In this function I have a lot of pin definition. GPIOA caused my problem.
GPIOA-> MODER = 0x00002200; //GPIOA 4,6 Set Alternate Function for DCMI
This line has my problem. I was search Discovery schematic and I found something. PA4 pin connected to Discovery's voice uc as I2S3_WS. Is this cause any problem?

STM32 USB CDC did not work

I'm using stm32l151 and I want to use usb peripheral in cdc mode. I used stm32 cubeMx to generate the project. however the function CDC_Transmit_FS() always return USBD_BUSY. can anyone help me?
Here is my code:
while (1)
{
CDC_Transmit_FS(Buffer, 6);
HAL_Delay(2000);
}
I only added the above code to the project created by STM32cubeMX but it didn't work.
STM library is buggy and it stalls when you for example try to send many larger packets of data.
There is a problem with the windows drivers and there are quite long delays between packets. So 12MB is quite difficult to archive - using CubeMx I could only have about 3-4Mb (12MB when packet is sent).
Another problem I had - I needed to send some data to the device bofore I could transmit next packet (max 8kB in my case), otherwise it stalled randomly.
Fortunately, the problem is solved and I can receive data in the PC from the STM32. There was a problem in my terminal software. I used serial port manitor to monitor the received data from the serial port, however this serial monitor software do not open the serial port by itself and if any other software opens the serial port and receives the data, it monitors data receptions. I didn't know that.
Thanks

Arduino uno not uploading

Uploading sketches to my arduino uno worked fine. Now uploading won't work. I get the following error. Is there a way to reset my board? Using the built-in reset button does not help. Error:
Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno" Binary sketch size: 7,878 bytes (of a 32,256 byte maximum) avrdude: stk500_recv(): programmer is not responding
Please give any information on how to fix or reset the board.
there are many reason and you need to try 2 or 3 different operations in order to understand why avrdude is not responding
First, check serial port on Arduino IDE, then check what kind of board you have selected in IDE.
Have you left some connected on pin 0 or 1 of your board? They are serial TX and RX used by FTDI to write the sketch on your Atmega, I don't know why but sometimes if you left something connected there, you could have some problems during upload.
Hope this will help you!

Arduino Mini and WiFi shield -> not present (status 255)

I have an issue with the WiFi shield. As you can see in the picture below, I am experimenting with the Arduino Mini and the WiFi shield.
I have read the tutorial-guide and connected all the necessary pins between the Mini and the shield. I use the example code which is provided in the tutorial, e.g. reading the WiFi shield's MAC-address or scanning for networks near me.
But anything I get is the error message, that the shield is not connected. But there is a connection between the two Pin 7's (the handshake pins) and even to any other required pin.
I even support my circuit with an additional power supply of 5V (the voltage regulator in the picture), so what's wrong with it? Or might it be that the WiFi shield itself is damaged or has a malfunction? How to verify this?
One last question is: Do they deliver the shield with an installed firmware or does the user have to install it?
The code I use is for example:
uint8_t wl_status = 0;
void setup()
{ // code to run once
// Open serial communications
Serial.begin(115200);
Serial.println("*** Arduino board online ***");
// check for the presence of the shield:
wl_status = WiFi.status();
if (wl_status == WL_NO_SHIELD)
{
Serial.println("-E- WiFi shield not present");
// don't continue:
//while(true);
}
else
{ // Initialize Wifi
Serial.println("-I- Initializing Wifi..");
printAddress(1);
// Scan for existing networks:
Serial.println("-I- Scanning available networks..");
listNetworks();
}
Serial.print("-D- Wifistatus : ");
Serial.print(wl_status, DEC);
Serial.println("");
}
The printAddress()-function simply prints out the MAC-address of the shield.
Have you tried removing the jumper? It puts the shield in programming mode. Picture here
I proved whether a different power source will work or not; the problem still remained.
Arduino support suggested that we should use the SPI connection of the board instead of wiring. It was worth a try, so I combined the WiFi-shield with an Arduino Uno and could finally start practising. Forget the Arduino Mini and use Uno or Mega instead.
According to the startup trouble, the current firmware version still has bugs, e.g. connection dies after a few seconds both on server side and client side. I recommend checking the Git repository frequently for updates. Issue #9 (Connection dies after a few seconds) has been solved on server side only, however the problem still exists on client side. I will wait for the next version of the firmware.

Resources