element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
STM32F4DISCOVERY Expansion Boards
  • Products
  • Dev Tools
  • STM32F4DISCOVERY Expansion Boards
  • More
  • Cancel
STM32F4DISCOVERY Expansion Boards
Forum STM32F4DIS-WIFI - no output from the wifi module
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
STM32F4DISCOVERY Expansion Boards requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 21 replies
  • Subscribers 10 subscribers
  • Views 2362 views
  • Users 0 members are here
  • stm32f4dis_wifi
  • stm32f4discovery
Related

STM32F4DIS-WIFI - no output from the wifi module

roli
roli over 11 years ago

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.

  • Sign in to reply
  • Cancel

Top Replies

  • roli
    roli over 11 years ago in reply to roli +1 verified
    Got it. F*** IAR. It was their printf redirect that was making things not work as they should. I redirected that stream to a simple character array instead and what do you know... everything showed up…
Parents
  • aleirlan
    0 aleirlan over 11 years ago

    If you tell me your email , i send you the missing  libraries.

    My email is a.marchesano@hotmail.it

     

    Alessandro



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to aleirlan

    Thanks! I've sent you an email.

     

    But I don't think the problem is in those missing libraries. As far as I can understand those are for the high level IP stuff not for the actual wifi module communication. I find it weird that I can connect to a wifi network but I can't get a simple status out of it (or scan results).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to roli

    I am really getting annoyed by this thing. As expected using the real RTL.h file instead of my substitute didn't make any difference.

     

    But I did a bit more debugging. I checked the actual USART receiving code. When I make a status request/wifi scan I only get 1 byte of data from the module and nothing more. So the communication is obviously working since I can get the module to connect to a network but the module simply isn't sending data back. There is a firmware update bin in the downloaded software and I haven't tried flashing that onto the module yet. And I am not sure if I want to try it because the documentation doesn't tell you anything about what that thing does.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    I used mkd5-lite and downloaded the older library files that came with mdk4 (the version used for older demo source) - its was titled MDK ARM7/9 Device Support V5.00u1 -equivalent to MDK-ARM 4.73

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    I used mkd5-lite and downloaded the older library files that came with mdk4 (the version used for older demo source) - its was titled MDK ARM7/9 Device Support V5.00u1 -equivalent to MDK-ARM 4.73

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • roli
    0 roli over 11 years ago in reply to Former Member

    But is it working properly? As I mentioned before I highly doubt that the problem is with the toolchain. As far as I know that library is only used for a few constants/simple functions in the actual TCP/UDP communication. It has nothing to do with the more low-level functionallity (as far as I know).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    yes it all worked fine out of the box

    I am actually writing code for the SN8200 unit itself using WICED 2.4.0 from broadcom & olimex openocd JTAG - it serves my purposes better than SNIC and an external processor.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to Former Member

    Interesting. Although I wouldn't be surprised if IAR was to blame for the lack of functionallity. Their debugger/compiler/linker sometimes does the wierdest things possible.

     

    But I am sadly stuck with IAR since this is a university project and I don't have that much time to finish this.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    well I would download the mdk5 just to check if out - its a free download.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to Former Member

    You are right. I am downloading it right now. Another question - does MDK have anything similar to IAR's implementation debug console? Something that would eliminate the need to use external UART-USB adapter and basically transfers anything written with printf to the that debug console?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    not sure but stdio is usually easy to redirect in a header or define to a selected com channel. I am hitting the sack for the night. check the help files.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to Former Member

    Well I've finally tried it today. MDK-ARM is frustrating as *** (and I though IAR was bad) - although it does look nicer and would probably be better if I was used to it. But I did lose my mind trying to redirect printf to the "printf viewer". So I connected an arduino board (without the chip of course) to the USART3 as the example said. And it worked. So the module is ok. It's the code that isn't. I'm going to check that printf redirect in IAR. It could be it's fault.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roli
    0 roli over 11 years ago in reply to roli

    Got it. F*** IAR. It was their printf redirect that was making things not work as they should. I redirected that stream to a simple character array instead and what do you know... everything showed up. I am still not sure how the printf redirect could be working only partially.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to roli

    Hey,

     

    I have the same problem. On a different project I got the printf to work with IAR by enabling all the libraries (full) in the option settings. However it is asking for the function "htons". Any idea?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Former Member

    I believe "htons" is in keil  library rlt.h

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube