We are facing issue of hang when powering up board and target simultaneously. We have debugged and observed that it is hanging at nxsem_wait(sem) during auto ip configuration by dhcp where waiting for offer repsonse corresponding to dhcp_request at lock nxsem_wait(sem). This lock is not getting released. So it is hanging. As per my understanding router may not be in UP state when discovery message send from board. So router will not send any IP offer message. So the above lock will keep waiting as this lock will wait as long as necessary to get the lock.
If you are waiting for the network to initialize prior to starting NuttX, then there can be a number of ways to hang or be delayed for a very long time if network is not ready when you boot. For example if the network cable is disconnected. The normal solution is simply don't way for the network to be initialized before started.
You do this by having a separate thread to perform network initialization. So when NuttX starts, this network initialization/monitor thread is also started. NuttX continues to initialize normally and the network comes up asynchronously when it is ready.
This initialization/monitor thread is useful after network initialization too. It can be configured to monitor the network down state (for example if a cable is unplugged) and can bring the network back up if the network comes up again (as when the cable is plugged in again).
This logic is at apps/netutils/netinit and can be easily configured into NSH, you can enable and configure the initialization/monitor thread through a few simple configuration settings.