Author Topic: Atmel Studio 7 - Create project from Arduino sketch  (Read 11782 times)

0 Members and 1 Guest are viewing this topic.

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Atmel Studio 7 - Create project from Arduino sketch
« on: June 21, 2016, 03:41:28 pm »
Hi all,
Now that Microchip owns Atmel, I thought it was a good idea to look at the development framework of these MCUs. The opportunity was given to me with the modification of the rework station 858D+ done by madworm and wguibas (Robert and Wayne) in this forum.
As the re-engineered firmware was done under an Arduino sketch, I first used this environment to compile and build the binary, then loaded in the MCU (Atmega328p) with a TL866A programmer: no problem, works as expected.
Then, I installed Atmel Studio 7 and tried to use the function "New project from Arduino sketch". This function creates a "solution" which contains two projects, one is the Arduino sketch, the other being the Arduino core, which contains all the libraries referenced by the sketch. This is the theory. Practically speaking, when I launch the project creation, AS7 hangs when creating the Arduino Core project and never ends. When I finally kill the process, the project directories are created, but most probably incorrectly, as if I try to build the executable, it stops immediatly with errors like "<Arduino.h> not found".
I googled this problem and found some people with the same problem, but up to now I didn't find any practical workaround.
The project is very simple, without external functions or specific I/O drivers: it only drives ports to manage the handle heater and fan, and a LED display.
Is it known that ATmel Studio isn't as mature as MPLAB(X)? I'm an old timer Microchip user and this first experience with ATmel is not so positive...
What do you think?
Denis
« Last Edit: June 22, 2016, 07:30:40 am by Gixy »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #1 on: June 21, 2016, 05:08:43 pm »
I don't use Arduino, so I can't give you any advice on the actual question, but I have a few comments on this:

Is it known that ATmel Studio isn't as mature as MPLAB(X)?
You are looking at some really marginal feature, which should not even be a part of AS in a first place (IMO, of course). AS is perfectly good IDE (if you like IDEs) when used for its intended purpose.

I'm an old timer Microchip user and this first experience with ATmel is not so positive...

Well, try to import Arduino sketch into MPLAB first :)
Alex
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #2 on: June 21, 2016, 07:35:56 pm »
You need Visual Micro, just follow the instructions on this link.
You do not need the paid for version which includes a debugger, the free part is enough for what you want to do.
http://www.visualmicro.com/

 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #3 on: June 21, 2016, 09:36:06 pm »
"Is it known that ATmel Studio isn't as mature as MPLAB(X)? "

AS is based on visual studio and that's a proven product. The issue you have is with the plug ins, not VS itself.

Mplabx is a microchip software product and that tells you all you need to know about its quality :)
================================
https://dannyelectronics.wordpress.com/
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #4 on: June 21, 2016, 11:08:01 pm »
Hi,
My goal is not to create an Arduino project under AS7, but a normal Atmel project. So, the Visual Micro Plugin is not useful for that.
There is a dedicated function "Create project from Arduino sketch", but this function doesn't work, and I'm not alone in this case. Even with the trivial "Blink" sketch the project generation doesn't work. This is why I'm wondering on the maturity of the product: what do you think of a product where what is announced as a new feature hasn't been tested at all?
I'll try to find some help directly from Atmel or Atmel forum.
Thx
Denis
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #5 on: June 21, 2016, 11:12:28 pm »
I don't know to what extent it was tested. I know that in general it works (or worked in some versions), so your specific problem may be related to your setup.

Import from Arduino sketch is a gimmick feature anyway. If you want Arduino - use Arduino IDE.
Alex
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #6 on: June 21, 2016, 11:19:05 pm »
Once more, my goal is to transform the Arduino sketch into a normal Atmel project. I installed last AS7 version as well as last Arduino IDEversion. Cannot do better.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #7 on: June 22, 2016, 05:28:46 am »
Quote
I installed Atmel Studio 7 and tried to use the function "New project from Arduino sketch".
You're probably suffering from differences in the directory format that Arduino has been introducing relatively recently.
Which version of Arduino did you install, and what exact sketch/etc are you trying to import?  (I can't find anything that is unambiguously " the rework station 858D+ done by madworm and wguibas")
 

Offline douardda

  • Regular Contributor
  • *
  • Posts: 82
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #8 on: June 22, 2016, 06:53:08 am »
Hi
 
I'm not sure it's relevant in this discussion but I recently discovered (and adopted so far) PlatfirmIO http://platformio.org/

It's not an IDE by itself but a cross platform build system for several embedded environments that integrates nicely with many code editors or IDE.

David

Envoyé de mon GT-N7105 en utilisant Tapatalk

 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #9 on: June 22, 2016, 07:24:24 am »
@westfw
Hi,
Arduino 1.6.9 (latest version).
This is the thread for the re-engineering of the 858D+ rework station: https://www.eevblog.com/forum/reviews/youyue-858d-some-reverse-engineering-custom-firmware/
But anyway, even the import of the basic "blink" project is hanging. This is the ArduinoCore creation which causes the problem, not the sketch itself. This problem seems to be known but I didn't find any working workaround.
Thx
Denis
« Last Edit: June 22, 2016, 07:33:39 am by Gixy »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #10 on: June 22, 2016, 08:50:37 am »
Running Arduino library/code inside AVRStudio is more of an experimental AS feature.
The number of people doing it will be extremely small.

I'm not surprised it gets broken by a new Arduino version.

Typically if your using AVRStudio you have graduated beyond using Arduino libraries.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #11 on: June 22, 2016, 10:23:00 am »
The only thing this feature does is copy over all core arduino source files and include everything in the solution/project.
You can do that by hand probably faster than wasting time with something that obviously doesn't work.

[2c]
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #12 on: June 22, 2016, 11:38:03 am »
@obiwanjacobi
I'll try that and see if it's so simple to do. I don't know how are arranged source files in the Arduino's directory. Thanks for this.
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #13 on: June 22, 2016, 12:45:05 pm »
You'll get compile errors if you forget files, then go search for the correct file that contains the symbols that could not be found.
Good luck! ;-)
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #14 on: June 22, 2016, 01:50:27 pm »
Yes, that was exactly what I hoped AS7 would do for me... :-[
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #15 on: June 22, 2016, 09:52:31 pm »
You will find that it requires a fairly good understanding of a modern mcu. Quite doable, but not easy.
================================
https://dannyelectronics.wordpress.com/
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #16 on: June 22, 2016, 09:59:09 pm »
Converting "blink" worked for me. Built successfully, too.  Eventually.  W10/32 Virtual Box VM, AS 7.0.943, Arduino 1.6.9
It was slow enough that I was wondering whether it had hung, but W10 is generally pretty slow in a VM...

(The AS project winds up with 294KB in 57 files, 22 (!) folders.)
« Last Edit: June 22, 2016, 10:01:46 pm by westfw »
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #17 on: June 23, 2016, 05:09:46 am »
(The AS project winds up with 294KB in 57 files, 22 (!) folders.)

You have to respect the original file structure in order not to screw up the #includes...
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch
« Reply #18 on: June 23, 2016, 11:27:21 am »
Indeed, it seems difficult to do this by hand. I'd rather continue to do it like westfw. Thx guys
 

Offline GixyTopic starter

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: Atmel Studio 7 - Create project from Arduino sketch >>>>SOLVED<<<<
« Reply #19 on: June 24, 2016, 10:23:04 pm »
Hi guys,
I contacted the Atmel support for this problem and received an answer in less than 2 hours (congrats!). Two files were joined with it: arduino.dll and arduino.pkgdef to put in the Atmel Studio installation directory. Once that done, everything works ! https://www.eevblog.com/forum/Smileys/default/icon_smile_thumbsup.gif
I've nevertheless been obliged to modiy the original source code of the Arduino for the EEPROM functions, for which the prototypes provided by Atmel are different from those of Arduino (functions names and arguments types). I finally compared the generated .hex files, they are totally different but of quite the same size.

I also installed the Visualmicro plugin and was then able to import and manage the project as an Arduino project under Atmel Studio. The generated .hex is almost the same than the original one, only 4 lines are slightly different. I don't intend to use this feature, but I wanted to try it. That way no need to modify sources.

Conclusion:
- there was a problem in the 'create project from Arduino sketch' function
- this problem is known by Atmel and the patch is already done. Probably will it be part of the next release
- Atmel support is very fast to answer

BR
Denis
« Last Edit: June 24, 2016, 10:29:22 pm by Gixy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf