1 2 Previous Next 22 Replies Latest reply on Jun 3, 2016 2:04 PM by wartix_fr Branched to a new discussion.

    How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool

    chucklink

      The Particle.io Photon is the perfect evaluation tool for the WM-N-BM-09.  When used along with the Particle.io "Programmer Shield", it is possible to have a nearly complete development environment similar to the WICED BCM943362WCD4_EVB.  Based upon what I've seen, you probably need an external antenna to get acceptable RF performance.  Also, be aware that for some reason Broadcom does not include a profile anymore.  More on that at the bottom.

       

      Setting up Particle.io Photon to support WICED Tools:

       

       

      1. Modify FT2232 93C46 to look like a Broadcom profile as per this site:

         

      https://community.broadcom.com/community/wiced-wifi/wiced-wifi-forums/blog/2015/08/13/wiced-ftdi-chip-programming-2-via-script

       

      There is a ZIP file at the bottom of the page to get the command line tools for Windows. (Sorry MAC guys…)

       

      I verified the profile by using the GUI version of FT_PROG.  I tried to use the GUI version of FT_PROG by first extracting the "Template" from my EVB, but the GUI version of FT_PROG inserted a serial number when it reprogrammed the "Programmer Shield" from Particle.io.  I am not sure this would affect operation, but it did create unique device names in my /dev directory of OS X, and I just wanted to plug it in and go, without playing with different things.

       

       

       

      1. Bring up a session to modify write protected flash blocks.  I use OS X so this was done on the MAC.  A warning to all:  This will allow you to wipe your Photon clean.  If you have dreams of going backward, then you probably will need to save the image and reverse the process.  I don't care about that so I did not figure it out.

       

       

       

      ./openocd-all-brcm-libftdi -f BCM9WCD1EVAL1.cfg -f stm32f2x.cfg -c "gdb_port 3334"

       

      Note that I shortened the path names for the "BCM9WCD1EVAL1.cfg" and "stm32f2x.cfg" for clarity.

       

      $  telnet localhost 4444

       

      This is interesting because I just assigned the gdb_port to 3334, but when I used 4444 in the first step, openOCD responded with an error saying the port was in use.  Just go with it.

       

      Trying ::1...

      telnet: connect to address ::1: Connection refused

      Trying 127.0.0.1...

      Connected to localhost.

      Escape character is '^]'.

      Open On-Chip Debugger

      > flash info 0

      device id = 0x20036411

      flash size = 1024kbytes

      #0 : stm32f2x at 0x08000000, size 0x00100000, buswidth 0, chipwidth 0

      #  0: 0x00000000 (0x4000 16kB) protected

      #  1: 0x00004000 (0x4000 16kB) not protected

      #  2: 0x00008000 (0x4000 16kB) not protected

      #  3: 0x0000c000 (0x4000 16kB) not protected

      #  4: 0x00010000 (0x10000 64kB) not protected

      #  5: 0x00020000 (0x20000 128kB) protected

      #  6: 0x00040000 (0x20000 128kB) protected

      #  7: 0x00060000 (0x20000 128kB) protected

      #  8: 0x00080000 (0x20000 128kB) protected

      #  9: 0x000a0000 (0x20000 128kB) not protected

      # 10: 0x000c0000 (0x20000 128kB) not protected

      # 11: 0x000e0000 (0x20000 128kB) not protected

      STM32F2xx - Rev: X

       

      > flash protect 0 0 11 off

      cleared protection for sectors 0 through 11 on flash bank 0

      > exit

       

      1. Your Photon is now completely programmable and can be used as an evaluation tool for the WM-N-BM-09 and almost ready for your WICED SDK environment.   But because there is not a profile in the current SDK for the WM-N-BM-09, you'll need to create that.  I started with this page: https://community.broadcom.com/thread/2707 

        But this is a bit dated and you'll want something for the latest SDK's.  I've included a file, but the only real change is as per the above thread.  As per the thread…giving credit to those that figured it out before I tried, change two entries in the "platform.c" file of the "BCM943362WCD4" platform.c file.  Note that you don't want to actually change the "platforms/BCM943362WCD4/platform.c" file.  I created a new profile for the "BCM9WCDUSI09" as per the previous thread.  I ended up basically replicating and changing the names where necessary to set up a new platform.  Note that this platform works well on the "WICED-SDK-3.4.0-AWS" SDK.

       

      1. Create a target for testing.  I created the proverbial Broadcom "hello world".  That is "snip.scan-BCM9WCDUSI09 download run".

       

       

      There you have it.  I will credit other threads for the heavy lifting and the only new finding is the need to clear the "protected" flags to enable OpenOCD to rewrite the flash from the beginning.

        • 2. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
          jone_yi_1844281

          Thanks Charles,

           

          I think there are an easy way to let Photon to recognizer as WM-N-BM-09 EVB!

          Modified the tools/OpenOCD/BCM9WCD1EVAL1.cfg by add new VID/PID pair after ft2232_vid_pid as below


          was --

          ft2232_vid_pid 0x0a5c 0x43fa

          is ---

          ft2232_vid_pid 0x0a5c 0x43fa 0x0403 0x6010 


          It work on SDK 3.3.1!

           


           

          • 3. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
            sunnyazoi

            Hi Chucklink,

             

            I have a Particle.io's Photon.

             

            I also want to evaluate the Photon as a WM-N-BM-09 evaluation tool.

             

            But by following your steps, can I get AT Command support directly ?

             

            Like currently, USI provides AT Commands supported Firmware. So by following your steps, can I get the AT Commands support ?

             

            Also, will I get MQTT Support ?

             

             

            Thanks,

            Sunny

            • 4. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
              chucklink

              Sunny,

              I was unaware that USI had an AT Command set. I am programming using the WICED SDK.  I am very deep into my application and I've not even looked to see if the WICED SDK has an "AT" command code sample.  However, the Photon solution as an evaluation tool is very similar to Broadcom's BCM943362WCD4_EVB and maybe just a little more versatile.  When using the Photon solution, you have access to the FT2232 flash programming (JTAG) interface as well as a USB virtual COM port to access the Serial Port of the Photon.  This is thru the USB connector on the "shield".  This provides the exact same interface as the Broadcom eval board.  There is still the USB connector connected directly to the STM32F205 USB interface on the Photon board itself.  The WM-N-BM-09 does have two serial ports, but the second one is only partially available on the Photon and is completely missing from Broadcom's eval board.  It could be that the "AT" interface is implemented on that serial port but I doubt it.  My application uses MQTT and yes, the Photon eval board works quite well using MQTT on it.  I have found that the Photon is very stable (as is the Broadcom platform).  I've written a massive application and leveraged Broadcom's SDK MQTT, setup, security and a couple of other modules and I am extremely pleased with what I get from the solution.  I have not had any issues with hardware.  I hope I can get my product launched before the WM-N-BM-09 ceases production.  I'm close.  WICED works the way product development should work.

               

              Good Luck,

              Chuck

              1 of 1 people found this helpful
              • 5. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                mifo

                A simple AT command interface is not directly supported within the WICED SDK.  However, this is one of the many areas where out module partners like Zentri and LSR (they use JSON vs. AT) add value.

                 

                ndutton jhaedt

                • 6. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                  sunnyazoi

                  Hi Chuck,

                   

                  Thanks a lot for your info.

                  • 7. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                    sunnyazoi

                    Hi mwf_mmfae,

                     

                    Are you aware of modules that supports AT Commands + MQTT ?

                    • 8. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                      mifo

                      Zentri has developed a module that supports both.

                       

                      Cloud MQTT Demo

                       

                      ndutton and jasonrc can help, but you should probably discuss in their partner forum.

                      • 9. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                        ndutton

                        sunnyazoi - certainly we can help you out here.... I will ping you offline so you can tell me directly what you are looking for privately.

                        • 10. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                          wartix_fr

                          Thank you for this !
                          I succeed to upload the aws_iot demo to the board.

                           

                          However I think I miss one step to get it working.
                          Do I have to modify something to use the wireless available on the photon ?

                           

                          Here is what I got from the console.

                          Starting WICED v3.5.2

                          Platform BCM943362WCD4 initialised

                          Started ThreadX v5.6

                          Initialising NetX_Duo v5.7_sp2

                          Creating Packet pools

                           

                          With the default snip.scan demo I can't see any wifi as well

                          Starting WICED v3.5.2

                          Platform BCM943362WCD4 initialised

                          Started ThreadX v5.6

                          Initialising NetX_Duo v5.7_sp2

                          Creating Packet pools

                          Waiting for scan results...

                            # Type  BSSID             RSSI  Rate Chan  Security         SSID

                          ----------------------------------------------------------------------------------------------

                          What step do I need to take to get this working ?

                           

                          Thank you

                           

                          P.S.: I got a programmer shield from Particle with a photon linked to it.

                          • 11. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                            chucklink

                            I recall that one of the Photons had an RF sensitivity problem and would not receive anything unless the hotspot was in the room.  I did run the old scan code in the Photon and it worked great, but I am currently developing my product and have not run the new 3.5.2 scan code, although I am developing on the 3.5.2 SDK and it does run fine on the Photon.  Make sure your hotspot is nearby and operating on 2.4 GHz.

                             

                            Let me check.  It won't take long.

                            Best Regards,

                            Chuck

                            • 12. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                              wartix_fr

                              I got the hotspot 1 meter away. It's a Hootoo Tripmate.

                              I also plug a flex antenna on the photon.

                               

                              Do we have to provide a profile dedicated to the photon or something similar ?

                              • 13. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                                chucklink

                                OK, I ran it and it ran fine, this is the output from the compiler and the console in a single text file.  Sorry it is so long.

                                **** Build of configuration Default for project WICED-SDK-3.5.2 ****

                                 

                                make snip.scan-BCM9WCDUSI09 download run

                                MAKEFILE MAKECMDGOALS=snip.scan-BCM9WCDUSI09 download run OTA2_SUPPORT is disabled

                                Making config file for first time

                                +-----------------------------------------------------------------------------------------------------+

                                | IMPORTANT NOTES                                                                                     |

                                +-----------------------------------------------------------------------------------------------------+

                                | Wi-Fi MAC Address                                                                                   |

                                |    The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

                                |    Ensure each target device has a unique address.                                                  |

                                +-----------------------------------------------------------------------------------------------------+

                                | MCU & Wi-Fi Power Save                                                                              |

                                |    It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

                                |    reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

                                |    Application Note located in the documentation directory if you plan to use powersave features.   |

                                +-----------------------------------------------------------------------------------------------------+

                                MAKEFILE MAKECMDGOALS=snip.scan-BCM9WCDUSI09 download run OTA2_SUPPORT is disabled

                                Building Bootloader

                                Finished Building Bootloader

                                 

                                Processing resources

                                Creating security credentials

                                Making DCT image

                                Compiling App_Scan

                                Compiling Platform_BCM9WCDUSI09

                                Compiling WICED

                                Compiling Lib_SPI_Flash_Library_BCM9WCDUSI09

                                Compiling WWD_ThreadX_Interface

                                Compiling WICED_ThreadX_Interface

                                Compiling WWD_for_SDIO_ThreadX

                                Compiling Supplicant_BESL

                                Compiling Lib_DNS

                                Compiling NetX_Duo

                                Compiling Lib_Wiced_RO_FS

                                Compiling STM32F2xx

                                Compiling Lib_TLV

                                Compiling Lib_base64

                                Compiling Lib_crypto_open

                                Compiling Lib_micro_ecc

                                Compiling WWD_NetX_Duo_Interface

                                Compiling WICED_NetX_Duo_Interface

                                Compiling common_GCC

                                Compiling STM32F2xx_Peripheral_Drivers

                                Compiling Lib_Ring_Buffer

                                Compiling Lib_crc

                                Compiling Lib_DHCP_Server

                                Compiling Lib_Linked_List

                                Compiling STM32F2xx_Peripheral_Libraries

                                Making build/snip.scan-BCM9WCDUSI09/libraries/App_Scan.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Platform_BCM9WCDUSI09.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WICED.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_SPI_Flash_Library_BCM9WCDUSI09.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WWD_ThreadX_Interface.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WICED_ThreadX_Interface.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WWD_for_SDIO_ThreadX.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Supplicant_BESL.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_DNS.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/NetX_Duo.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_Wiced_RO_FS.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/STM32F2xx.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_TLV.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_base64.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_crypto_open.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_micro_ecc.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WWD_NetX_Duo_Interface.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/WICED_NetX_Duo_Interface.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/common_GCC.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/STM32F2xx_Peripheral_Drivers.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_Ring_Buffer.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_crc.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_DHCP_Server.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/Lib_Linked_List.a

                                Making build/snip.scan-BCM9WCDUSI09/libraries/STM32F2xx_Peripheral_Libraries.a

                                Making snip.scan-BCM9WCDUSI09.elf

                                 

                                Making snip.scan-BCM9WCDUSI09.bin

                                snip.scan-BCM9WCDUSI09

                                ----------------------------------|---------|---------|

                                                                  |         |  Static |

                                              Module              |  Flash  |   RAM   |

                                ----------------------------------+---------+---------|

                                App                               |     395 |       8 |

                                crc                               |    1060 |       0 |

                                Host MCU-family library           |   11690 |    2737 |

                                Interrupt Vectors                 |     388 |       0 |

                                libc                              |   23531 |    3064 |

                                Networking                        |     941 |    8455 |

                                NetX-Duo - Interfaces & Stacks    |       0 |      16 |

                                Other                             |    3518 |      92 |

                                Packet Buffers                    |       0 |   23086 |

                                platform                          |    1024 |     168 |

                                RAM Initialisation                |    2316 |       0 |

                                resources                         |      16 |       0 |

                                Ring_Buffer                       |      92 |       0 |

                                Startup Stack & Link Script fill  |      12 |       7 |

                                ThreadX                           |    7668 |     396 |

                                TLV                               |      28 |       0 |

                                Wi-Fi Firmware                    |  210624 |       0 |

                                WICED                             |    3603 |     956 |

                                WWD                               |   13430 |    3003 |

                                ----------------------------------+---------+---------|

                                TOTAL (bytes)                     |  278020 |   41988 |

                                ----------------------------------|---------|---------|

                                 

                                Downloading Bootloader 4 ...

                                No changes detected

                                 

                                Download complete

                                 

                                Finished Downloading Bootloader

                                Downloading DCT ...

                                Download complete

                                 

                                Downloading Application ...

                                Download complete

                                 

                                Resetting target

                                Target running

                                Build complete

                                Making .gdbinit

                                 

                                 

                                CONSOLE OUTPUT

                                 

                                 

                                 

                                 

                                Starting WICED v3.5.2

                                Platform BCM9WCDUSI09 initialised

                                Started ThreadX v5.6

                                Initialising NetX_Duo v5.7_sp2

                                Creating Packet pools

                                WWD SDIO interface initialised

                                WLAN MAC Address : 6C:0B:84:59:35:E0

                                WLAN Firmware    : wl0: Oct 22 2015 15:05:09 version 5.90.230.15 FWID 01-d668e8d2

                                Waiting for scan results...

                                  # Type  BSSID             RSSI  Rate Chan  Security         SSID

                                ----------------------------------------------------------------------------------------------

                                  0 Infra E8:8D:28:5F:3C:35  -82 216.7    1  WPA2 AES   PSK         Link Home

                                 

                                 

                                Scan complete in 1297 milliseconds

                                Waiting for scan results...

                                  # Type  BSSID             RSSI  Rate Chan  Security         SSID

                                ----------------------------------------------------------------------------------------------

                                  0 Infra E8:8D:28:5F:3C:35  -80 216.7    1  WPA2 AES   PSK         Link Home

                                 

                                 

                                Scan complete in 1452 milliseconds

                                Waiting for scan results...

                                  # Type  BSSID             RSSI  Rate Chan  Security         SSID

                                ----------------------------------------------------------------------------------------------

                                  0 Infra E8:8D:28:5F:3C:35  -79 216.7    1  WPA2 AES   PSK         Link Home

                                 

                                 

                                Scan complete in 1452 milliseconds

                                Waiting for scan results...

                                  # Type  BSSID             RSSI  Rate Chan  Security         SSID

                                ----------------------------------------------------------------------------------------------

                                  0 Infra E8:8D:28:5F:3C:35  -78 216.7    1  WPA2 AES   PSK         Link Home

                                 

                                 

                                Scan complete in 1373 milliseconds

                                Waiting for scan results...

                                  # Type  BSSID             RSSI  Rate Chan  Security         SSID

                                ----------------------------------------------------------------------------------------------

                                  0 Infra E8:8D:28:5F:3C:35  -79 216.7    1  WPA2 AES   PSK         Link Home

                                1 of 1 people found this helpful
                                • 14. Re: How to use Particle.io's Photon as a WM-N-BM-09 evaluation tool
                                  chucklink

                                  I just looked at what I have and the only thing special for this is the BCM9WCDUS109 platform files.  I am guessing you have the correctly modified versions of that because you could not compile.  Snip-Scan does not have any special changes.  Did you check the Photon before you started?  It sounds to me like something is wrong with it.   I disconnect my router and I see what you see plus:

                                   

                                   

                                  Scan complete in 1297 milliseconds

                                   

                                  Are you seeing that message above?

                                  1 2 Previous Next