Port of RIOT on Samr21

Hi,

Thank you for your answer Thomas, Akshay. Akshay, which part are you working on then?

Thomas, I’m looking at the uart.c that you wrote. Why did you only develop one UART? After reading the datasheet, I see that the samd21 has got 5 SERCOM which can be used by USART, I2C, SPI and LIN slave. With RIOT, we can set 4 USART and 4 I2C. How do we proceed with the 5 SERCOM? You chose PIN_PA04 and PIN_PA05 for UART 0. Which one should I use for UART 1,2,3? And Atmel chose to define I2C on PIN_PA16 and PIN_PA17, on which pin will be the following I2C?

Best,

Hi Baptiste,

Thomas, I'm looking at the uart.c that you wrote. Why did you only develop one UART?

The intention was to get preliminary support for this board fast. For this I chose to implement one UART using one SERCOM. It can be seen as prototype and be applied to additional SERCOMs if needed.

After reading the datasheet, I see that the samd21 has got 5 SERCOM which can be used by USART, I2C, SPI and LIN slave. With RIOT, we can set 4 USART and 4 I2C. How do we proceed with the 5 SERCOM?

I’d suggest we take one SERCOM for SPI (needed for the radio device) and one for I2C to provide an example implementation for someone interested into this board. How many of each of them (SPI,I2C,USART) one would actually use later could then be configured via periph_conf.h by adopting to individual needs. One could say I don’t need an USART I’ll take the spare SERCOM to physically connect another SPI device or similar.

You chose PIN_PA04 and PIN_PA05 for UART 0. Which one should I use for UART 1,2,3? And Atmel chose to define I2C on PIN_PA16 and PIN_PA17, on which pin will be the following I2C?

For this we’d have to consult the multiplexing table in the Atmel data sheet p. 12. There are not too many possible combinations.

Currently I’m busy developing sensor drivers for the iot-lab_M3 for a demo we give beginning of November. When these are done the samr21 will get some more love again. :slight_smile:

Best, Thomas

Thanks a lot! So I’m going to let uart.c like this and begin I2C.c right now.

Best,

Hi,

Thank you for your answer Thomas, Akshay. Akshay, which part are you working on then?

I am creating support for the SAMD21-XPRO. I will start working on the SPI which can be used by the SAMR21 as well.

-Akshay