'unable to obtain IP address via DHCP'
If you try 100 times, it seems to have succeeded once.
I do not know how.
I tried in BCM943364WCD1 board with STA interface and external DHCP server and it appears to work fine. Can you try to debug the application and check the point where it fails?
If it fails kindly go closer to the AP and try again.
Retrieving data ...