Trying to use Xloader with Mega2560 to un-brick DJI drone battery

Good morning everyone,

I am trying to help a friend who recently bought a second hand DJI Mavic Air. it came with 5 batteries and 2 of them are unresponsive. He found a tutorial from circuitschool to try and revive them with a nano.
Tutorial found here
I had some trouble because I have a nano 33 IoT and I understand it has a different chip. I've since connected the battery to my Mega2560 with the SDA and SCL connected to pins 20 and 21.

I found a different list of devices I can use with Xloader.
These are now my options:

CC01;m328p;stk500;57600;
CR03;m328p;stk500;57600;
Mega(ATMEGA1280);m1280;stk500;57600;
Duemilanove/Nano(ATmega328);m328p;stk500;57600;
Duemilanove/Nano(ATmega168);m168;stk500;19200;
Uno(ATmega328);m328p;stk500;115200;
Mega(ATMEGA2560);atmega2560;stk500v2;115200;

The good news is the upload into the mega is successful. The TX and RX respond and Xloader reports 4846 bytes uploaded.

According to the tutorial I should then open the serial monitor (at 115200) and I should receive a report, or confirmation something activated. Sadly the serial monitor stays empty. I've tried all different baud rates, leaving Xloader open or closed, tried finding out if I can add the Nano 33 IoT to the list of Devices I can select and searched other options to reset/reload the BMS BQ9003 chip of the battery.

By chance I had a 8 channel relay module connected to pins 39-51 (odd side only) and when I was using Xloader and opening the serial monitor I noticed the 2 relays on pins 47 and 49 went on.

Could these pins be generating output that should go to the SDA and SCL?

Arduino Mega schematic: https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf

The SDA and SCL pins are not available on the big header so I have serious doubts that they generate output intended for SDA and SCL. They I2C pins are also on different ports of the microcontroller (PD0 and PD1).

Does the same happen when you use the IDE to upload e.g. the blink example? Does the same happen when you upload the blink example using XLoader?

As your upload was successful, I've moved your topic to a more suitable location on the forum.

Dankuwel :slight_smile:

No it doesn't

Xloader can do that? As far as I can see Xloader only works with hex files, and I don't have a hex file for blink, nor do I see a way to export from IDE to hex. I'm new to this so I might just be overlooking the possibility.

Strange.

Yes, you are :wink: Or the actual menu item puts you on the wrong foot. This is for IDE 2.x; I think that IDE 1.x is the same

image

It will generate a folder in the sketch directory; you might have to save the blink sketch to a known location first.

Thanks!

Exporting to hex successful. The Blink.hex uploaded normally, no strange activity on the relay module, only the blinking LED. The Blink with booloader.hex upload failed, but it didn't trigger any relays either.

Is there a way to import the DJI-Battery-fix hex file into IDE and bypass using Xloader I didn't know about either? :grimacing:

No, you can't load the hex into the IDE. What you can do is below

  1. Enable show verbose output during upload; disable show verbose output during compilation. Both are under file → preferences.
  2. Upload blink the normal way.
  3. Observe the output. One of the first lines after the IDE has reported the memory usage is the command that the IDE issues; it will contain the word avrdude which is the upload tool for the AVR based boards like your Mega.
  4. Copy that complete command to the command line (dos prompt) and replace the filename (probably called blink.ino.hex) with the filename of the hex that you want to upload.

That actually worked, but the result was the same as with Xloader

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FF
avrdude: reading input file "C:\Users\Arne\Desktop\Mavicair_pfreset_circuitschools\Mavicair_pfreset_circuitschools.hex"
avrdude: writing flash (4846 bytes):

Writing | ################################################## | 100% 0.85s

avrdude: 4846 bytes of flash written

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D8, L:FF)

avrdude done.  Thank you.

Sadly it didn't change the outcome of the operation as a whole: When I open the serial monitor there is no reaction. No text to report a fail or succes, just nothing.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.