Compiling error

Im having trouble updating a 3d Printer's firmware.
Ive installed a new Hotend and have modified the firmware as instructions.
Ive connected a Arduino UNO board to a MacBook via usb.
connected the printer to the UNO board. The following is the error message:_

Arduino: 1.8.10 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

fork/exec /Users/paulharper/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++: bad CPU type in executable
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any help would be most appreciated.

You need to update to the latest version of Arduino AVR Boards:

  • Tools > Board > Boards Manager
  • Wait for the download to finish.
  • Click on "Arduino AVR Boards"
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.
  • Try compiling or uploading the firmware again.

Ive connected a Arduino UNO board to a MacBook

Error compiling for board Arduino/Genuino Mega or Mega 2560.

Which board type have you got selected in the IDE ?
I am betting that it is not a Uno

Not a Mac user so I don't know if the version that your using is Catalina or not, but I thought that this error is specific for Catalina (which only excepts 64-bit software).

Hi I have updated the AVR Boards now Thankyou pert.

Ive checked the port settings and its set to the UNO. Thanks UKheliBob

Still getting the error message:-
Arduino: 1.8.10 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/var/folders/cb/g6qvsgy91gq7rxzcqw52935c0000gn/T//ccarA3Ne.ltrans0.ltrans.o: In function main': /Users/paulharper/Library/Arduino15/packages/arduino/hardware/avr/1.8.2/cores/arduino/main.cpp:43: undefined reference to setup'
/Users/paulharper/Library/Arduino15/packages/arduino/hardware/avr/1.8.2/cores/arduino/main.cpp:46: undefined reference to `loop'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

sterretje:
I thought that this error is specific for Catalina (which only excepts 64-bit software).

Correct.

quad121:
Ive checked the port settings and its set to the UNO.

That's not what UKHeliBob meant. You currently have Tools > Board menu set to "Arduino/Genuino Mega or Mega 2560", but you say you have an Uno. If you really have an Uno, you need to set the Tools > Board menu to "Arduino/Genuino Uno".

quad121:
/Users/paulharper/Library/Arduino15/packages/arduino/hardware/avr/1.8.2/cores/arduino/main.cpp:43: undefined reference to setup' /Users/paulharper/Library/Arduino15/packages/arduino/hardware/avr/1.8.2/cores/arduino/main.cpp:46: undefined reference to loop'

Every Arduino sketch must contain a setup and a loop function. You're getting this error because the sketch you're trying to compile does not have these functions. I'm guessing that the author of the firmware didn't make this fundamental error, so I suspect that something has gone wrong on your end. We'd need to look at the firmware to see what is going wrong. You can zip it and attach it to a reply here by clicking the "Reply" button, then the "Attachments and other settings" link. Please also post a link to the instructions you're following.

Many thanks for you help.
Ive never used Arduino before, so I'm having trouble with it.

the website I've been modifying the file with is:

Please also find a zipped file of the Firmware I've modified from the above website

I know that the Firmware being modded is v2.0.x and the instructions are for the v1.9.x.

As far as I know the settings are much the same!

For the Creality CR-10s Pro v2

Marlin.zip (67.1 KB)

The problem is that your sketch is missing the src folder, which contains all the important code. I suspect that you didn't correctly download Marlin. You can get the full Marlin code by clicking the "Source code (zip)" link at the bottom of the release you want on the Releases page:

Thank you pert

I've checked the downloaded files and there is a folder called 'src'.

I click on the 'marlin.ino' file, which loads up Arduino with the same sections at the top 'marlin, config.h, etc. but no src?

Im sorry if this sounds stupid but how do I get 'src' into the sketch?

Subfolders of sketches aren't shown in the Arduino IDE, but the files in the src folder will be compiled. The Marlin developers specifically moved those files to src so that they wouldn't be exposed to the users via the Arduino IDE. The only files a standard user needs to modify are the ones that do show in the Arduino IDE.

So everything is working as it should be. Are you now able to upload the firmware to your board?

the files I sent you are all fine then?

do I copy and paste the 'src' file folder into the same folder as where I have saved the modified firmware ie the zipped folder I sent you?

quad121:
the files I sent you are all fine then?

I didn't look at them. I only noted the absence of the src folder. But I'm sure they are fine.

quad121:
do I copy and paste the 'src' file folder into the same folder as where I have saved the modified firmware ie the zipped folder I sent you?

That will probably be fine. I understand you probably want to avoid having to redo the configuration again.

Ok, I’ve now got the program to compile the firmware file, but now I’m getting an error connecting to the printer?:-/

I’m getting the following error:-

Did you forget to post the error?

sorry having trouble attaching file as it was too large

I have now attached it to previous post

just to check the printer is not powered on whilst trying to flash the firmware
the Arduino board is not powered just from the USB plug from the laptop.

Ive came across this website article showing a different way to connect between the two:-

https://uptanium.org/Burn-Bootloader-CR10.html

Ive used the ICSP connectors on both! as per attached pictures:-
with the reset connection from the Creality i connected it to the Arduino digital pin10

also what do you choose as the 'programmer' in the 'Tools' menu

icsp pin out.jpg

Please don't post pictures of text. That is very unhelpful. When you encounter an error you'll see a button on the right side of the orange bar in the Arduino IDE "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button. In a message here, click the code tags button (</> on the forum toolbar) and then paste the error.

If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

quad121:
sorry having trouble attaching file as it was too large

I have now attached it to previous post

just to check the printer is not powered on whilst trying to flash the firmware
the Arduino board is not powered just from the USB plug from the laptop.

Ive came across this website article showing a different way to connect between the two:-

https://uptanium.org/Burn-Bootloader-CR10.html

Ive used the ICSP connectors on both! as per attached pictures:-
with the reset connection from the Creality i connected it to the Arduino digital pin10

also what do you choose as the 'programmer' in the 'Tools' menu

Can anyone help in this matter please?

Can you help us help you, and post the error message(s)?

Sorry,
here is a copy of the error message:-

Arduino: 1.8.10 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 148044 bytes (58%) of program storage space. Maximum is 253952 bytes.
Global variables use 5158 bytes (62%) of dynamic memory, leaving 3034 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_getsync(): timeout communicating with programmer
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I have been looking more into the problem and found this article, it mentions about a bad flash which has brought me to this situation, or, well installing the firmware using the USB and the power being accidentally switched off.

the article is here:- https://www.th3dstudio.com/knowledgebase/1284p-printer-bootloader-flashing-video-guide-cr-10-ender-2-3-5-wanhao-i3-anet/

instead of using their firmware I tried using the modified version mentioned earlier in these posts.

as per the video from the link above.
I went into Examples- ArduinoISP
select: Board: Arduino UNO
select: port of the Arduino UNO is connected to
programmer: Arduino as ISP

Clicked on upload and it compiles the firmware file fine until it comes to the upload where I get an error message. see attached.

Error.zip (11.3 KB)