By nikolsidirop
#42176
Hello,

I want to tranfer data from a Bluno Nano to a Bluno MEGA.

I have updated the firmware to 1.97 in both through the BlunoFWDownloader.
SBL_BleMega2560V1.97.bin for the Mega and SBL_BlunoV1.97 for the nano.

I have followed following link
https://wiki.dfrobot.com/Bluno_SKU_DFR0 ... n.EF.BC.89

The Bluno Nano works fine, but in the Bluno Mega after configuration I cannot upload the code. The uploading bar goes to 100% and sticks there, after a long time (more than 5 min) I get following error:

//
Arduino: 1.8.12 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 2030 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 198 bytes (2%) of dynamic memory, leaving 7994 bytes for local variables. Maximum is 8192 bytes.
An error occurred while uploading the sketch
//

My code is
Code: Select all
//Bluno_Receiver_AT+SETTING=DEFCENTRAL

void setup() {
  Serial.begin(115200);
}

void loop() {
  
  while (Serial.available() > 0) {
    Serial.println("available");
    int inCommand = Serial.read();
    Serial.println(inCommand);
  }
}

I tried to do what is suggested in this link but the .zip file does not exist.
viewtopic.php?f=18&t=1733

Is there any solution? Why is this happening only to the one of the Blunos?
By nana.wang
#42184
Hi, thank you for your support and contact.
Please confirm the mega status. Connect no device in the mega and burn blink to check whether it is alright.
By nikolsidirop
#42195
If I upload the blink example (if you mean that), I get

Arduino: 1.8.12 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 1448 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
An error occurred while uploading the sketch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: verification error, first mismatch at byte 0x0400
0x5c != 0x58
avrdude: verification error; content mismatch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
By nana.wang
#42250
What's more, please confirm whether the motherboard is Bluno Mega1280 or 2560 according to product information or chip screen, and select the corresponding motherboard at the processor and try to upload the program, if it fails please check the last post.
By nikolsidirop
#42282
I used UNO as a burner and followed the link. However the error led blinked two times in the beginning for a short time while running the burn bootloader. And if I try to upload a sketch to the Bluno ATMega 2560 the same error occurs.

Arduino: 1.8.12 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 656 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.


avrdude: ser_drain(): read error: The handle is invalid.


avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
the selected serial port
does not exist or your board is not connected
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
By nana.wang
#42294
Hi, we got it.
The high probability of not being able to upload the program is due to the serial port being occupied by Bluetooth. When Bluno series uses Bluetooth transmission, it needs to occupy one pair of the serial port of the motherboard, 1 pair serial only nano occupies Serial. While MEGA has 4 pairs of serial ports, the default is also the use of Serial Bluetooth transmission. Serial happens to be the channel of the upper computer to the motherboard uploader, so when using Bluetooth uploader, there will be an error.

Then we can do steps as below:
1. Burn program and AT command configuration.
AT commands that may be used:
AT+SETTING=DEFAULT<CR+LF> Restoring the default settings
AT+ROLE=ROLE_CENTRAL<CR+LF> Set bluno nano as the host
AT+ROLE=ROLE_PERIPHERAL<CR+LF> Set bluno MEGA as the server
AT+CMODE=UNIQUE<CR+LF> Set bluno nano bluetooth connection address
AT+MAC=?<CR+LF> Get bluno MEGA MAC address
AT+BIND=。。。<CR+LF> bluno nano BLE chip MAC bounding address, the Bluetooth connection will connect this address.
AT+BLUNODEBUG=ON<CR+LF> print BLE chip serial port received data via USB serial port

2. Two motherboards power up, wait a few moments later, then we can see the two motherboard Link lights on, Bluetooth connection is successful.

3. View the serial monitor, and the serial monitor prints out the information.

4. For MEGA has multiple serial ports, you can use Serial to do Bluetooth communication, using other serial ports to do serial information printing, which is more convenient.
By nikolsidirop
#42345
I did the AT Commands as described and binded the MEGA MAC address in the nano bluno. I got an 'OK' as feedback in all the AT commands I inserted. The link LED in both blunos is on, but now I cannot upload nothing in both bluno nano and MEGA. The serial ports are proper selected.

Nano error:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe3
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Bluno Mega error:
An error occurred while uploading the sketch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
By nana.wang
#42372
Hi, thank you for your feedback, we have tested it again and below is the details.

Analysis of the problem:
1) After the two board Bluetooth connected successfully, the serial ports of the two boards are in the occupied state and we cannot burn the program directly.

2) Bluno nano has only one serial port (defined as Serial), the Bluetooth chip is directly connected to the main chip serial pin, so when using Bluetooth, because the serial port is occupied, the host can not communicate with the nano via usb.

3) Bluno MEGA has multiple serial ports (Serial, Serial1, Serial2, Serial3), the Bluetooth chip is connected to the master chip's Serial serial pin, and the serial port of communication with the host is also Serial. So when using Bluetooth, because Serial is occupied, the host can not communicate with bluno MEGA.

4) But if you want to burn remotely via Bluetooth, it is allowed. For example, the bluno nano as the host, the bluno MEGA as a server, the nano Bluetooth can burn program to the MEGA. The principle is that USB data is given to the nano's Bluetooth chip, which is sent to MEGA via Bluetooth, during which there will be no Bluetooth occupancy problem.

2. Bluetooth wireless burning operation method (nano as a host, MEGA as a server):
1) The first step is to properly configure two motherboards, in which the nano as the host needs to burn the program without serial ports, recommended to burn blink sample program to the nano, in order to prevent nano serial port interference with the transmission of Bluetooth data.
2) The Bluetooth connection between the two motherboards was successful.
3) Open the arduino IDE, edit the program to burn to MEGA, under the tools, board -> MEGA, port -> nano port, click to burn.
4) MEGA enter the burning state, then the burning completed after a while. Burning over Bluetooth will be a little slower.
By nikolsidirop
#42507
I did everything you suggested and managed to upload the script. Thank you very much!

The mistake was the power supply. I had to power the MEGA board through a usb port without serial connection, so not through a PC.

However, I noticed that it is possible to upload a sketch to the nano board, only if the MEGA is not powered (no connection).

In the interative project I build, the Nano will be placed in a moving part, thus it will be super inconvenient to programm everything through the Nano. I was wondering if it is possible to have it the other way around. To program the nano through the MEGA.