This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3100MODBOOST: Interfaced with stm32f1 controller via UART

Part Number: CC3100MODBOOST
Other Parts Discussed in Thread: CC3100, , CC3100SDK

I am working on CC3100 wifi module interfaced with STM32F1 controller via UART.I tried to configure the module to communicate with UART, I need to set the module in either AP mode or Station mode.But in my module was set in "UNKNOWN STATE" while debugging.I have included an API of sl_Start(0,0,0) function, Could someone please provide me hint how to proceed further?

  • Hi Pradeepa,

    Can you include a screenshot of the "UNKNOWN STATE" error you see? Have you followed the instructions in the CC3100 & STM32F4 bringup guide?

     4606.CC3100 & STM32F4 Bringup Guide.pdf

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your valuable support ! Already I referred this document which you have given for me to refer.Based on this,I can able to connect the cc3100 module in Station mode or AP mode by SPI Interface.But I need to do in UART interface. Based on SPI, I have implemented for UART also. I don't Know, where I made a mistake?

    Can you please guide me, How to proceed further?

  • Hi Pradeepa,

    We only provide the implementation for the SPI interface; however, it is possible to use the UART interface as well. We used to have documentation on this topic, but the site no longer exists (see this thread). I will look to see if I can find it internally.

    You may also find the Host Driver API's helpful.

    Thanks,
    Jacob

  • Hi Pradeepa,

    I found the documentation pages that may help guide your UART interface with the host driver. Please see these attachments.

    CC3100 Host Interface - Texas Instruments Wiki.pdf

    CC3100 SPI Host Interface - Texas Instruments Wiki.pdf

    CC3100 UART Host Interface - Texas Instruments Wiki.pdf

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response.I referred the above document which you have suggested.while debugging, After _SlNonOsRetVal_t _SlNonOsSemGet( )function, debugger entered in to Error handler( ) function.Can you please guide me, How to proceed further?

  • Hi Pradeepa,

    Which RTOS are you using? It looks like your application fails when it tries to create a semaphore, which is usually associated with an RTOS.

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response. we didn't use any RTOS. In sl_start( ) API, Before this {"retVal= _SlDrvSyncObjWaitTimeout( ) "}function ,the value of retVal is -120 while debugging,After that,it will be set in "Unknown State".Further if we proceeded debugging,it get stucked into UART_WaitOnFlagUntilTimeout( ),after that debugger entered in to Error Handler( ) function.

    Having some queries in the "UART INTERFACE OF WIFI Module.". Can you share the technical person mail id or your's mail id and will requesting for the one small meeting to clarify and it will more helpful to work faster.

  • Hi Pradeepa,

    The -120 error is "SL_ERROR_DOMAIN_NAME_INVALID." 

    Can you share a logic analyzer capture of the UART lines (RX, TX, RTS, CTS)?

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your valuable response. Here I have attached the waveform of UART Lines (TX,RX,RTS,CTS),Along with, I have attached the waveform of NHIB (Hibernate) and IRQ (Interrupt) pins of CC3100 Wifi module.

    In this above waveform, Indicated the UART lines (Zoomed In).

    This second waveform,Indicated the same UART lines (Zoomed out).

    In this above waveform, Channel_4 for IRQ pin,Channel_5 for NHIB pin.

    Thanks & Regards,

    Pradeepa.

  • Hi Pradeepa,

    I'll follow up here tomorrow.

    Best,
    Jacob

  • Hi Pradeepa,

    Very sorry for the delay. In the above waveforms, are these the UART waveforms from the STM32F1 host? It does not look like RTS is ever set low to enable the CC3100 to begin communicating with the host. This is what the UART communication should look like:

      

    Is something pulling the RTS pin high? What have you changed in software to enable UART communication between the STM32F1 and the CC3100?

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response. I have created a separate header file for UART like uart.c and .h file.In this file, four function were Implemented.

    1. uart_Open( ) --> Initialize the UART, Disable the CC3100.

    2. uart_Close( ) --> Deinitialize the UART, Disable the CC3100 Interrupt.

    3. uart_Read( ) --> Receive the data using HAL Library uart function.

    4. uart_Write( ) --> Transmit the data using HAL Library uart function.

    This above function executed after the sl_open() function in sl_Start() API.This is What I have changed in software to enable UART communication between the STM32F1 and the CC3100.

  • Hi Pradeepa,

    I think there is one more function you need: uart_IRQ. This enables an interrupt routine for the Host IRQ:

    Referring to your above UART captures, the IRQ line should be active high. During initialization, the nHIB is asserted while nRESET is kept high. It is at this time when the HSOT_IRQ line should be driven low by the device until initialization is complete. During initialization and until HOST_IRQ is asserted for the first time, it is important that the host does not communicate with the device. Otherwise, a proper connection may not be established. Please see more details in the CC3100 Host Interface Guide (attached above).

    nHIB Timing: 

    It looks like your nHIB pin above is asserted, but the HOST_IRQ line is always low. It should be high at first, then driven low by the device.

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your valuable response. Here I have attached the waveform.The CC3100 module can able to transmit the data. But the STM32F1 controller could not received the data. While debugging, It entered in to Error Handler() function.The waveform which we captured is similar to waveform which you have sent. Can you please guide me, How t proceed further?. May be the problem occurred in UART Interface.

    Thanks & Regards,

    Pradeepa

  • Hi Pradeepa,

    I'll follow up tomorrow.

    Thanks,
    Jacob

  • Hi Pradeepa,

    Apologies, I need one additional day to respond.

    Thanks,
    Jacob

  • Hi Pradeepa,

    It looks like your nHIB pin above is asserted, but the HOST_IRQ line is always low. It should be high at first, then driven low by the device.

    I think I may have confused you in an earlier quote, I apologize. I believe HOST_IRQ should be active low, then driven high. Please refer to the CC3100 UART Host Command Flow graphic I shared. 

    Additionally, your CC3100 RTS line should be active low as well. Can you drive those pins and post another UART logic analyzer trace? Also, what baud rate are you using to communicate between the two devices?

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your valuable response. Here I have attached the logic analyzer waveform of UART interface of CC3100 module with STM32F1 controller. While 

    debugging the code, the debugger entered into UART_WaitOnFlagUntilTimeout( ) function.After that, It getting into an Error Handler() function. Can you

    please guide me, How to proceed further?...It will be very helpful to work faster.

    Thanks & Regards,

    Pradeepa

  • Hi Pradeepa,

    I'll comment on this tomorrow.

    Thanks,

    Jacob

  • Hi Pradeepa,

    When does the UART_WaitOnFlagUntilTimeout( ) error get generated? Does sl_Start return successfully?

    Regarding UART communication on the CC3100, the reset line is toggled and then after the IRQ is asserted. After IRQ is asserted, the UART communication begins. 

    If the sl_Start function returns successfully, but UART fails, please submit a SimpleLink Wi-Fi Hardware Design review.

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response. The sl_Start API returns "1" (i.e.The module was set in "UNKNOWN STATE"). The Interrupt was not coming from CC3100 module in UART communication. But when I was working with SPI Interface of CC3100 module, an Interrupt occured from the module.

    Now,In CC3100MODBOOST wifi module Evauation kit, No interrupt occured for even SPI Interface too.What may be problem it is? whether the module is in working condition ? or anyother reason it has?

    could someone from TI have any  solution? it will be very helpful to proceed further.

    Thanks & Regards,

    Pradeepa

  • Hi Pradeepa,

    First, make sure that your IRQ and RTS lines match the image I shared in a previous post. From what I can tell, yours look like the two lines are active high when they should be active low.

    Also, make sure to define SL_IF_TYPE_UART so that sl_IfOpen knows to call uart_Open instead of spi_Open. 

    In the CC3100 UART Host Interface document I shared above, you can see the proper functions the SimpleLink Driver calls to the UART driver. Does your implementation pass sl_IfOpen?

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your continuous response. In UART interface of CC3100 WIFI Module, I ensured the IRQ and RTS line was not matched with above image which you have shared.

    The above waveform shows Host_IRQ and RTS line. I don't know the reason why it is in High at Initial position. I had some warnings in my code while built project. Whether this may cause any issue?

    After sl_fopen() API, the UART get Intialised, After program entered into UART_Receive() function,it received only two values "0x7c","0xfe" .After this, debugger entered into UART_WaitOnFlagUntilTimeout() function and finally it get stucked into an Error Handler() function.

  • Hi Pradeepa,

    I'll add some more commentary on what you should expect to see: nHIB should go up and then the device should send the "init complete" event log. RTS lines from both should be low to allow data exchange. IRQ shoudl be high whenever the CC3100 device has something pending for the host and then goes low when the host sends data back to it. 

    Can you take NWP logs according to the attached guide? I want to see if you ever receive the "init complete" message. It would also be helpful to zoom in on the TX data line with all of the other lines still in frame.

    2022.CC3100 & CC3200 Capture NWP Logs - Texas Instruments Wiki.pdf

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response.Is there any example available for UART interface of CC3100 module for STM32F1 controller. Can you share the example if you have?

    Thanks & Regards,

    Pradeepa

  • Hi Pradeepa,

    No, we do not have an example of the UART interface for the CC3100 module specifically. In the CC3100SDK's platform directory, we do have examples for UART for the tiva-c-launchpad and the msp430f5529lp. You can reference those for your STM32 UART interface. You may also be able to find an implementation on E2E.

    I may also be able to help with the NWP logs I mentioned in the last post.

    Thanks,
    Jacob

  • Hi Jacob,

    Thanks for your response,Based on the example available on CC3100SDK,Implemented a code for UART Interface of CC3100 module with STM32f1 controller.

    Here I have attached the images for UART interface(uart.c)

    The below images for board.c

    Is there any modification need to be done in the code?

  • Hi Pradeepa,

    I'll follow up on this request later this week.

    Thanks,
    Jacob

  • Hi Pradeepa,

    I'm not very familiar with the necessary API's to call on the STM32. I would recommend looking at the information in these blogs:

    For the CC3100, have you looked at some of the existing host driver ports we have in the CC3100SDK?

    Thanks,
    Jacob