MKR WiFi 1010 Arduino sketch doesn't compile in Atmel-Studio

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I recently bought an Arduino MKR WiFI 1010 and run it successfully in the Arduino environment. Now I created an  Atmel Studio (V7.02542) project from the Arduino sketch.

here I noticed that neither the core nor the project compile correctly. Main errors are:

 

strlen' was not declared in this scope    ArduinoCore    D:\Atmel Studio Projects\Sketch_Projects\MKR_WiFI_1010_Projects\SketchTest\SketchTest\ArduinoCore\include\core\api\Print.h

 

'memcpy' was not declared in this scope    ArduinoCore    D:\Atmel Studio Projects\Sketch_Projects\MKR_WiFI_1010_Projects\SketchTest\SketchTest\ArduinoCore\src\core\api\IPAddress.cpp    45

 

Standard and autogenerated compiler settings seem to be OK for the SAMD-device:

-mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=108013 -DARDUINO_SAMD_MKRWIFI1010 -DARDUINO_ARCH_SAMD -DUSB_VID=0x2341 -DUSB_PID=0x8054 -DUSB_PRODUCT="\"Arduino MKR WiFi 1010\"" -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSBCON  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.3.395\samd21a\include" -I"..\include\core" -I"..\include\core\api" -I"..\include\core\api\deprecated" -I"..\include\core\api\deprecated-avr-comp\avr" -I"..\include\core\USB" -I"..\include\variants" -I"..\include\core\samd21" -I"..\include\core\samd21\include" -I"..\include\core\samd21\include\component" -I"..\include\core\samd21\include\instance" -I"..\include\core\samd21\include\pio"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -g3 -w -mcpu=cortex-m0plus -c -std=gnu++11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"

 

I already tried to include standard C/C++ libraries as <stdlib.h>, <string.h> or <cstring.h> The all make the problem worse!

 

Thanks in advance for your help

JR

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Welcome to AVRFreaks!

 

jr1952 wrote:

run it successfully in the Arduino environment. Now I created an  Atmel Studio (V7.02542) project from the Arduino sketch.

here I noticed that neither the core nor the project compile correctly.

Tell us the steps you took to import your sketch, selected board, etc.

Show the text from the output tab, rather then the error tab.

Then post a zipped up copy of your project directory, so interested freaks can duplicate your setup.

 

Jim

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Tell us the steps you took to import your sketch, selected board, etc.

+1

 

If it helps, See Tip #1 in my signature for how to get & insert screenshots

 

ki0bk wrote:
Show the text from the output tab, rather then the error tab.

+1

 

To find the 'Output' window, see: https://www.avrfreaks.net/commen...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Thanks for your response. I still suspect that therer is something wrong with the automatic project generation for the MKR WifI 1010 board...

Here are the requested screen shots:

NewProjectCreateProjectFromArduinoSketchOutputAfterProjectCreationBuildErrors

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the zipped project:

Attachment(s): 

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would imagine that all those ERRORs about the ASF are the root of the problem - if the import process gives errors, it's not surprising that the resulting project won't build.

 

I still suspect that therer is something wrong with the automatic project generation for the MKR WifI 1010

That's entirely possible - I think it's really just intended for fairly basic "sketches"

 

Have you tried importing just a really simple "sketch" for this board; eg, a "blinky" ?

 

Or even just a simple "sketch" for something more "mainstream"?

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks awneil for your answer,

Tthe Atmel Studio user project I tried is the BereMinimum which is almost nothing but compiles successfully on Arduino UNO, but not on the MKR. I think that this project can't made easier...

JR

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry, you lost me there: so even a bare-minimum MKR "sketch" doesn't import properly?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...no, exactly. There is no additional code from me!

Anyway, before I tried it with a more meaningful code which had the same problems. So I stripped it to bare.minimum!

I still think the problem must be the autogenerated code setting for the MKR WiFI 1010 or the Mircochip Studio installation which I installed yesterday because I had the same problmes with (almost same) Atmel Studio V7.

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Faced with the same problem for 2 days now I have been trying to find a solution on the Internet.Forum people do you have any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AlfaLord wrote:
Forum people do you have any ideas?

in #6, I wrote:
I think it's really just intended for fairly basic "sketches"?

probably also focused on the more "mainstream" Arduinos?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Allthough I have some experience with Arduino/Atmel Studio using Arduino UNO sketches I deliberately tried the most simple example in order to be sure that the problem does not arise from my own code!

 

Here's some additional information on the bug. This shows up. when I reopen the project in Atmel/Microchip Studio ( Version 7.0.2542). It sounds like a Python compile error in the Atmel Studio IDE upon restart!ProjectRestartmessage

By the way: everything works fine in the Arduino-IDE

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After complete uninstall and re-installation of Microchip-Studio the problem is still the same...angry. So my question: Does anybody in the forum already use the Arduino MKR WiFi 1010 in Atmel/Microchip Studio 7?

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jr1952 wrote:
It sounds like a Python compile error

Do you have any other Python installations on the computer that might be confusing things?  esp. Python-3 vs Python-2 ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...no, there is no Python Installation!

 

After Microchip Studio Re-Installation I now created a new sketch project using the Arduino blink example.

This gives no Python errors but the same build-errors reported before:

 

D:\Atmel Studio Projects\Sketch_Projects\MKR_WiFI_1010_Projects\blink\blink\ArduinoCore\include\core\api\Print.h(52,52): error: 'strlen' was not declared in this scope

 

So I still think that there is something wrong with the include files...

AckerSchnacker

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like someone else having the same problem: https://community.atmel.com/forum/error-importing-arduino-project - also a MKR WiFi ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...