Author Topic: How to stop microchip / atmel studio from linking to files in other projects  (Read 20774 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
i have a problem with microchip studio. I take a copy of a project and change the folder name. Now when I go through this project I right click on something and select go to definition or whatever and it pulls files from the other folder of the "archived" copy.

There are no references that i can see to the projects path that could have been copied over. What the hell is going on with this garbage?
 

Online nali

  • Frequent Contributor
  • **
  • Posts: 901
  • Country: gb
I started out with Studio last week. After a few days messing about it's now uninstalled and replaced with MPLAB/X.

From AVRFreaks:
Quote
By the way, I reported a bug on the Studio debugger. I just got this back:
Quote
    Please note, for Microchip studio IDE, No further additions of new devices support, no more bug fixes are planned. For new project / designs, we recommend to use MPLAB Ecosystem. https://www.microchip.com/en-us/tools-resources/develop/mplab-x-id
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 4879
  • Country: us
I have never found an IDE that handles this acceptably.  Some do a better job than others but all of them ultimately fail. The only way around it is to not copy projects.  Instead create a new project and copy the code over.

This sucks because all of the configuration you did in the GUI that was supposed to be helping you is basically lost.  If you didn't take notes of every single change you made, you just are starting from scratch.

For this reason it's ok to use an IDE for simple projects where you don't have to change much from the defaults.  If you are doing extensive project customization i  an IDE you should rethink it and move to manually managing your build system.
 

Offline Perkele

  • Regular Contributor
  • *
  • Posts: 78
  • Country: ie
If this is "Atmel Studio", have you tried to remove .atsuo files from .vs subfolder after copying a project?
Those files are updated on each compile/build, they contain some hardcoded paths, debug info, etc.

P.S. Do a  backup before trying to remove files.
 
The following users thanked this post: ajb

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Deleting the `.atsuo` files as Perkele mentions is a good first step in solving any kind of weirdness with Microchip/Atmel Studio.  IME doing that has never caused a problem.  You can also safely add them to .gitignore. 

There may be a setting somewhere to control absolute vs relative paths, but I've definitely duplicated atmel studio projects before and not seen this, so just deleting the .atsuo/other transient files might be enough.

This sucks because all of the configuration you did in the GUI that was supposed to be helping you is basically lost.  If you didn't take notes of every single change you made, you just are starting from scratch.

At least in Microchip/Atmel Studio (and Visual Studio, which the former is based on), all of that configuration is in plaintext in the project files.  It might take a bit of work to extract it and port to a new build system, but it's not especially difficult to skim through and find most of the things that you would need to transfer.  And if you're starting with a working IDE project, you can probably grab the automatically-generated makefile out of the build directory as a starting point.  There are definitely some advantages to a non-IDE build system, but there's also a very large grey area as far as when it becomes the truly 'better' choice, depending on the project and the people working on it. 
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
I just don't get it. All it has to do is follow the rules of the language. Did I include that file via the IDE or #include? no! , then why is it looking at it. It should rewrite all paths it has "collected" when I do a rebuild.

So what file do I open when I open a project, the atsuo or the cproj ?
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
So I had to change the folder name. Nuts, is this microchip/atmel or microsoft that have stuffed up? if I get visual studio straight from microsoft would it do the same?

I would love to use MPLABX but until microchip and netbeans work out how to use a 4k monitor I cannot use it as the !upscaled rendition on a 4k screen is worse than using a straight FHD screen. it's nuts.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: gb
  • Doing electronics since the 1960s...
Crosslinked files is an absolute bastard of a gotcha with ST Cube IDE.

That is why I decided to not build multiple projects in it but instead build both a boot loader and the application code as one project. Lots of super-intelligent people here told me I was an idiot, etc, but it is much cleaner in the end.

Otherwise, one could have run multiple IDE instances in VMs, to ensure total separation.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online jc101

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: gb
So I had to change the folder name. Nuts, is this microchip/atmel or microsoft that have stuffed up? if I get visual studio straight from microsoft would it do the same?

I would love to use MPLABX but until microchip and netbeans work out how to use a 4k monitor I cannot use it as the !upscaled rendition on a 4k screen is worse than using a straight FHD screen. it's nuts.
I use MPLAB X on a 4k monitor, but I have to modify the mplab_ide.conf file to make it usable. This is in the MPLAB install directory\mplab_platform\etc\

Edit the  "default_options=" line to add...

Code: [Select]
-J-Dsun.java2d.dpiaware=true
..as the first parameter.  Restart MPLAB and it's perfectly fine on a 4K monitor for me.  That is the only change I make whenever I install a new version.

edit to add I remember posting this before... https://www.eevblog.com/forum/microcontrollers/alternative-(better!)-ide-to-mplab-x/msg3625046/#msg3625046
« Last Edit: March 01, 2024, 10:42:21 pm by jc101 »
 
The following users thanked this post: tooki, 2N3055

Offline Perkele

  • Regular Contributor
  • *
  • Posts: 78
  • Country: ie
So I had to change the folder name. Nuts, is this microchip/atmel or microsoft that have stuffed up? if I get visual studio straight from microsoft would it do the same?

I would love to use MPLABX but until microchip and netbeans work out how to use a 4k monitor I cannot use it as the !upscaled rendition on a 4k screen is worse than using a straight FHD screen. it's nuts.

Here's a bit about .suo files:
https://learn.microsoft.com/e1n-us/visualstudio/extensibility/internals/solution-user-options-dot-suo-file?view=vs-2022
Atmel added their stuff into the file structure and renamed it to .atsuo.

.sln and .cproj files in project's root folder are XML-based, the structure is almost sane for the last decade or so.
In "plain" VisualStudio there shouldn't be any hardcoded paths in them. If you open .cproj file in your project with a text editor, you'll see that there is a hardcoded path to device packages installed by Atmel.m
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 7969
  • Country: ca
Dont you have "Save Project As..." in the File menu of the IDE?
In Altium I have to "Save File As..." every file in the project to the new folder, not just the project file.
Facebook-free life and Rigol-free shack.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Crosslinked files is an absolute bastard of a gotcha with ST Cube IDE.

That is why I decided to not build multiple projects in it but instead build both a boot loader and the application code as one project. Lots of super-intelligent people here told me I was an idiot, etc, but it is much cleaner in the end.

Otherwise, one could have run multiple IDE instances in VMs, to ensure total separation.


This is not about multiple projects together, like a solution full of projects or whichever way around it is. This is literally once you open a file with it and then close the project and open a completely different folder that happens to have a file with the same name it uses the one that has nothing to do with your project. Looking in the two project files I see no paths so this is the softwrae doing it.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics


I use MPLAB X on a 4k monitor, but I have to modify the mplab_ide.conf file to make it usable. This is in the MPLAB install directory\mplab_platform\etc\

Edit the  "default_options=" line to add...

Code: [Select]
-J-Dsun.java2d.dpiaware=true
..as the first parameter.  Restart MPLAB and it's perfectly fine on a 4K monitor for me.  That is the only change I make whenever I install a new version.

edit to add I remember posting this before... https://www.eevblog.com/forum/microcontrollers/alternative-(better!)-ide-to-mplab-x/msg3625046/#msg3625046

Yea, did not work last time I tried on a work computer. I don't know if it is down to how the IT company have tied down our machines or what but it's a pain in the backside when you have to work around artificial problems but then IT is largely an artificial problem perpetuated by the IT company in order to create a self sustaining business fixing problems they caused in the first place.

I'll try it on my home computer.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18933
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
So I am back to the same old, I can have small well defined program elements with some random content the correct size and I would have to pick large font size because the program is actually totally unaware of the screen settings, the setting just stops the program upscaling itself badly.

The other option is to get windows to scale it which does a good job on icons but leaves all text elements small and will ruin the file editing window with a lousy attemp at upscaling.

So again, you can't win. if you can read tiny text it sort of works. but I absolutely would not say that MPLABX is 4k screen ready, it's the usual old programmer thing of any result is a result what's your problem.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 16157
  • Country: ch
So again, you can't win. if you can read tiny text it sort of works. but I absolutely would not say that MPLABX is 4k screen ready, it's the usual old programmer thing of any result is a result what's your problem.
That, with some font sizes tweaked, is how I used it at my old job.

MPLABX has no trouble copying projects. At least, I had zero trouble doing so, regardless of whether I did it externally in Windows Explorer, or via MPLABX’s own copy command.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->