Baddy Embedded Code Arduino

Hi!

I require your help regarding a problem I’m encountering. I am a beginner at this sort of thing but I do understand what I am trying to do.

Description: uploading pre-designed code onto Arduino

Hardware concerned: not sure on this I’m guessing its the Nano Board I’ve been sent

Software concerned: Arduino, downloaded and verified the code, but upon upload I get an error

Troubleshooting steps already taken: contacted the main company baddy.space, spent months on messenger trying to come to a resolution, sent me two new boards and still having the same problem, been on all kinds of forums, downloaded the CH340 Driver, still didn’t work, tried on a Windows 7, Windows 10 and now Windows 10 Pro laptop still the same error?

Additional information: I have a pasted the error code below: PLEASE HELP ME!!!

Sketch uses 14496 bytes (47%) of program storage space. Maximum is 30720 bytes.
Global variables use 912 bytes (44%) of dynamic memory, leaving 1136 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch

Thank you so much in advance for your help!

1 Like

Hi Williams303,
That particular error can be caused by many things. As you may know, a google search for it turns up hundreds of hits with hundreds of “solutions.” Most of the time it turns out to be something simple, but getting there can be troublesome.
Just a couple of quick questions that may help us narrow down the cause.
First, have you tried uploading any OTHER code to the same board, or to any other board, using the same computer?
Second, have you tried uploading that code from a different computer (you mention trying Win7 and Win 10 but you don’t say if it is different computers.)

I have tried uploading a blank sketch has the same error code

I have been sent another board and PCB both of which provide the same error code

I have tried 3 different computers with 3 different operating systems, same error code

hope that helps

In addition to the photos I asked for in the shoutbox, could you also post any instructions that you have been given from the baddy robot people? Their “open” robot doesn’t seem so open, since I can’t find anything resembling instructions on their website or any documentation on what type of board or how to program it.
Anyway, if you have any instructions on a website, or especially any emails they have sent to you with instructions, could you post the relevant parts here?
Thanks

I was instructed initially that there was code already uploaded onto the board and to only download the BADDY App, connect using 1234 code and it should work, this did not transpire.

then told to log onto the forum to ask for help there, been there gone through all blogs and nothing has helped me, hence why im on here looking for any help at all

asked if I the charger was good - which it is
suspected this is no code issue, rather a wrong wiring, which it isn’t, or a messy motor speed config, which is not?

once turned on 3 beeps, one long beep, means motors saying they are ready

then he went onto say it must be a code problem as nothing else was the issue?

informed me I have the Arduino Nano board, and informed to upload new code

make sure you remove the jumper on the PCB during upload, which I do

ensure you select right port, which I have

informed some members do have driver issues, I have also downloaded CH340 Driver, still doesn’t work

sent me new PCB and NANO board, still same issues

One thing I wanted to see in the pictures was to verify what type of arduino board is being used. It is a Nano, as you said. I can’t tell for sure from the pictures but it looks like the Nano is easily unplugged from the other board. If so, I recommend trying to unplug it and program it standing alone.
A few other things to try. I have had problems using cheap or bad USB cables. Try a different cable. IF you have access to a Linux or Mac computer that has Arduino IDE installed, try programming anything into the Arduino from those.
Another thing to try is to reload the latest ARduino IDE software from the arduino.cc web site.

My experience with this type of synch problem is that it is most often a connection problem or a configuration problem on the PC being used.
It’s solvable. YOu will get it.

thanks

I have tried various USB cables, and yes I can unplug the Nano Board, I need to figure out which of the following I need to click on:
Board:
Processor:
Port:
Programmer:

Burnt Bootloader??? not sure what this is??

I’m doing some other stuff right now and can’t load the Arduino IDE, but I can give text descriptions for most of that.

The Board should be: Nano
The Processor should be: ATMega328 or 328p I believe that will automatically select when you choose Nano above
Port you will need to determine. It will probably be a two digit number (11, 12, etc) but you can find it by unplugging the arduino, looking at what ports show up, then plugging it in to see which one gets added.
Programmer. I think something that says “bootloader”

It is quite possible that the bootloader is corrupt or missing on your Nano. I will try to explain what that means.
The ARduino uses the AVR ATMega328 processor chip. That chip has program memory that must have a program loaded into it. The “normal” means of loading that requires a special piece of hardware that controls the chip and puts the program into memory. However, the processor can program its own memory, but it has to have a program already loaded to do that. That program is called a “bootloader.” The arduino comes with that “bootloader” program already in it. The bootloader reads data from the serial/usb port and programs it into the memory. It does not (normally) overwrite the bootlaoder, so the bootloader can be used again later. That allows the chip to be programmed over the USB /serial port without needing special hardware.
However, if somehow the bootloader program gets damaged or erased, it has to be put back in. There are, unfortumately, many ways that can happen. Power supply issues when programming are perhaps the most common. I’ve been playing this game for about 40 years and I still manage to corrupt/erase bootloaders from time to time.
If that is, in fact, what happened, all is not lost. There are ways to fix it, the easiest probably using another arduino as the “special hardware” mentioned above.

yes I sort of understand,

I will try and remove the board and upload the code whilst its not attached to the PCB. thanks for your help so far, im so glad you know what your doing, I am unsure if the bootloader has erased, as I have 3 different boards and it happens on all 3 of them, so it is highly unlikely that that is the case right??

" im so glad you know what your doing, "
We’ll see :slight_smile:

“it happens on all 3 of them, so it is highly unlikely that that is the case right??”
Actually, no. A power supply issue, such as turning on power, or something taking to much power and making the voltage drop, is quite repeatable in many cases. Installing three boards, doing the same procedure (which may even be correct!), will likely cause the same issue on all of them.

I have just done as you said and removed the Nano board and clicked upload, same error, so I tried this on the other two, one of the boards same details but the last board said done compiling???

ill show you the image now

Considering everything you have tried, I am starting to believe that your bootloaders are corrupted. I suspect that something about the board and system the Nano is used in is affecting that. In the future I recommend programming the Nano outside the rest of the system.

However, I think it would be a good idea to try a couple other things before pursuing the bootloader.
Try downloading and installing the latest ARduino IDE. It is probably a good idea, but not necessary, to completely remove the one you have now before doing that.
Second, do you have anyone nearby that has arduino boards and is maybe more experienced with them? They could try loading the software into one for you.

If neither of those helps or is workable we need to find a way to re install the bootloader for you.

1 Like

I was unable to reply to this originally, as it stopped me sending more than 18 messages since I am a new user. as you can see from above the uploading has completed, however when I turn the baddy on, it still doesn’t perform any actions.

I have to use actions via the Baddy App to tell it what to do, it connects using Bluetooth but doesn’t perform any actions when this happens???

I did as you said and removed the Nano board from the PCB to upload the code, which worked, however it only worked with one of the 3 boards I have been sent by the company, all of which were meant to have the original code on there but apparently not?

I am truly at a loss, I messaged the company and they said they do not know why this is not working, especially now seen as the code has been uploaded??

I wish there was someone round me who knew more and were more experienced with robotics and Arduino than me :frowning:

Well, I’m glad you got the code uploaded to one of the boards. Too bad the robot isin’t working. Unfortunately there isn’t much I can do to help from this point, since I know very little about the robot. But I will offer some thoughts and suggestions.

I don’t know anything about how it is supposed to operate, si I can’t offer any suggestions on that. But it might be a good idea to verify that what you think it is supposed to be doing (performing actions on powerup?) is actually what it is supposed to be doing. Since the code transferred to the Arduino and verified, it “should” be doing what it is supposed to be doing.

Without knowing any more than what I do, I suspect you have a power supply problem. That would cause most if not all of the problems you are experiencing. While inserted in the main PCB, the arduino probably gets its power from the robot. When removed and programmed external, it will get its power from the USB port. A low voltage (from the robot) will cause it not to program correctly and can often wipe out the bootloader. It can also cause erratic or improper behavior when the robot is in operation. It’s quite possible that a power supply problem is causing it not to act properly now that you have the ARduino programmed. But it’s hard to say more than “it’s possible” without knowing more about the robot and your particular setup.
Without knowing more I can’t offer much more than that. Feel free to post relevant details if you like so I and others can take a look. Specific things to post would be schematics or at least block diagrams of the robot, the type of motors, etc it is using (and how much power they take,) and especially what type of battery/power supply you are using and schematic or block diagrams of that. Good pictures of the power wiring would be useful, too.

so the code uploaded but it still doesn’t work, I tried to upload the code when the board was plugged back into the PCB and same issue??? which leads me to think that something is wrong with the PCB and not the board? do I not have all the correct software installed in order to have a successful upload into the hardware?

after the code uploaded I plugged the board back onto the PCB, and connected to Bluetooth which is did no problem, but the device is not talking to my mobile and it isn’t conducting any tasks??? this is so frustrating, I fear I need to try the bootloader thing?

I have contacted the company and they said that they will be shipping me out a new complete electronic system, which is great however I fear that I am just going to end up with the same issues? I have asked them to upload the code before sending it so that I don’t have any further issues and can just plug and play from my phone.

any help would be greatly appreciated in the interim as I don’t think they will be sending one out anytime soon?

thanks emma

Hi,
I think you are probably right that there is something else wrong with the hardware. Since the code won’t upload to the nano when it is plugged into the main board and since after the code is uploaded separately the system doesn’t work that is a good indication something else is wrong.
When you upload the code separately and it goes without problems it is almost certain (99.99%?) that the upload is complete and correct. That also is a very strong indication that the bootloader is intact and does NOT need to be reloaded.
Here is a list off the top of my head of things that could be wrong at this point:

  1. The code is not uploading properly. As mentioned above this is a VERY slim possibility.
  2. The code simply doesn’t work. If the EXACT code you are using is being used by others on the EXACT same hardware, this is also a slim possibility.
  3. Something is wrong with some of the hardware. This could be on the nano (not very likely) or the main PCB (more likely.) Since uploading to the nano when it is placed on the main PCB fails and also appears to wipe out the bootloader I suspect this is the problem. Also, since uploading the code separately and it still doesn’t work, that also gives weight to this possibility. As a first guess I suspect some kind of power problem.
  4. The other software used to control the bot is bad or not being used properly. I can’t really add much comment to that.

Do you have, or can you get, a schematic diagram of the other electronics on the bot? Perhaps if you can post the schematics we could look over them and give some troubleshooting tips. Without that about all I can recommend is checking the power supply voltages while attempting to use the bot.
Sorry I can’t offer more than that.

I have tried the bot both plugged into the mains and also on a fully charged battery, both do not work?

I don’t not have any schematics, I barely had the code easily available to me :frowning:

ill just wait out then for the company to send me a new one hey

That sounds like your best course of action at this point.
I’m not impressed with that company or their idea of “open source.”
The power problems I’m referring to could be caused by bad or inadquate battery (which seems to not be the case since you tried mains power) or defective or poorly designed circuitry on the bot. Wherever the power comes from it has to be properly conditioned for all the electronics. Power is like the foundation of a house: if it’s not right, nothing else will be.