Atmel Studio - new project from Makefile error (shell related)

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby tfAteba » Wed Aug 30, 2017 10:05 pm

vctrvlad wrote:
I am willig to contribute as well if there is need for help,

Any help is well come.

I'm not realy used to ChibiStudio, but for what I have seen, it use the whole ChibiOS project. So you have all the architectures supported.
AVR, STM and so on.

You have demos for all supported boards under demos/AVR/

If you just want to have the AVR part, then you can delete manually the unwanted demos, port files or hal files.

I thinks you can start by using an arduino Uno for example to be use to ChibiOS (compile, program, test demos), then you can write your own program based on the existing examples. To finish you could use you own board and your own program, this will be the most difficult part because sometime you will need to add support for your board or for some driver.

I hope this will help, and welcome to ChibiOS :D
regards,

Theo.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby tfAteba » Wed Aug 30, 2017 10:28 pm

You can also ask for specific help about ChibiStudio in the Sub-Project meant for that purpose.
regards,

Theo.

MGeo
Posts: 21
Joined: Wed Jul 26, 2017 12:05 pm
Been thanked: 3 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby MGeo » Thu Aug 31, 2017 5:46 am

Hi Victor,

You can find a ChibiOS-RT Leonardo demo under chibios\demos\AVR\RT-ARDUINOLEONARDO. There are several -NIL and -RT AVR platform demos in that folder.

Also, see this post viewtopic.php?p=30094#p30094 I started with ChibiOS stable release, but found that at least some of the AVR code there has not been tested. For the case I was investigating (external interrupts) on AVR the working code was in SVN, not yet been merged into stable.

As discussed above, if you want to use this with Atmel Studio, you need to set up as a makefile build.

Good luck,
George

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby tfAteba » Thu Aug 31, 2017 7:53 am

Hi MGeo, Hi Victor,

Just to add a small precision:
MGeo wrote:
but found that at least some of the AVR code there has not been tested.

EXT was originally write by me for the ATMega2560, and improve by Marco for ATMega162 to add PCINT support. The code was then tested by me in Arduino mega and by Marco in his custom board. But MGeo effectively found that there was a regression bring by the PCINT support. So This part is under reimplementation at the moment.

As said MGeo, the more update code is in the SVN repo, the trunk branch, here is the link https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/
regards,

Theo.

vctrvlad
Posts: 21
Joined: Mon Aug 28, 2017 2:27 pm
Location: Timisoara, Romania
Has thanked: 1 time
Been thanked: 3 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby vctrvlad » Thu Aug 31, 2017 8:42 pm

Hi again,
I have erased my original chibistudio which I previously downloaded, and checked out with SVN client the following path:
http://svn.code.sf.net/p/chibios/svn/tags/ver17.6.0
because the link pointed by you:
https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/
returns an error when trying to repo browse it: "unexpected root element html"

I removed everything from "demos" folder, except for C:\ChibiStudio\demos\AVR\RT-ARDUINOMEGA.

The next step I am going to do is import the remaining stuff in AtmelStudio...

Please let me know if anything wrong with this meanwhile I will try to figure out the rest up to compilation process...

George, it would be very helpful if you would share a printscreen at least with your solution explorer tree, because in your posts I can only see the simulation windows...

Anyway, it would be helpful to have also some hint of how to build one of the existing demos, and Theo can help here, I guess...

Thanks a lot for all the time folks!

Nice evening,
Victor

P.S. I somehow feel a little dumb in here at this point, but I am really mentally paralyzed with getting this to compile on my machine.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby tfAteba » Thu Aug 31, 2017 11:36 pm

As I already told you I m using a Linux machine, so I don t know if I can really help with configuration of your IDE and even with the compilation.

I will try to find a Windows computer this week and help you as well. But if you find before, it will be cool :)

MGeo, you have the same configuration as Victor, OS, IDE, could you please make a quick tutorial to explain how you do to configure and build an application RT or NIL for Victor? It will be great. It will also help other people having the same problem.

Thank you in advance.

Victor let me know how you progress.
regards,

Theo.

MGeo
Posts: 21
Joined: Wed Jul 26, 2017 12:05 pm
Been thanked: 3 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby MGeo » Fri Sep 01, 2017 10:41 am

Quick Tutorial (from memory, not tested as a clean install):

1.) Install Atmel Studio 7 (AS7) from here: http://www.microchip.com/development-to ... l-studio-7 (I'm using build 1417 as of now, before Microchip-Atmel merge)

Next we need to be set up for a makefile build in Windows. This part is harder on Windows than on Linux. There are a few ways to set things up, this tutorial post gives the path I chose to take. Basically I installed Cygwin to get the basic build tools (like make and other Linux like binutils), and installed Atmel toolchain for Windows to get the AVR gcc compiler tools. Technically I could use the toolchain installed from AS7 but elected to install standalone version of AVR toolchain separate to mirror my Linux installs on other machined. Both Cygwin and Toolchain bin folders need to be added to your path so that they can be seen from makefile builds. Once you have this set up you should be able to build ChibiOS builds from a Windows command line, or from AS7 when the project is configured for an external makefile build.

So...

2.) Install Cygwin. I followed the instructions from here https://github.com/cleanflight/cleanfli ... Windows.md but only added git, make and binutils. I installed mine in C:\, and added "C:\cygwin64\bin" to my PATH so the binaries can be found from a makefile build.

3.) Install Atmel AVR 8-bit Toolchain 3.5.4 - Windows from here: http://www.atmel.com/tools/atmelavrtool ... ndows.aspx (I installed mine in C:\ root, and added "C:\avr8-gnu-toolchain\bin" to my PATH).

4.) Download appropriate SVN version of Chibios as ZIP (as there is no git mirror of latest dev version I am aware of) and unpack in folder of choice (mine is called chibios).

5.) Create a new project folder at same level as chibios (mine is named EXT_AS). I chose to copy the testhal files from chibios\testhal\AVR\EXT into EXT_AS as a starting point, remembering to edit the makefile CHIBIOS variable to point to the correct chibios relative install location (for me this was "CHIBIOS = ../chibios"). You can test that this is working with a make clean and make at the command line from this folder location and see a successful build. If you can not build from the command line then you will not be able to build as makefile build in AS7 either as AS7 basically shells out to use the external makefile build.

6.) Start up AS7 and create a new solution with a single C project. Use the Add Existing Item... to add the relevant files to you C Project. Set the project up as a makefile build under Project, Build by right clicking on the Project in Solution Explorer. You should also try to get familiar with the other makefile build option variables such as OPT, where you can turn off optimizations to better support single stepping in debug mode.

7.) Build, clean, rebuild and debug as needed within AS7 :).

I like to use both the AVR Simulator built into AS7 (http://www.atmel.com/webdoc/simulator/s ... ud_lc.html) for single stepping though code to understand it, and JTAG based hardware debugging to do the same on hardware. I use an old AVR Dragon https://www.digikey.com/products/en?mpa ... AGON&v=150 for hardware JTAG debug. I'm learning how to use AS7 STIM files (http://www.atmel.com/webdoc/simulator/s ... _file.html) when working on the simulator to be able to trigger external interrupt events in the simulator. A Saleae Logic logic analyzer https://www.saleae.com/ is also a super valuable tool for hardware/software debug of AVR and ARM based projects.

George
Attachments
CMD.png
Command line build results using "make clean" followed by"make"
snip.png
AS7 debug session with Solution Explorer shown
Last edited by MGeo on Fri Sep 01, 2017 11:36 am, edited 7 times in total.

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby tfAteba » Fri Sep 01, 2017 11:09 am

MGeo,

Thank you very much for this tutorial, I hope that Victor will be able to manage is difficulties with your help.
regards,

Theo.

MGeo
Posts: 21
Joined: Wed Jul 26, 2017 12:05 pm
Been thanked: 3 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby MGeo » Fri Sep 01, 2017 2:18 pm

On use of Simulator within AS7, I've spent a few hours trying to trigger external interrupts using stimulus files. So far no luck, the behaviors do not match my expectations and it is not easy to find info that can tell me why. It works for following program flow but interactions with external hardware are difficult to simulate. So for now I recommend using real hardware in combination with JTAG debug and logic probes. Too bad.

George

vctrvlad
Posts: 21
Joined: Mon Aug 28, 2017 2:27 pm
Location: Timisoara, Romania
Has thanked: 1 time
Been thanked: 3 times

Re: Atmel Studio - new project from Makefile error (shell related)

Postby vctrvlad » Wed Sep 06, 2017 6:27 am

Hello guys,

Sorry for the late reply, but I have been fairly busy by now.

I will try the steps described by George this evening when I will return from work.

Till then, thank you very much for the detailed guide!!!

Regards,
Victor


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 1 guest