Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Searching all #include files (Read 9664 times)
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Searching all #include files
May 26th, 2014 at 11:21am
Print Post  
Is it possible to search all the #include files in a project from VM without actually opening them?
I am specifially trying to find "LFUSE" as the fuse does not get set properly in my ATtiny 84 8MHz.
I am using:
https://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0150-0...
  
Back to top
 
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: Searching all #include files
Reply #1 - May 26th, 2014 at 1:19pm
Print Post  
Hi Trek19,

the fuse settings are not in include files, but in the board definition file. I had a look at the link provided.

NOTE: your link was separated on two lines, so the 020.zip is missing when one click on the link.

Go to Tiny\AVR in the zip file, you will find Prospective Boards.txt. Here is part of the file:

Code
Select All
# Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]
# Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

attiny84at16.bootloader.low_fuses=0xFF
attiny84at16.bootloader.high_fuses=0xD4
attiny84at16.bootloader.extended_fuses=0xFF 


The last three lines are for the three fuses, the 1st one being LFUSE. At this location http://www.engbedded.com/fusecalc you will find a fuse calculator, quite useful  Smiley.
  
Back to top
 
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Searching all #include files
Reply #2 - May 28th, 2014 at 10:06am
Print Post  
OK Gilles thanks, you must have gone to some effort to see inside those files. I am still trying to understand how the fuses are set. 
I had seen the settings in the Boards file and when I do a "Tools-VM-Rebuild tools chain"  with verbose on I see the fuse settings at the begining of the list. But when I examine the actual chip using "Tools-Device Programmig" the fuses are not always set as per the Boards file.
I know its possible to change the fuses in code and I was hoping to search all the #include files without having to open each one, to see if this was happening.
  
Back to top
 
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: Searching all #include files
Reply #3 - May 28th, 2014 at 2:15pm
Print Post  
Quote:
But when I examine the actual chip using "Tools-Device Programmig" the fuses are not always set as per the Boards file.

If you look at the full documentation for the Microcontroller on the board, you will get all the information about fuses and each of the bits. You will also get it from the fuse calculator. Hum, I think you already know  Wink.

Regarding Arduino, the fuses are programmed when the bootloader is uploaded to the board.

Sometimes, not all bits of a byte are used - the most significant bits are the one not used. When it's the case, these bits may be set to 1 or 0 with no difference. What I have seen is that the board definition file sets these unused bit to 0, but when avrdude reads back them for verification - during bootloader upload, these bits return 1. And then you get a verify error  Shocked ... that is false.

If you have a hardware programmer, then you can update fuses settings with  "Tools-Device Programming". I can't tell if fuses can be changed in code.

Beware though: changing fuse settings can brick an MCU. The only way to bring it back to life is to use a High Voltage programmer, and as far as I understand, the MCU can't be on a board.
  
Back to top
 
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Searching all #include files
Reply #4 - May 29th, 2014 at 12:13pm
Print Post  
I have just seen what I think will help examine the my projects active #include files, on the Visual Micro website:
http://www.visualmicro.com/page/How-to-use-the-Visual-Studio-object-browser-for-...
The only problem is I cant get this view. I cant see any reference to an "object browser" and I dont get a list of source files in the project explorer even though I have enabled "show all files".
What I do get is a list of "debug" and "release" files but they are greyed out and cannot be opened.
I have the configuration set to "release" as I am using an ISP on an ATtiny.
I notice that whilst I get a list of "output files" these can be opened for a while after starting V Studio but soon its not possible to open any of them until I have shut VSS down and re-started it.
I am using VM version 1.1404.01
Atmel Studio 6 versin 6.2.1153
« Last Edit: May 29th, 2014 at 12:17pm by Trek19 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Searching all #include files
Reply #5 - May 29th, 2014 at 12:58pm
Print Post  
Hi,

Sounds like you are using Atmel Studio and not Visual Studio. It's confusing but the "show all sketch files" currently only works in Visual Studio because atmel does not support virtual folders. We are looking at a workaround

The object browser is also a VS tool, for Atmel Studio you should look at the VisualAssistX menu because it drives all intellisense and code navigation.

If you are using a tiny with an arduino 1.0.x install then some fuse settings are hard coded. This is an area that is expanded within arduino 1.5.x

Either way the fuse settings are not considered part of the source codes so you will not find them this way.

Take a look at programmers.txt that is found with the boards.txt. The programers.txt is used to program the boards when not using USB 

If we can improve on the 1.0.x programmer upload we will but I am not sure if the atmel device tools will work correctly. If they do then you can program using them.
« Last Edit: May 29th, 2014 at 1:00pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Searching all #include files
Reply #6 - May 29th, 2014 at 2:22pm
Print Post  
Ah, silly mistake on my part in haste at thinking I had found a solution, yes I am using Atmel Studio.
I am using the Arduino 1.5.6-r2

Further to my comment about output files:
If have "show all files" on, when I click one the files say .elf I get the following:
[ERROR] Could not open the virtual file node.System.Runtime.InteropServices.COMException: , MethodName: OpenFile
If I disable "show all file" I get the file displayed.
I remeber reading something about displaying .elf files but cant now locate it.
« Last Edit: May 29th, 2014 at 3:01pm by Trek19 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Searching all #include files
Reply #7 - May 29th, 2014 at 2:31pm
Print Post  
Ok well with arduino 1.5 the fuses are set via the .txt config files (boards, platform and programmers)

There are no hard coded fuses so you have full access to manage the settings
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint