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

stm32f46_79x/stm32_svd-ethernet.ads: definitions for MAC addresses #50

Closed
ghost opened this issue Sep 5, 2016 · 3 comments
Closed

stm32f46_79x/stm32_svd-ethernet.ads: definitions for MAC addresses #50

ghost opened this issue Sep 5, 2016 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 5, 2016

I'm a bit confused by this. I'd be grateful for any pointers. The file stm32_svd-ethernet.ads defines the MAC address in two halves. For example:

MACA0HR at 64 range 0 .. 31;
MACA0LR at 68 range 0 .. 31;
MACA1HR at 72 range 0 .. 31;
MACA1LR at 76 range 0 .. 31;
MACA2HR at 80 range 0 .. 31;
MACA2LR at 84 range 0 .. 31;
MACA3HR at 88 range 0 .. 31;
MACA3LR at 92 range 0 .. 31;

So each is a 32 bit word.

They are later set as, for example:

MAC2AH : MACA2HR_MAC2AH_Field := 16#FFFF#;

The problem I've got is that a MAC address is of the form:

hh:hh:hh:ll:ll:ll

eg:

01:23:45:67:89:ab

In other words, it's made up of six bytes. The definition in the file is, of course, for four bytes, two sixteen bit words.

Shouldn't the correct form be, for example:

MAC0AH : MACA0HR_MAC0AH_Field := 48#FFFFFF#;
MAC0AL : MACA0LR_MAC0AL_Field := 48#FFFFFF#;

So that, for the above example, it'd be set as:

MAC0AH : MACA0HR_MAC0AH_Field := 48#012345#;
MAC0AL : MACA0LR_MAC0AL_Field := 48#6789ab#;

@ghost
Copy link
Author

ghost commented Sep 5, 2016

I should probably say that I'd be equally happy, at this stage, if I could set a fixed MAC and IP address. I don't need to use DHCP.

@Fabien-Chouteau
Copy link
Member

Look closer at the definition, MACxHR are not only 32 bits words, they are record with

   subtype MACA0HR_MACA0H_Field is HAL.Short;

   --  Ethernet MAC address 0 high register
   type MACA0HR_Register is record
      --  MAC address0 high
      MACA0H         : MACA0HR_MACA0H_Field := 16#FFFF#;
      --  unspecified
      Reserved_16_30 : HAL.UInt15 := 16#10#;
      --  Read-only. Always 1
      MO             : Boolean := False;
   end record

So MACA0LR (4 bytes) plus MAC0HR.MACA0H (2 bytes) give you 6 bytes.

The definition of theses registers looks good, so I'm closing this issue.

Regards,

@ghost
Copy link
Author

ghost commented Sep 5, 2016

Thank you - that makes sense!

On 5 September 2016 at 19:02, Fabien Chouteau notifications@github.com
wrote:

Look closer at the definition, MACxHR are not only 32 bits words, they are
record with

subtype MACA0HR_MACA0H_Field is HAL.Short;

-- Ethernet MAC address 0 high register
type MACA0HR_Register is record
-- MAC address0 high
MACA0H : MACA0HR_MACA0H_Field := 16#FFFF#;
-- unspecified
Reserved_16_30 : HAL.UInt15 := 16#10#;
-- Read-only. Always 1
MO : Boolean := False;
end record

So MACA0LR (4 bytes) plus MAC0HR.MACA0H (2 bytes) give you 6 bytes.

The definition of theses registers looks good, so I'm closing this issue.

Regards,


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AESqR0B7f5GqzCntyW1E1wQZu34Ly2rzks5qnEsggaJpZM4J09GE
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant