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

boards/calliope-mini: rework programmer config (openocd and pyocd) #11407

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Apr 17, 2019

Contribution description

This PR is changing the programmer options for the calliope-mini board. After #11404 was opened, I checked and apparently this board provides a CMSIS-DAP programmer interface by default, which is compatible with openocd and pyocd.

For example, they use this openocd configuration in there sample projects.

I'm wondering why jlink adapter was selected as the default. There's no documentation about that.

Testing procedure

Try to flash a calliope-mini with PROGRAMMER=openocd or PROGRAMMER=pyocd, it should work.

Issues/PRs references

Noticed while looking at #11404

@aabadie aabadie added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Apr 17, 2019
@aabadie aabadie requested a review from miri64 April 17, 2019 05:50
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 17, 2019
@miri64
Copy link
Member

miri64 commented Apr 17, 2019

Works for openocd but not for pyocd (though I don't get en error returned):

$ BOARD=calliope-mini PROGRAMMER=pyocd make -C examples/hello-world/ --no-print-directory flash
Building application "hello-world" for "calliope-mini" with MCU "nrf51".

[…]
   text	   data	    bss	    dec	    hex	filename
   8000	    136	   2604	  10740	   29f4	/home/mlenders/Repositories/RIOT-OS/RIOT/examples/hello-world/bin/calliope-mini/hello-world.elf
/home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/pyocd/pyocd.sh flash /home/mlenders/Repositories/RIOT-OS/RIOT/examples/hello-world/bin/calliope-mini/hello-world.hex
### Flashing Target ###
0000194:WARNING:mbed_board:Board ID 12A0 is not recognized; you will be able to use pyOCD but not program flash.
0000261:INFO:rom_table:AP#0 ROM table #0 @ 0xf0000000 (designer=244 part=001)
0000268:INFO:rom_table:[0]<e00ff000:ROM class=1 designer=43b part=471>
0000268:INFO:rom_table:  AP#0 ROM table #1 @ 0xe00ff000 (designer=43b part=471)
0000275:INFO:rom_table:  [0]<e000e000:SCS-M0+ class=14 designer=43b part=008>
0000280:INFO:rom_table:  [1]<e0001000:DWT-M0+ class=14 designer=43b part=00a>
0000285:INFO:rom_table:  [2]<e0002000:BPU class=14 designer=43b part=00b>
0000291:INFO:rom_table:[1]<f0002000:??? class=9 designer=43b part=9a3 devtype=13 archid=0000 devid=0:0:0>
0000317:WARNING:loader:Failed to add data chunk: no memory region defined for address 0x00000000
0000317:INFO:loader:Erased 0 bytes (0 sectors), programmed 0 bytes (0 pages), skipped 0 bytes (0 pages) at 0.00 kB/s
Done flashing

@miri64
Copy link
Member

miri64 commented Apr 17, 2019

So suggestion: remove pyocd config for now. Without it, this would be an insta-merge ;-)

@aabadie
Copy link
Contributor Author

aabadie commented Apr 17, 2019

For the pyocd change, I'm sure this is possible. Maybe one needs to add an extra configuration in Makefile.include: can you try to add export FLASH_TARGET_TYPE ?= -t nrf51 before include $(RIOTMAKE)/tools/pyocd.inc.mk ?

@miri64
Copy link
Member

miri64 commented Apr 17, 2019

For the pyocd change, I'm sure this is possible.

Me as well, I just don't think those configurations should be one commit TBH ;-). I'll try what you proposed anyway.

@aabadie
Copy link
Contributor Author

aabadie commented Apr 17, 2019

No problem, I totally agree with the split in 2 commits :)

@miri64
Copy link
Member

miri64 commented Apr 17, 2019

can you try to add export FLASH_TARGET_TYPE ?= -t nrf51 before include $(RIOTMAKE)/tools/pyocd.inc.mk ?

It works with that.

@aabadie aabadie force-pushed the pr/boards/calliope-mini-programmer branch from 2440cef to ccebd2b Compare April 17, 2019 12:09
@aabadie
Copy link
Contributor Author

aabadie commented Apr 17, 2019

Thanks for testing @miri64!

I split the PR in 2 commits and adapted the PyOCD part with the target type variable.

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

ACK. Both flashing with openocd and pyocd still works. Flashing with fscopy also still works.

@miri64 miri64 merged commit b23fa61 into RIOT-OS:master Apr 17, 2019
@aabadie aabadie deleted the pr/boards/calliope-mini-programmer branch May 30, 2019 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants