I have just bought the STM32F4DIS-WIFI today and I have some problems getting it to work on my STM32F4 discovery board. The included example is for the MDK-ARM only and I had some trouble building parts of it (mainly the sn8200_core and sn8200_api files) with IAR. I fixed the problem by commenting out the #include <rtl.h> (I believe it's part of the MDK-ARM) and replacing it with this code:
#define INADDR_ANY ((unsigned long int) 0x00000000) #define INADDR_NONE ((unsigned long int) 0xffffffff) #define htonl(l) lswap(l) #define htons(s) ((unsigned int)(((unsigned int)(s) >> 8) | ((unsigned int)(s) << 8))) #define ntohl(l) lswap(l) #define ntohs(s) htons(s)
I got the code to compile by doing this but it doesn't appear to be working. This is my main function:
void main() { //wifi init SN8200_API_Init(921600); WifiOn(seqNo++); GetStatus(seqNo++); WifiScan(seqNo++); WifiDisconn(seqNo++); WifiJoin(seqNo++); SnicInit(seqNo++); SnicIPConfig(seqNo++); while(1) {} }
I didn't use any DBGBU and other functions (and I don't have anything connected to the USART3). IAR provides printf/scanf functions that work with the included debug console so I didn't see any need for that part of the code.
The problem that I am having is this: I get no input from the module. For instance the GetStatus function - I get the -GetStatus but not the actual status. The same goes for wifi scan. I never get the actual list of available SSIDs. I can actually disconnect and join the network though. If I enter my SSID, security mode and password then the module connects to the wifi network as expected. So apparently it is geting the data from the board. But I am not sure why I am not getting anything from the module.