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

board:cpu: RIOT port for the atsamr21xpro board #1646

Closed
21 tasks done
thomaseichinger opened this issue Sep 9, 2014 · 74 comments
Closed
21 tasks done

board:cpu: RIOT port for the atsamr21xpro board #1646

thomaseichinger opened this issue Sep 9, 2014 · 74 comments
Assignees
Labels
Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT

Comments

@thomaseichinger
Copy link
Member

thomaseichinger commented Sep 9, 2014

List to coordinate porting efforts for the samr21xpro board and it's samd21 cpu.
Please leave a comment what you are working on to mark it in the list and
open pull requests against https://github.com/thomaseichinger/RIOT/tree/samr21 master branch.

Porting todos:

@thomaseichinger thomaseichinger added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Sep 9, 2014
@thomaseichinger thomaseichinger self-assigned this Sep 9, 2014
@thomaseichinger thomaseichinger added this to the Release NEXT MAJOR milestone Sep 9, 2014
@N8Fear N8Fear modified the milestones: FIX ME FIRST, Release NEXT MAJOR Sep 9, 2014
@N8Fear
Copy link

N8Fear commented Sep 9, 2014

Sorry - I should really look where I'm clicking at... :-/

@thomaseichinger thomaseichinger added the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Sep 9, 2014
@Troels51
Copy link
Contributor

Troels51 commented Sep 9, 2014

Hey, i'm new to this project but i'm looking into porting RIOT to the board as well.
I've been working on gpio and timers

@thomaseichinger
Copy link
Member Author

@Troels51, welcome! Great to hear, I marked GPIO in the list with your name.

@wiredsource
Copy link
Member

@thomaseichinger
Troels and myself are two of the tree students from Aarhus University.
e.g. "[riot-devel] RIOT OS for the Atmel SAM R21 (ARM m0+)" thread

@thomaseichinger
Copy link
Member Author

@wiredsource welcome to you too! Are you working on GPIO too?

To give a short update regarding UART, I've some output right now but it is still invalid.
Also watch out when configuring GCLK modules, if misconfigured the board isn't reachable
anymore via open-ocd and has to be erased using AtmelStudio (AFAIK Windows only).

@wiredsource
Copy link
Member

@thomaseichinger
Right now i'm just spectating because i need a better overview over the system. @Troels51 has worked with it for the past week so he has a way better understanding of the architecture.

I will start on something constructive soon :-)

@wiredsource
Copy link
Member

Hi @thomaseichinger
I hope you had a good weekend...?

I have a question...
What is the status on the UART? We are very excited to know about this one for debugging purposes. @Troels51 have worked on the timers for the last few days and also went around the UART a bit.

But do you have an idea of when it could be ready for test?

@thomaseichinger
Copy link
Member Author

Currently I've output from the UART but it is scrambled, I'll have to tweak some parameters regarding clk settings and baudrate. Hope to get it done by tomorrow.

@wiredsource
Copy link
Member

Very good news 👍

I looked at your uart file earlier and i spotted that you used a baudrate 115200 right?
I'm pretty sure the default is 9600.
But if theres a problem with the clk it's properly around that one the issue remains...?

@wiredsource
Copy link
Member

@thomaseichinger

I'm trying my luck with the ADC atm :-D

@thomaseichinger
Copy link
Member Author

I pushed my latest changes to my repository. It's still not working correctly but I can't see the error right now. Maybe a couple of fresh eyes can spot it.

@wiredsource great, I marked the list entry.

@wiredsource
Copy link
Member

@thomaseichinger

Cool we'll check it out right way.

Regarding the ADC...

  • It seems that we'll loose some of the functionalities of the ADC of this board if we use the adc.h interface. This boards adc delivers multiple config possibilities e.g. differential mode, sample accumulation, free running, callback etc...

Would it be possible to perhaps make an ADC extension feature of these configurations?
Did this issue not come up with some of the other ADC types?

Any suggestions?

@thomaseichinger
Copy link
Member Author

The basic idea of periph/* drivers is to provide a subset of functionality that is common to all platforms in the best case.
This said there is the possibility to implement more advanced features this for this board only besides these interfaces. If it is a matter of configuration, meaning adding a parameter to the initialisation I'd propose you open a PR against periph/adc.hwith suggestions so this could be discussed in more detail.

@Troels51
Copy link
Contributor

The UART is working for me right now, i think the clocks were set up in a faulty way.

@OlegHahm
Copy link
Member

Sounds awesome - can you send a pointer to your version with working UART?

@Troels51
Copy link
Contributor

@wiredsource
Copy link
Member

@thomaseichinger @OlegHahm

Hi guys!

i'm getting an error while flashing the chip:
make BOARD=atsamr21-xpro flash

Building application default for atsamr21-xpro w/ MCU samd21.
"make" -C /home/stud/BeeGit/RIOT/cpu/samd21
"make" -C /home/stud/BeeGit/RIOT/cpu/samd21/periph
"make" -C /home/stud/BeeGit/RIOT/cpu/cortex-m0_common
"make" -C /home/stud/BeeGit/RIOT/boards/atsamr21-xpro
"make" -C /home/stud/BeeGit/RIOT/core
"make" -C /home/stud/BeeGit/RIOT/drivers
"make" -C /home/stud/BeeGit/RIOT/sys
"make" -C /home/stud/BeeGit/RIOT/sys/auto_init
"make" -C /home/stud/BeeGit/RIOT/sys/lib
"make" -C /home/stud/BeeGit/RIOT/sys/ps
"make" -C /home/stud/BeeGit/RIOT/sys/posix
"make" -C /home/stud/BeeGit/RIOT/sys/shell
"make" -C /home/stud/BeeGit/RIOT/sys/shell/commands
"make" -C /home/stud/BeeGit/RIOT/sys/timex
"make" -C /home/stud/BeeGit/RIOT/sys/uart0
"make" -C /home/stud/BeeGit/RIOT/sys/vtimer
text data bss dec hex filename
48732 2260 16748 67740 1089c /home/stud/BeeGit/RIOT/examples/adc_default/bin/atsamr21-xpro/default.elf
/home/stud/BeeGit/RIOT/boards/atsamr21-xpro/dist/flash.sh /home/stud/BeeGit/RIOT/examples/adc_default/bin/atsamr21-xpro/default.hex
Open On-Chip Debugger 0.9.0-dev-00148-g3a4ec66 (2014-09-19-10:22)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: The specified debug interface was not found (cmsis-dap)
The following debug interfaces are available:
Runtime Error: /usr/local/share/openocd/scripts/interface/cmsis-dap.cfg:7:
in procedure 'script'
at file "embedded:startup.tcl", line 58
at file "/usr/local/share/openocd/scripts/board/atmel_samr21_xplained_pro.cfg", line 5
in procedure 'interface' called at file "/usr/local/share/openocd/scripts/interface/cmsis-dap.cfg", line 7
make: *** [flash] Error 1

:-(

Do you know how i can fix this???

@LudwigKnuepfer
Copy link
Member

@thomaseichinger Maybe it makes sense to include the correctly configured version of openocd in dist?

@wiredsource
Copy link
Member

FIXED!
This was the problem:
No HIDAPI & LIBUDEV

then setting up openocd:
./configure --enable-maintainer-mode --enable-cmsis-dap --enable-hidapi-libusb

ref.
http://karibe.co.ke/2013/08/setting-up-linux-opensource-build-and-debug-tools-for-freescale-freedom-board-frdm-kl25z/

@wiredsource
Copy link
Member

@thomaseichinger

I got a working ADC now...

TODOs:

  • Refactor mania :-P --> Theres a lot of quick'n'dirty atm
  • Comply to coding convention
  • ADC extension feature
  • Documentation

@wiredsource
Copy link
Member

well now i've got an new error after disconnecting my device and reattached it....

Open On-Chip Debugger 0.9.0-dev-00148-g3a4ec66 (2014-09-19-12:50)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'cmsis-dap'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Error: unable to open CMSIS-DAP device
in procedure 'init'
make: *** [flash] Error 1

------------------------------>
Google is not my friend on this one...

I'm running vmware kubuntu 14.04 ( i know)

I have tried disconnecting/reconnecting it in vmware.

erased the device in atmel studio

dmesg:
[ 924.369050] usb 1-1: USB disconnect, device number 2
[ 1485.569981] usb 1-1: new high-speed USB device number 7 using ehci-pci
[ 1485.778852] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x84 has invalid maxpacket 64
[ 1485.778858] usb 1-1: config 1 interface 2 altsetting 0 bulk endpoint 0x5 has invalid maxpacket 64
[ 1485.786816] usb 1-1: New USB device found, idVendor=03eb, idProduct=2111
[ 1485.786821] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1485.786824] usb 1-1: Product: EDBG CMSIS-DAP
[ 1485.786826] usb 1-1: Manufacturer: Atmel Corp.
[ 1485.786828] usb 1-1: SerialNumber: ATML2127031800003561
[ 1485.812279] hid-generic 0003:03EB:2111.0004: hiddev0,hidraw0: USB HID v1.11 Device [Atmel Corp. EDBG CMSIS-DAP] on usb-0000:02:03.0-1/input0
[ 1485.812617] cdc_acm 1-1:1.1: ttyACM0: USB ACM device
[ 1485.937851] usb 1-2: new high-speed USB device number 8 using ehci-pci
[ 1486.166388] usb 1-2: device descriptor read/64, error 18
[ 1486.503139] usb 1-2: device descriptor read/64, error 18
[ 1486.830552] usb 1-2: new high-speed USB device number 9 using ehci-pci
[ 1487.060365] usb 1-2: device descriptor read/64, error 18
[ 1487.391442] usb 1-2: device descriptor read/64, error 18
[ 1487.723890] usb 1-2: new high-speed USB device number 10 using ehci-pci
[ 1487.744562] usb 1-2: Invalid ep0 maxpacket: 9
[ 1487.972014] usb 1-2: new high-speed USB device number 11 using ehci-pci
[ 1487.992518] usb 1-2: Invalid ep0 maxpacket: 9
[ 1487.996130] hub 1-0:1.0: unable to enumerate USB device on port 2

i spotted the "unable to enumerate USB device on port 2" but it should not the the port the debuggers running...?

@kYc0o
Copy link
Contributor

kYc0o commented Apr 19, 2016

Ok, I just updated the ADC work being done by another person.

@kYc0o
Copy link
Contributor

kYc0o commented Apr 19, 2016

I'll milestone too since I think we can get it fully supported for the next release

@kYc0o kYc0o added this to the Release 2016.07 milestone Apr 19, 2016
@kYc0o
Copy link
Contributor

kYc0o commented Jul 26, 2016

Didn't make it, so postponing.

@kYc0o kYc0o modified the milestones: Release 2016.10, Release 2016.07 Jul 26, 2016
@miri64
Copy link
Member

miri64 commented Oct 14, 2016

ADC, PRNG and LPM are still missing.

Is there another PRNG than #4989 on that board?

@miri64 miri64 modified the milestones: Release 2017.01, Release 2016.10 Oct 31, 2016
@OlegHahm
Copy link
Member

Anyone working on the ADC driver?

@PeterKietzmann
Copy link
Member

@immesys wanted to

@immesys
Copy link
Contributor

immesys commented Jan 15, 2017

I did some work on it, I discovered that many use cases we had required tweaking things like gain, differential sampling and whatnot, so now I have this conflict between making a simple, abstraction-compatible ADC driver and one that implements all the platform specific features. I will do my best on it, and then I may need some shepherding. Timeline is probably 3 weeks though

@PeterKietzmann PeterKietzmann modified the milestones: Release 2017.01, Release 2017.04 Jan 26, 2017
@kaspar030
Copy link
Contributor

I've checked LPM and the rng. Seems like we finally have a fully supported board!

Feel free to reopen if you disagree.

@thomaseichinger thomaseichinger removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Oct 23, 2017
@thomaseichinger
Copy link
Member Author

3 years and 1 month. 😀

Congratulations to everybody contributing and perusing this.
(FYI removed the WIP label)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

No branches or pull requests