Skip to content

doc/mega-xplained: add JTAG/Atmel-ICE instructions#11209

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
danpetry:boards/mega1284p_xplained
Sep 11, 2019
Merged

doc/mega-xplained: add JTAG/Atmel-ICE instructions#11209
benpicco merged 1 commit intoRIOT-OS:masterfrom
danpetry:boards/mega1284p_xplained

Conversation

@danpetry
Copy link
Contributor

Contribution description

Adds instructions for flashing with the Atmel-ICE with the JTAG header.

Testing procedure

Get an Atmel-ICE and mega-xplained, follow these instructions, and see if it works

Issues/PRs references

Depends on #9818 because there's an image of the setup that needs including

@danpetry danpetry requested review from jcarrano and kYc0o and removed request for kYc0o March 19, 2019 14:40
@danpetry danpetry added the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 19, 2019
@danpetry
Copy link
Contributor Author

addressed comments

If using the Atmel-ICE:

```
make BOARD=mega-xplained PROGRAMMER=atmelice -C examples/hello-world flash
Copy link
Contributor

Choose a reason for hiding this comment

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

The BOARD and PROGRAMMER should be put as environment variable, not a command line overwrite as it is not needed.

Copy link
Contributor

@cladmi cladmi Mar 26, 2019

Choose a reason for hiding this comment

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

With the current configuration, it does not work: was on an old PR…

avrdude -p m1284p -c atmelice -P /dev/ttyUSB0 -F -U flash:w:/home/harter/work/git/RIOT/tests/bloom_bytes/bin/mega-xplained/tests_bloom_bytes.hex
avrdude: jtag3_open_common(): JTAGICE3/EDBG port names must start with "usb"

avrdude done.  Thank you.

/home/harter/work/git/RIOT/tests/bloom_bytes/../../Makefile.include:531: recipe for target 'flash' failed
make: *** [flash] Error 1
make: Leaving directory '/home/harter/work/git/RIOT/tests/bloom_bytes'

PROGRAMMER_FLAGS in the board Makefile.include should be put overwritable:

diff --git a/boards/mega-xplained/Makefile.include b/boards/mega-xplained/Makefile.include
index 9a8d7e5f4..4d7e1b138 100644
--- a/boards/mega-xplained/Makefile.include
+++ b/boards/mega-xplained/Makefile.include
@@ -23,7 +23,7 @@ export DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBU
 # PROGRAMMER defaults to the Bus Pirate ISP
 export PROGRAMMER ?= buspirate
 
-export PROGRAMMER_FLAGS = -P /dev/ttyUSB0
+export PROGRAMMER_FLAGS ?= -P /dev/ttyUSB0
 
 OFLAGS += -j .text -j .data
 export FFLAGS += -p m1284p -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -U flash:w:$(HEXFILE)

and then the following works

BOARD=mega-xplained PROGRAMMER=atmelice PROGRAMMER_FLAGS= make -C tests/bloom_bytes/ flash term

Copy link
Contributor

Choose a reason for hiding this comment

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

The other solution is to make the PROGRAMMER_FLAGS conditional to PROGRAMMER being buspirate.

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad, I was on another branch while testing this one. So no need to change PROGRAMMER_FLAGS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, so just to clarify: provide BOARD and PROGRAMMER via changing environment variables; no other changes?

Copy link
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

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

Please change the commands to flash, configuration should almost never be put in the command line but only in the environment. It also currently has nasty side effect to define variables on the command line.

In place of the picture, you can also just mention to match the JTAG square pin if it helps plugging it right.

Otherwise I now manage to flash with the atmelice with the updated procedure.

Would be good if we manage to have reset for this too, but would be another PR I guess.

@danpetry danpetry force-pushed the boards/mega1284p_xplained branch from c56410e to 26b8cc4 Compare March 27, 2019 10:19
@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Apr 30, 2019
Copy link
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

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

Good for me like this. Please squash.

@danpetry danpetry force-pushed the boards/mega1284p_xplained branch from 26b8cc4 to 1ce846f Compare May 3, 2019 16:33
@jcarrano jcarrano added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 10, 2019
Copy link
Contributor

@jcarrano jcarrano left a comment

Choose a reason for hiding this comment

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

reasserting @cladmi's review.

@benpicco benpicco added Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 10, 2019
@jcarrano jcarrano force-pushed the boards/mega1284p_xplained branch from 1ce846f to 4554b6c Compare September 11, 2019 09:44
Adds instrucions for the Atmel-ICE with the JTAG header.
@benpicco benpicco merged commit e11d457 into RIOT-OS:master Sep 11, 2019
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants