Make project device serial-number agnostic

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

Reposting here from https://stackoverflow.com/questions/47208476/atmel-studio-make-project-device-serial-number-agnostic

 

My colleagues and I are using AtmelStudio v7.0.1645 to develop software for the Atmel SAM V71 Xplained Ultra (ATSAMV71Q21). We have a shared Git repository for code.

 

We have several of these boards and as a result we run into an issue when programming the boards.

 

The .cproj .cproj file, under version control, has the serial number of the specific board placed in the ToolNumber field.

 

<Project DefaultTargets="Build"
    xmlns="http://schemas.microsoft.com/dev..."
    ToolsVersion="14.0">
  <PropertyGroup>
    ...
    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
    <avrtoolserialnumber>ATML2000...</avrtoolserialnumber>
    <avrtoolinterface>SWD</avrtoolinterface>
    <com_atmel_avrdbg_tool_edbg>
      <ToolOptions>
        <InterfaceProperties>
          <SwdClock>2000000</SwdClock>
        </InterfaceProperties>
        <InterfaceName>SWD</InterfaceName>
      </ToolOptions>
      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
      <ToolNumber>ATML2000...</ToolNumber>
      <ToolName>EDBG</ToolName>
    </com_atmel_avrdbg_tool_edbg>
    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
  </PropertyGroup>
</Project>

 

At present if the field value is wrong then programming the board fails with the error: [ERROR] The tool specified has been disconnected. Please reconnect the tool or choose another one[ERROR] The tool specified has been disconnected. Please reconnect the tool or choose another one

 

The serial number should be user-specific, and should not be included in source control. How can Atmel Studio be made to work that way?

 

Thanks,

Graham

This topic has a solution.
Last Edited: Thu. Dec 14, 2017 - 10:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GrahamA wrote:
The serial number should be user-specific, and should not be included in source control.

Absolutely agree!!

 

angry

 

Atmel really need to think harder about what goes in the Project files (which should be version-controlled), and what goes in the "local user preferences" (which should not be under VC)

 

This has also come up on AVRFreks before ...

 

EDIT

Found it: https://www.avrfreaks.net/comment...

 

EDIT 2

Where it is acknowledged to be a known issue: https://www.avrfreaks.net/comment...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Nov 23, 2017 - 01:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Though in the vein of feature requests, the ability to have multiple devices would be appreciated also; a few of us are working on revision-A boards (ATSAMV71Q21) and others revision-B (ATSAMV71Q21B). Not as important but worth a mention in case any plucky Atmel devs come across this.

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

Seconded.

 

It can't be uncommon for a project to start on a Dev Board of some sort - so use whatever device happens to be on it - and then move to the custom hardware with a different variant of the device, specifically chosen for the project requirements.

 

In previous experience, Atmel Studio (it was 6 then, but I don't think it's significantly changed) did not handle this well at all.

 

I think I ended up with a separate Project for each different device within the Solution ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've created a work-around for this, which is a script to strip-out element values that shouldn't be in the *.cproj file. I've created git hooks for the pre- and post-commit stages which will also output pretty XML.

The code is on GitHub: https://github.com/GRArmstrong/a...

Graham