> Where do you initialize the IP address? You should use the same socket > descriptor to call the ioctl to set the MAC address at that location
I am using the NuttX apps package for the moment, and specifically nsh. So I guess this code handles everything for me. But still, I believe that the MAC address and the IP address belong to different layers of the system. The IP can be handled by the application (as the user may want to do anything with it). On the other hand, the MAC address is a hard-wired address, accessed in a hardware specific way. In my opinion the application shouldn't mess with it and it is best to be set once during the hardware initialization. > I think a PR to bring out the MAC address setup function as was done for > arch/arm/src/samv7/sam_emac.c would be acceptable too. The MAC address > should be retained indefinitely after it is set once. I think that this is needed. I am willing to work on this. Στις Κυρ, 2 Αυγ 2020 στις 6:35 μ.μ., ο/η Gregory Nutt <spudan...@gmail.com> έγραψε: > > > Yes I saw this, but it does not seem a very good option to me. > > It requires you to set up the hardware in the application, and does not > > seem very efficient. > Where do you initialize the IP address? You should use the same socket > descriptor to call the ioctl to set the MAC address at that location > > I was expecting to have the hardware/board initialization routines to > > properly set-up the hardware and have it ready for usage for the > > application. > > The network won't work reliably without the network monitor at > apps/netuitils/netinit. If someone unplugs the cable, the network must > be re-initialized when the cable is plugged back in. > > Initialization and re-initialization is something may need to happen > numerous times. This is normally done in the appliction space. > > > Usually the board initialization has direct access to the low-level > drivers > > for this exact reason. > > > > Also, as I see, now the MAC peripheral has essentially to be initialized > > twice. Once with no MAC address, and again with the correct address. > > After initialization, the network is still in the DOWN state. Additional > initialization is required to set the IP address and bring the network up. > > I think a PR to bring out the MAC address setup function as was done for > arch/arm/src/samv7/sam_emac.c would be acceptable too. The MAC address > should be retained indefinitely after it is set once. > > > >