Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atmel support and fixes #18

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

VeliMattiLahtela
Copy link
Contributor

Atmel support added and verified.
Atmel flashing with attached binaries supported with linux and windows, no need for Atmel studio.
Unit tests added.

@jupe @marhil01

Veli-Matti Lahtela added 5 commits April 26, 2016 15:50
A few more unit tests added.
…m is not found from the system.

Added linux support for Atmel flashing.
include binaries on setup
Prevented while 1 loop in flash multiple devices, would present it self if wrong platform given with all or prefix.
Unit test added.
@@ -179,7 +177,9 @@ def flash(self, build, target_id=None, platform_name=None, device_mapping_table=

if target_id.lower() == 'all':
return self.flash_multiple(build, platform_name, pyocd)
elif len(target_id) < 48:
elif len(target_id) < 48 and platform_name == 'K64F':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there is K64F ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarification added

K64F with daplink 241 target id length is 48
SAM4E target id length is 20
@VeliMattiLahtela
Copy link
Contributor Author

test this please

elif len(target_id) < 48:
elif len(target_id) < 48 and platform_name == 'K64F': # prefix flashing support, ID length is 48 for K64F
return self.flash_multiple(build, platform_name, pyocd, target_id)
elif len(target_id) < 20 and platform_name == 'SAM4E': # prefix flashing support, ID length is 20 for SAM4E
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there is SAM4E hard coded here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform_name has to be given when flashing and for SAM4E target_id length is max 20. if we do not have the separation of K64F and SAM4E prefix support stops working. i.e. giving a prefix 02 that would flash all devices that start with 02 would go to either ATMEL flash or Mbed flash.

if platform.system() == 'Windows':
cmd = [self.exe, "-bpv", "-t", "atmel_cm4", "-s", target['target_id'],"-f", source]
else:
cmd = ['sudo', self.exe, "-bpv", "-t", "atmel_cm4", "-s", target['target_id'],"-f", source]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably shouldn't execute using sudo inside the flasher

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least it did not work on my setup without sudo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree to @kuggenhoffen

There might not even be a sudo on some systems (say vanilla Debian).

I believe this is once again a case for some udev rule writing rehearsal

Veli-Matti Lahtela added 3 commits June 13, 2016 08:43
…latform.

Removed non valid unittest related to missing platform.
…rt_and_fixes

erase and reset updated to support atmel boards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants