drivers: add driver for the AT24MAC unique ID chip#12746
drivers: add driver for the AT24MAC unique ID chip#12746benpicco merged 4 commits intoRIOT-OS:masterfrom
Conversation
|
Hmm. The EUI-48 the test printed for your chip has the group flag set. This seems strange to me. |
|
Uh you are right - and it should also start with |
|
I should read more carefully: the data sheet says
So AT24MAC402 provides an EUI-48 and AT24MAC602 provides an EUI-64 address. |
|
Yes main(): This is RIOT! (Version: 2020.01-devel-767-g8836f-at24mac) Reads correct EUI64. |
|
I think it would be quite possible to have a board with both flavours of EUI chips added. That would be better handled by returning e.g. Maybe it is easier to simply always provide both functions. With the new |
|
Would be nice to get rid of the ifdefs yes. From what I see there is no chip id. So we can't see if it's a 48 or 64 chip. |
|
Just a comment. Maribu traced an invalid eiu48 format.
We see the eui64 read returns the correct vendor 24 bit OUI |
It's not guaranteed the OUI will always be from Atmel. The data sheet even says
|
|
Yes that's correct. Never come across any though. So maybe your first approximation is straight-forward and enough.. |
Instructions unclear, added a |
|
I tested and it works! Code looks clean but I'm not qualified with the RIOT machinery yet. And radio driver can later check what to use for eui? |
|
Hi, One way to provide address to the radio module Simple but has some drawbacks: Adds ifdef's and does not support different instances of at24mac chip. I think we can assume we'll need the eui64 address/call? Did you have any other ideas? Stuff into luid_get()? |
f9cf0f6 to
853a117
Compare
c864784 to
00950fb
Compare
|
After setting the right I2C address, the test was working fine on SAME54-XPRO: |
aabadie
left a comment
There was a problem hiding this comment.
Almost good, but there's a remaining nit. You can squash directly.
The AT24MAC is an EEPROM that provides unique ID functionality. On one address it provides normal AT24xxx EEPROM operations, but on a seperate i2c address a read-only EUI-64 and a 128-bit ID are provided. This adds a simply driver for this chip.
aabadie
left a comment
There was a problem hiding this comment.
All good and tested.
ACK
|
Thanks for fixing this. |
|
Huh, that's odd - I'm getting |
|
Hmm you're right. With fresh clone. It's correct.
Thought I could handle git. A fresh pull and no diffs but must have some untracked files playing jokes. Sorry. But happy. BTW the HW EUI64 is not yet reflected i the networking code. Right? |
Good to hear :)
Unfortunately not. |
Contribution description
The AT24MAC is an EEPROM that provides unique ID functionality.
On one address it provides normal AT24xxx EEPROM operations (#11929), but on a separate I2C address a read-only EUI-48 or EUI-64 and a 128-bit ID are provided.
This adds a simply driver for this chip.
Since the driver has no state and will only read a single, read-only memory location, I chose to depart a bit from the common RIOT driver pattern.
There is no
init()function (since nothing needs to be initialized), but theat24mac_get_xxx()functions will take the index in theat24mac_params[]array.This way it can be directly mapped to the proposed interface indices.
Testing procedure
Run
tests/driver_at24mac.For me this prints
avr-rss2
same54-xpro
Issues/PRs references
#12641