Odd included file behavior.

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

Since upgrading to AS7, I have noticed some odd handling of files included in a project.

Both were assembly files, a "Driver" file with my Video Driver Interrupt, and a "User File" with a Game Loop.

To start a new project, I just copy and paste an empty "Framework" project to a new directory and then open from there.

 

Now here is where it got weird...

 

After an hour of coding, I saved the file and deleted the old directory, which I often did in AS6.

But for some reason, AS7 had linked the main file from the current directory, and the included file from the old directory!!!

I lost a lot of work.

 

Here is what "seems" to be happening, which is different than Studio6...

 

You right click on project to include a file that already exists. Point to a file in the same directory, and all is well.

But if you copy that directory and open the project, it somehow remembers the base path and points to the original directory!!

You work along, thinking all is good, not realizing that your main files are in the current dir, with include files linked to some other long forgotten dir!

 

To verify I am only partially insane, I tried this on AS6, and it does not happen.

 

To beat this bug, I now do all includes from the code, but now you have to dig through "Dependencies" to open the file for editing.

It was nicer when it was just in the project tree.

 

Just thought I would warn y'all about this... it is VERY easy to lose your work if you do this project directory cloning.

 

Brad

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

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

Hmh, is this some sort of different handling in the 'add as link'? 

 

Inside a project file, we reference all files by relative paths. However, there is a (much debated) feature about 'Add existing file' to a project. Studio gives to options, add as link, and add (which implies that the file is COPIED to the project folder)... Is that part of the picture?

 

 

I'm not really grasping what the problem is... Could you write down a step-by-step, highlighting where things go weird?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Hello Morten,

 

I didn't want to post more about this until I had some time to work with both version a little more.

 

Seems that this issue is more than just moving files.

I have been working on a project for a few days, and all of a sudden this popped up...

 

 

I was just sitting there debugging (aka: staring intensely at my assembly code).

 

This starts to happen for no reason, and then I have to exit studio and reload the project.

After that, it's all good. Sometimes for days, sometimes for hours.

 

Thanks,

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

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

Ok, serious annoyance with this handling of included files!

Not only does AS7 randomly scream about files being changed outside the editor, but it also brings up 2 copies randomly.

Notice the 2 copies of the file User_Code.s in my project all of a sudden....

 

 

 

I now copy and paste to notepad often, as this is the only safe thing to do.

I have been bitten by this more than once, accidentally saving the wrong copy.

 

When I open a project, there all is well.

After some random time, there may be 2 copies like shown above.

I know... it's just me, and this is the first time anyone has heard of this crazy behavior!

This is expected, as I live on the fringe of a temporal wake.

 

I am going to go back to AS6.

Should I expect this task to require a full reload of every computer in my house, and replacement of all appliances with circuit boards?

Ok, that might be an exaggeration, but I do in fact expect this task to take me 3 days, and become a Yak shaving marathon again.

 

Later.

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Wed. Dec 16, 2015 - 11:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone else seen this behavior?

On the one station I left AS7, it happens several times in a few hours.

 

If you are not paying attention, you loose your work.

As soon as dual files pop up, the only fix is to exit and restart.

 

Bit me again 5 minutes ago... ACK!

 

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

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

An assembler file with an extension with a small .s (rather than a capital .S) is normally a temporary/intermediate/generates file. E.g. the C compiler generates an intermediate .s file. Is the User_code.s mentioned above something you wrote, or is it an intermediate file?

 

I wonder if this has something to do with your troubles.

 

A far-fetched experiment would be to copy all your source files to a new project, but in that copying also make sure they are named .S, before you add them to the new project. Will it happen there too? (Yes, it is far-fetched so this might not be the first thing to try...)

 

Have you tried disabling your anti-viral software? (They are known to sometimes interfere with stuff like compilers and debuggers...)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Thanks for the idea.

 

I took it a step further, and renamed all files.

 

These are the only files I have in the directory now...

 

 

I added capital S, and even changed main.c to Quark-85.C just in case the IDE is having a dumb attack.

 

Everything works as expected, and compiles just fine.

I will see how long things work before a dual copy of User_Code.S pops back up, which usually means lost work.

What's really odd is the last time it happened, it reverted to a very old version... several days old!

 

Here is how thing look when I first start up...

 

 

Notice how the IDE refuses the capital S on the included file?? Odd, since I call it in code with #include "User_Code.S"!

The reason I don't think that it's me doing something stupid is because this does NOT happen an Studio 6.

 

Cheers!

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Sun. Dec 20, 2015 - 03:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, just when I thought I could spend my time coding instead of fighting the ToolChain, it came back!....

 

 

Now look... one has a small .s and the other is a large .S

What the hell???

 

In an effort to drive me crazy, Studio always bring up the older one, so when you hit save, you loose your work.

Once again... totally random. Seems to happen about an hour after I start coding.

 

Zoinks Scoob, I don't think this one was ready for release yet!

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

Ok, to use AVRStudio 7, I now do all of my coding in NotePad++, and then copy and paste the text into each of the files in Studio.

I then save the project and compile. When the dual file annoyance pops up, I just restart Studio. I am NOT losing my work again!!

 

This is quite a time waster, but I am deathly afraid to revert back to 6.2 on this system.

Last time I messed with studio, it was a day wasted. At least this gets me by.

 

I might make a windows script to just copy and paste for me and press compile in Studio.

Seems like a crazy way to fly, but at least it works!

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Mon. Dec 21, 2015 - 12:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems a little like this -> https://www.avrfreaks.net/forum/a...

 

I haven't had any problems YET, but I name most of my assembler files ASM for the main and usually INC for the include files.

I see you have a C project with ASM files (.S) added, I wonder it that's the BUG trigger?

 

 

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

ront1234 wrote:

It seems a little like this -> https://www.avrfreaks.net/forum/a...

 

I haven't had any problems YET, but I name most of my assembler files ASM for the main and usually INC for the include files.

I see you have a C project with ASM files (.S) added, I wonder it that's the BUG trigger?

 

 

 

Interesting.

I don't know how to NOT have a C project.

Can I drop the C part altogether somehow?

 

This is the entirety of the C part...

 

// ASSEMBLY ROUTINES
extern int AVRC_RUN();

// START OF MAIN
int main(void) {
AVRC_RUN();
}

It just jumps to the Assembly program.

I sure would like to remove the C part, as it always seemed like a blemish on my nice code!

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

Quote:

 

Can I drop the C part altogether somehow?

 

 

Yes, if you don't need a C main, just select FILE->NEW->PROJECT and select assembly.

 

 

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

ront1234 wrote:
I name most of my assembler files ASM for the main and usually INC for the include files.

Yes, because you are using Atmel Assembler. You're following the convention for that assembler re filenames.

 

AtomicZombie wrote:
Interesting. I don't know how to NOT have a C project.

You use a C project, because you're using GNU Assembler. At least I hope you're using GNU, or my advice/ideas above does not apply..

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

ront1234 wrote:

Quote:

Can I drop the C part altogether somehow?

Yes, if you don't need a C main, just select FILE->NEW->PROJECT and select assembly.

Not if the assembler dialect used is GNU assembler, and you want the assembler to process the source to be avr-gas. Please don't confuse this more than absolutely necessary, ront1234.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Hi Brad,

 

In order to reproduce and analyze the issue we need the following details,

 

1. After opening the files in the Studio, hover the mouse pointer on the all the file tabs and mark the file path displayed.

2. When the specified issue occurs (two instances of the files are shown), again hover the mouse pointer on all the file tabs and mark the file path displayed on the files.

3. You may attach here or PM me the Atmel Studio solution/project which creates this issues. We will try to reproduce this issue in-house.

 

Thanks,

Deena

Regards,
Deena

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

Ok thanks, I shall follow your instructions next time I see double!

 

Cheers,

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

tsgd84 wrote:

Hi Brad,

 

In order to reproduce and analyze the issue we need the following details,

 

1. After opening the files in the Studio, hover the mouse pointer on the all the file tabs and mark the file path displayed.

2. When the specified issue occurs (two instances of the files are shown), again hover the mouse pointer on all the file tabs and mark the file path displayed on the files.

3. You may attach here or PM me the Atmel Studio solution/project which creates this issues. We will try to reproduce this issue in-house.

 

Thanks,

Deena

 

Ok, this is interesting!

Now that I know you can hover and get the path, it seems that the "Phantom" include is in the Debug directory!

After 20 minutes of coding, the phantom popped back up.

 

Here is the "correct" file and path...

 

 

And here is the "Phantom"....

 

 

Before I knew you could hover and get the path, I took a 50/50 shot at which file was the real one, and then closed the other.

Of course, 50% of the time I lost my work!

 

Now I know it's the one in "Debug" that I should toss.

I now close the Phantom, save the project, exit AS7, and reload.

This is still better than cutting and pasting from NotePad++

 

I also know what spawns the Phantom, although it only happens some of the time.

Type something stupid like "LDI R16", and then try to compile.

After you get a warning and close the dialog, 1 out of 10 times the Phantom will spawn.

This would explain why I see this more on late nights or when I am coding and drinking... more mistakes!

 

Anyhow, I can now go back to using Studio, and as long as I never make a syntax error, don't have to reload!

 

Hope this description helps.

Brad

 

 

I Like to Build Stuff : http://www.AtomicZombie.com

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

Hi Brad,

 

Thanks for the information. 

Just want to confirm, if you have ever opened the "User_Code.S" file inside the Debug path "D:/Shared/Plans/AVRCode/Tiny85 Quark85 VGA GameSystem/../Code/Debug/.././" in the Studio after starting the studio and before the instance of compilation with error.

 

Also, the reload dialog which you get after compilation shall save the "User_Code.S" inside the debug path but not the one in "D:/Shared/Plans/AVRCode/Tiny85 Quark85 VGA GameSystem/Code/"

 

Thanks,

Deena

Regards,
Deena

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

AtomicZombie wrote:
it seems that the "Phantom" include is in the Debug directory!

No, it's not. Notice the ".." that follows "Debug" which climbs up from the Debug folder back to the Code folder again. The "." simply means "current folder" so that changes nothing. It's the same file, referenced through two different paths...

 

tsgd84 wrote:
if you have ever opened the "User_Code.S" file inside the Debug path "D:/Shared/Plans/AVRCode/Tiny85 Quark85 VGA GameSystem/../Code/Debug/.././

This might simply be a language thing, but the file is not in the Debug folder, it's in the Code folder. Again, it's the same file - just two different paths.

 


 

I would be interested in seeing a complete directory tree. No file contents needed, but the complete tree structure with filenames. Also a screen dump of the complete tree as shown in the Solution Explorer.

 

Other things I see:

- The "normally opened file" has only back-slashes in its path. The "phantom" has forward slashes, hinting at that the path is constructed with the help of GNU stuff (compiler, Make...). Dependency generator, perhaps? Given this it would actually be interesting to see more than just directory/file structure, but also sources. I'm guessing wildly here, but it could be some strange include dependencies.. Is there a .dep folder in the Debug folder, and if so could you sip up it's contents and attach to a post here?

 

- The project/folder structure does not look like the conventional one. Again, knowing a thing or two about project structure and include stuff might shed some more light onto this.

 

 

If you don't want to reveal sources to the community and/or world, I could give you discretion guarantees and you could perhaps let me have a look. I can of-course give no guarantees for success, and might have to give up due to ignorance or lack of time, but... I would love to have an "al dente" thing to try to solve, rather than just the usual FAQ stuff that fills 90% of this site (nothing wrong with that, per se). I also know that talking to you will be a meaningful discussion with progress done for every Q/A round, rather than the usual water-treading (spelling?) that the 90-percenters practice.

 

Even better would be if you could lure Cliff (known here as "clawson") to have a look at it - he's an experienced assembler programmer in general, knows more than most of us re GNU stuff and likes puzzles :-) If he gives you promises of discretion I vouch for him without hesitation! If he comes over here you could perhaps tickle him into having a look?

 

Ponder my offer. I've got a small piece to write about Luke Stackwalker and Obi Frame-Kenobi... ;-)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

This might simply be a language thing, but the file is not in the Debug folder, it's in the Code folder. Again, it's the same file - just two different paths.

No it isn't?!? There are two files here:

 

D:/Shared/Plans/AVRCade/Tiny85 Quark85 VGA GameSystem/Code/User_Code.S

D:/Shared/Plans/AVRCade/Tiny85 Quark85 VGA GameSystem/User_Code.S (which is what you get when you unwind the ..'s)

 

I would be interested in seeing a complete directory tree. No file contents needed, but the complete tree structure with filenames.

For those of us old enough to remember DOS the command "tree /f" is very good for this.

Even better would be if you could lure Cliff (known here as "clawson") to have a look at it - he's an experienced assembler programmer in general, knows more than most of us re GNU stuff and likes puzzles :-) If he gives you promises of discretion I vouch for him without hesitation! If he comes over here you could perhaps tickle him into having a look?

While I would be interested in seeing the files/issue the fact is that I don't have a means to run AS7 so cannot see what Studio does with the files. The only Windows I have access to right now is Windows XP and apparently Studio 7 (being based on VS2013) now requires Win7 or beyond - so I cannot run it. I'm hoping that Santa may bring me a shiny new Win10 laptop so I should soon have the ability to run Studio again but, until then, I cannot see the actual double file effect in Studio.

 

(aside: isn't "Windows" a ridiculous price to buy retail? For what it costs I can buy half a reasonably specified laptop - so I decided to go the whole hog and buy the complete thing - or rather that's what I've heard Santa is planning ;-)

 

PS having now read this thread I do wonder what the use of #inlcude is for source files in a linking compiler/assembler! Why can't the linker join things? That's what it is good at - it "links" things!

Last Edited: Tue. Dec 22, 2015 - 11:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
D:/Shared/Plans/AVRCade/Tiny85 Quark85 VGA GameSystem/User_Code.S (which is what you get when you unwind the ..'s)

I disagree, but might very well be wrong (blindness is quite possible...)

 

Anyhow, here are the two paths

D:\Shared\Plans\AVRCade\Tiny85 Quark85 VGA GameSystem\Code\User_Code.S
D:\Shared\Plans\AVRCade\Tiny85 Quark85 VGA GameSystem\Code\Debug/.././User_Code.S

The beginning of them are the same so I'll just remove those so that we start in the Code directory in both cases...

Code\User_Code.S
Code\Debug/.././User_Code.S

The first file is obviously in the Code directory.

 

For the second file we go down from Code into Debug. We then go up again (..). Then stay in the same directory (.), and there is the file. Summing up: From Code down and then up. We are still in the Code directory.

 

Did you misread the "." (dot) as ".." (dot-dot) when unwinding the path, Cliff?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Tue. Dec 22, 2015 - 01:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the help.

I am sure there is a simple answer, and that I am doing something "off the wall" as usual.

I am good at breaking things in ways that designers never expected.

 

Let me explain the structure of my project, and perhaps it will make more sense.

 

[Main.c]

Apparently you need this in order to call the assembly program and run it.

No problem, that's all it does.

 

[Quark85Core.S]

This is what the C program calls. It starts things up, and runs the Video Driver Interrupt.

This one, I had to "add to project" as I could not figure out how to "include" it from the C program.

I figured out that I could right click on the project in that right window, and "add" it from there.

 

[User_Code.S]

This one is included part way in the source code of Quark85Core.S.

This has to be done this way, as the code needs to be in the correct place.

Sadly, this only shows up now in "Dependencies", not the main project.

 

To be honest, I normally just code in one HUGE file to avoid all this ugliness.

I prefer clean+simple, but in this case, the splitting up the code is to make it "easier" for others to use my project.

User_Code is all the End User is allowed to change, which is why I made it separate.

 

Does this make sense?

Perhaps there is a better way to tie all these files together?

 

As ToolChains "progess" to make life easier for the programmer, I become more and more confused by all the bloat.

If NotePad had a "compile" button, this would be my kind of perfection, as I do most coding in my head, then just type it later!

 

Cheers,

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Tue. Dec 22, 2015 - 01:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How did you include the USer_Code.S file in your code?

Is it something similar to the following inside the file "Quark85Core.S?

 

#include "User_Code.S"

 

Can you paste the exact line which you used to include the file?

You need to check whether it is referred with relative to Quark85Core.S or the absolute path.

 

Sadly, this only shows up now in "Dependencies", not the main project.

Expand the "Dependencies" folder in Solution Explorer and locate "User_Code.S", right click on this item and click properties to know from where the file is linked. Refer the screenshot below

 

Regards,
Deena

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

Thanks.

 

Here is the segment of code called from C that includes the User File (see at bottom). The code continues after that.

 

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// QUARK-85 DRIVER INITIALIZATION ROUTINE
////////////////////////////////////////////////////////////////////////////////////////////////////////

// ATTINY-85 INCLUDES
#define __SFR_OFFSET 0 
#include <avr/io.h>

// STARTUP ROUTINE
.global AVRC_RUN
AVRC_RUN:

// SETUP JOYSTICK ADC
ldi r18,31
out DIDR0,r18
ldi r18,0x20
out ADMUX,r18
ldi r18,229
out ADCSRA,r18
ldi r18,88
out ADCSRB,r18

// SETUP TIMER 0 : VIDEO INTERRUPT @ 1144 CYCLES / 8 = 143
ldi r18,142
out OCR0A,r18
ldi r18,2
out TCCR0A,r18
out TCCR0B,r18
ldi r18,16
out TIMSK,r18

// SETUP TIMER 1 : LATENCY EQUALIZER TIMER @ 4 CYCLES
ldi r18,129
out TCCR1,r18
ldi r18,3
out OCR1C,r18

// SYNCHRONIZE LATENCY TIMER
ldi r18,0
out TCNT0,r18
ldi r18,2
out TCNT1,r18

// ENABLE VIDEO DRIVER
sei

// INCLUDE USER CODE
#include "User_Code.s"

 

I checked the path as you asked. It is the base directory that contains the project.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

I disagree, but might very well be wrong (blindness is quite possible...)

The blindness is mine! blush

 

I misread "../." as "../..". Why one earth would anyone, anywhere ever quote a path including a single dot? I guess Microsoft never really got the hang of the whole path thing when they stole most of the rest of Unix!

 

@AtomicZombie, you really should explore -nostartfiles then you wouldn't need any C or any main() at all. At the very least implement main: as a label in .S and forget .c

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

@AtomicZombie: Can you do a screen dump of the Solution Explorer window (with everything expanded)?

 

I'm getting uncertain again: Are you using avr-gas (the GNU assembler) or are you using Atmel Assembler? (My bet is still on the former, but I'd like to be 100% sure...)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Johan,

 

If he does this:

// ASSEMBLY ROUTINES
extern int AVRC_RUN();

// START OF MAIN
int main(void) {
AVRC_RUN();
}

then there's virtually no doubt this is avr-as.

 

But, as I say, he might as well drop the .c file from the project and just rename the label "AVRC_RUN:" to be "main:"

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

Those things are exactly why I tried to lure you into this thread. I've never used avr-gas (more than some very small experiment) and never with any half-recent Atmel Studio.

 

My first bet is still that this has something to do with computed dependencies, the #includes and debugging - the debugger/Studio decides that a source file isn't open, based on the path it decides the file to have (that would be the second path, with the Unix/Linux forward slashes). It fails to identify the first path as being the same and that the file is already open.

 

One of my goals with asking questions to Zombie is to know enough to be able to reproduce this is a minimal but complete example. That would be fun, and I'm always eager to learn something new.. (-:

 

Next step would be transform that example to one that does not do a lot of #includes to render one assembly unit, but to assemble separately and then link - the M.O. that the GNU toolchain developers intended.

 

Finally, by producing a minimal but complete example, this could possibly be something to give to the Atmel people so that they can decide if this is a bug, and if so if it is important/serious enough to prioritize. (My bet, if my speculations above holds, is that the final advice will be to assemble separately and link.

 

When I get to something substantial Iäm sure I will have questions re how to accomplish this, but I'll pose them in a separate thread so as not to disturb/derail this one.

 

So, again for Zombie:

- A directory tree "dump".

- A screen dump of the Solution explorer contents.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

JohanEkdahl wrote:

So, again for Zombie:

- A directory tree "dump".

- A screen dump of the Solution explorer contents.

 

Thanks, will do when I am at home in my cozy basement lab!

I only have an old copy on my laptop right now, and it is on a USB stick.

For the record, the Phantom Include happens no matter the path, shared, C Drive, USB, etc.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

Hey thanks!! I have been trying to do that for a while now.

I didn't realize that it had to be called main instead of MAIN, that's all!

I always use uppercase for labels.

 

Anyhow, this is great... no more C in my pure assembly project...

 

 

Don't get me wrong, I thing GCC is amazing in the way that you can mix C and Assembly, and I do it for most projects.

It's just for this one, I hated having any C code in there as it served no real purpose.

 

I will see if this also kills the Phantom Menace.

 

Cheers!

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

Ok, the Phantom came back after coding for a bit.

I am noticing that the "bogus" copy is the one with no asterisk.

The bastard tries to trick me though. If you click on a error in the output window, it opens the Phantom copy.

If you are not paying attention, you then make changes and save the WRONG copy.

Oh boy, this is annoying.

 

As requested, Solution Explorer dump...

 

 

Path to the one on the left is... D:\Shared\Plans\AVRCade\Tiny85 Quark85 VGA GameSystem\Code\Debug/.././User_Code.S

Path to the one on the right is... D:\Shared\Plans\AVRCade\Tiny85 Quark85 VGA GameSystem\Code\User_Code.S

 

Notice the path to the Phantom (left)... it think it's on some kind of Linux machine or something??

Forward slashes?? What the hell dude, I am a Windoze fanboy.

 

A am so happy about learning how to drop the "main.C" that this isn't even bugging me tonight!

 

Brad

 

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Wed. Dec 23, 2015 - 12:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:
Notice the path to the Phantom (left)... it think it's on some kind of Linux machine or something?? Forward slashes?? What the hell dude, I am a Windoze fanboy.

You're on a Windows machine for sure, but the tool chain you're using is GNU. It accepts forward slashes happily.

 

Since you didn't type that path with forward slashes yourself, it comes from somewhere else. Since nothing (?) but the GNU tools will generate forward slashes my speculation all along is that they come from there. The most likely source is some kind of dependency detection. GCC does such and it is e.g. triggered by the makefile, but I'm not sure (yet!) if GAS projects also can do that.

 

Time for some experimenting!

 

@Zombie: Could you do this: Click the User_Code.S in the Solution Explorer tree, and look in the Properties pane. There should be a path to the file there. Is it the "pure Windows path" or the path with forward slashes in it?

 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

The non-windows format path (Phantom's path) is being taken from the gcc output and gets populated in Error list.

I guess, when you double click the item from error list, Atmel Studio opens a new file tab even though there is an equivalent document already opened in Studio.

I will check this locally and let you know.

 

 

Regards,
Deena

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

JohanEkdahl wrote:

@Zombie: Could you do this: Click the User_Code.S in the Solution Explorer tree, and look in the Properties pane. There should be a path to the file there. Is it the "pure Windows path" or the path with forward slashes in it?

 

Thanks for the help.

The path of the file is proper... whatever folder the project is located in.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

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

tsgd84 wrote:

The non-windows format path (Phantom's path) is being taken from the gcc output and gets populated in Error list.

I guess, when you double click the item from error list, Atmel Studio opens a new file tab even though there is an equivalent document already opened in Studio.

I will check this locally and let you know.

 

That makes sense, since I always click on the Output Window to throw me to the offending error.

This never happened in older Studio Versions.

 

Brad

I Like to Build Stuff : http://www.AtomicZombie.com