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.

CC3120MOD: 4-wire uart topology porting

Part Number: CC3120MOD
Other Parts Discussed in Thread: CC3100SDK, CC3120, , CC3100

On a custom hardware board the CC3120MOD is connected to a LPC54114 MCU by the 4-wire uart topology.

I started porting the TI wifi driver from the CC3100SDK_1.3.0 with the use of freeRTOS.

I modified the user.h as follows

#define sl_IfOpen  uart_Open
#define sl_IfClose uart_Close
#define sl_IfRead uart_Read

#define sl_IfRegIntHdlr(InterruptHdl , pValue) //nothing
#define sl_IfMaskIntHdlr() //nothing
#define sl_IfUnMaskIntHdlr() //nothing

When I start with "sl_Start(0, 0, 0);"

The library is waiting in the sl_start routine at _SlDrvSyncObjWaitTimeout(..) function, I assume because of the missing host_IRQ connection.
Is this assumtion right?

Is there any instruction how to port the library in the 4-wire uart topology?

  • Peter,

    Take a look here: http://www.ti.com/lit/ug/swru455h/swru455h.pdf

    Page 273 has info on how to port the host driver.

    BR,

    Vince

  • Hello Vince,

    I know this document, but still wondering what to do with the "sl_IfRegIntHdlr()".

    This description assumes that Host_int is connected, but as I mentioned the 4-wire uart method is used in my hardware (without host-int IRQ).

    How to resolve this with the porting?

    Gr. peter

  • Hi Peter, 

    The host IRQ is a required pin for proper operation of our device. There isn't a clean way around that.

    BR,

    Vince 

  • Hello Vince,

    The datasheet (http://www.ti.com/lit/ds/symlink/cc3120mod.pdf) chapter 5.13.2.2 and wiki.TI (https://processors.wiki.ti.com/index.php/CC3100_UART_Host_Interface) descripes both the 4-wire uart configuration without host IRQ interrupt. 
    So this is a little confusion that the delivered code library does not supported this.

    Is there a more detailed description how the libarary works with the host IRQ trigger and character receive trigger. Other then the porting guide.
    Are there also timing diagrams of the host IRQ interrupt and data sending?

    I looked to the example project of the msp430f5529lp from CC3100-SDK (I use an other controller), there is for uart also only the sl_IfRegIntHdlr() connected to the uart character receiver interrupt. HOST_IRQ is only used under condition to clear_cts.

    Same kind of solution I managed to make, connect the sl_IfRegIntHdlr() to my uart character receive. 

    I can see that sometimes the first message send at boot from the wifi chip is received, the sync character and opcode is read.
    Most of the time this failed, timeout occure then. There is some timing issue with timing or syncing. 

    Any suggestions to discover what's wrong?

    Greetings Peter

  • Additional info:

    The wifi module is programmed by manufacturer with sp_3_10.05_2.0.0.0_2.2.0.6.bin as accespoint (AP)
    device type: CC3120, secure
    HW version: 49
    Module is in AP mode.
    By phone I can acces the simplelink setup page and configure an SSID.

    Previous there was a problem that the uart allready receive a message, before library was started.
    Now I receive always 1 from the sl_Start(0,0,0) command. So mode = 1 (ROLE_UNKNOWN).

    Data received 144 bytes: 0xBA, 0xDC, 0xCD, 0xAB, 0x08, 0x00, 0x14, 0x00, 0x28, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0xBA, 0xDC, 0xCD, 0xAB, 0x25, 0x18, 0x14, 0x00, 0x28, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2D, 0x7B, 0x0A, 0x01, 0x2D, 0x7B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xBA, 0xDC, 0xCD, 0xAB, 0x2E, 0x08, 0x50, 0x00, 0x28, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x11, 0xA3, 0x22, 0x39, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

    After receive the host send message: 0xFF, 0xEE, 0xDD, 0xBB, 0x21, 0x43, 0x34, 0x12.
    Module does not respond on it. 

    What could be the problem.

  • Peter,

    Are you able to call any sl_ calls after you recieve the (1) from sl_Start()? Can you reconfigure to station? It's odd that you the device is in station mode but you get returned (1) on sl_Start(). I'd take a look at your porting layer and ensure add the trace debug messages in the host driver. This should give you more debug prints to help you identify the issue.

    BR,

    Vince

  • Now I used CC3120MOD from BOOSTXL-CC3120MOD and connect it to a evaluarion board of same processor the custom hardware use.

    Now I can connect the HOST_IRQ line and uart lines RX, TX, RTS, and CTS. Other lines for SPI kept open. Just HOST_SPI_CS with pullup to supply (3v3).
    But still same problem.

    Strange thing is that the IRQ line keeps high, but no more characters are send by CC3120MOD.
    Below capture of I/O lines.

    1. Data receive
    2. Zoom of start data receive
    3. Powerup and data receive.

    Any idea what could be the problem that Host_IRQ line keeps high?


  • Peter, do you have the nhib/reset pin connected and toggling when you run sl_Start()?

  • Hello Vince,

    Yesterday I didn't see you responds.

    I use the example file of mqtt_client.

    The "vSimpleLinkSpawnTask()" runs, after it starting the  mqttClient() task .

    This task calls configureSimpleLinkToDefaultState() which calls sl_Start(0,0,0). this returns 1.

    After sending a command like sl_WlanSetMode(ROLE_STA) module does not respond.

    How to enable the trace debug messages?

    Gr. Peter

  • Hello Vincent,

    Yes I connected the nHIB to the sl_DeviceEnable() and sl_DeviceDisable() macros.
    There is no delay between calling  sl_DeviceEnable() and  sl_DeviceDisable() in the sl_Start() function.
    So I add some delay in disable function of 20ms.

    The reset line I called once at powerup outside the host library for approxiamatly 300ms.

    The IRQ line turns low when call sl_DeviceDisable(), and turns high +/- 80 ms after caling sl_DeviceEnable()

    See two shots below of signals.

  • Hello Vince,

    See CSV file in attachment.

    NWP_untitled.csv

  • Peter,

    Can you capture this with a serial port reader like Putty? I need the binary file to run through our parser, and it can't parse the excel format.

    Thanks,

    Vince

  • data.log
    � -�-1{�(	���
    
    �
    �	-�-1{�( Lc
    �
    �
    �
    ��
    �!
    '�/sys/certstore.lst
    ��J
    �
    
    �
    -��J-��J�-�	�J��
    ��K 
    �*��1
    �
    �	�
    �*� ���9��	z*�6��.�9
    �*� H�x���1��
    �	��
    } 
    ��
    � 
    �
    �
    '�/sys/servicepack.ucf
    ���`
    �
     �L B
    �!
    '�/sys/ucf_signatures.bin
    ��Ql-��Ql-��Ql4-��Ql4�-�	�Ql
    ��
    �
    �!
    '�/sys/servicepack.ucf
    ���`
    �
    -���`!-���`-���`@-���`8
    �
    �
    �
    �
    �
    �
    �
    ���'	�-���`�BI�BIBI
    �*�� *�� I*�.� 
    �
    �
    ���T�
    �T��T-�	��`��L
    ��
    b)��`aaA
    �-�-1{�(
    �!
    '�/sys/certstore.lst
    ��J
    �
    
    �
    -��J
    �-��J�-�	�J��
    �
    '�@@.tmp
    �l�U��e(`aaA
    	
    �
    '�/tmp/crashminidump.bin
    ��+�2���2���
    �!
    '�/sys/mdmpcfg.ini
    ��I��Fe(
    �!
    '�/sys/pmcfg.ini
    �I��Fe(
    \
    a"<b
    �
    �
    
    �
    �
    '�/sys/servicepack.ucf
    ���`
    �
     �L B
    �!
    '�/sys/ucf_signatures.bin
    ��Ql-��Ql
    �-��Ql4-��Ql4�-�	�Ql
    ��
    �
    �!
    '�/sys/servicepack.ucf
    ���`
    �
    -���`!
    �-���`-���`@-���`8
    �
    �
    �
    �
    �
    �-���`D�*�1
    �!
    '�/sys/ipcfg.ini
    ���-���
    �-���4-���4�-�	��
    ��
    �!
    '�/sys/mode.cfg
    ���I-���I
    �-���I4-���I4P-�	��I
    ��
    Q
    �
    �7�`  7�` $ @M7�``q H7�`�� l7�`� 0�7�`DI � 7�`�i  7w@  �h
    2�`��	
    
    �
    � 
    f�	
    
    g��	
    
    �!
    '�/sys/devname.cfg
    ��c-��c
    �-��c4-��c4b-�	�c
    ��
    	
    
    �����.���	
    �
    �
    �
    �!
    '�/tmp/phy.cal
    �]��-�]��
    �"Ł�(
    -�	]����
    ����PPPPPP P@P�PS�
    ��
    
    �.1
    �!
    '�/sys/macadd.bin
    ��q
    �Fe(5V�62$9�.�	
    �
    �
    ����
    �
    �-���`D����-���`H�0-���`P0��.�0�-���`�
    �-���`�
    �
    �-�	��`��L
    ���.���
    ���
    �!
    '�/sys/sign.bin
    �4s��Fe(
    ���.������
    � �,.
    ,�
    ��
    �
    ,*@$-{
    ���-{
    -{
    �	,�
    �
    '�/sys/rxfltr.ini
    ������e(��e(
    �
    '�/sys/rxfltr.ini
    ������e(��e(�A
    �
    '�/sys/rxfltr.ini
    ������e(��e(�A�A"�A�A�A�A�A�A�B�B	
    
    
    �!
    '�/sys/dhcpsrv.cfg
    �V�-�V�
    �-�V�4-�V�4-�	V�
    �@+�"-{
    �-{
    -{
    ���
    
    �!
    '�/sys/httpsrv.cfg
    �F��Fe(	��� ���� �	
    �
    �P
    
    �!
    '�/sys/mdns.cfg
    �[\�Fe(B�B��B��A�A�A�B�����P�:.C
    0.`
    �!
    '�/sys/p2p.cfg
    �o�
    �0�
    h�Fe(
    1V�
    �!
    '�/sys/ap.cfg
    �%�-�%�
    �-�%�4-�%�4�-�	%�
    ���S"dT"EUU"mysiU"mpleU"linkU"-A92U"EDF�!+
    '�/tmp/phy.cal
    �]��-0	-@	-P	-�]��
    �-�]���-�	]�������	.�	O
    �!
    '�/sys/date_time.cfg
    �
    >(�Fe(3a017.2�3.'�6....?4......
    -.
    !#���
    �!
    '�/sys/infoele.cfg
    �����Fe(..........=.^
    .W.1...M.:..)
    �!
    '�/sys/stacfg.ini
    �TU9",>�=-�TU
    �-�TU4-�TU4t-�	TU
    ��
    K
    J#
    �#
    �!
    '�/sys/pref.net
    ���Fe(r##
    )"--2`a3333aA
    s63)	�6%)	%1".2
    *""B���
    A"	��@
    �!
    '�/sys/smartconfigkeys.cfg
    ��W'�Fe(�!
    �!
    '�/sys/smartconfigkeys.cfg
    ��W'�Fe(�
    
    �	�
    7D��
    ED��!.6�()	�.$r
    )"++./����0#��>�=r
    )",,
    �D��
    E>�=.D��.$dlin.$dlinr
    )"++./����0#dlin>�=r
    )",,
    �D��
    E>�=.D��.$dlinr
    )"++./����0#dlin>�=.$LUX-r
    )"++./����0#LUX->�=.$r
    )"++./����0#��>�=r
    )",,
    �D��
    E>�=.D��.$DGS-r
    )"++./����0#DGS->�=.$Dekir
    )"++./����0#Deki>�=r
    )",,
    �D��
    E>�=.D��.$Dekir
    )"++./����0#Deki>�=.$Dekir
    )"++./����0#Deki>�=r
    )",,
    �D��
    E>�=.D��r
    )",,
    �D��
    E>�=.D��.$r
    )"++./����0#��>�=.$DGS-r
    )"++./����0#DGS->�=r
    )",,
    �D��
    E>�=.D��.$r
    )"++./����0#��>�=.$Dekir
    )"++./����0#Deki>�=.$Dekir
    )"++./����0#Deki>�=r
    )",,
    �D��
    E>�=.D��.$Dekir
    )"++./����0#Deki>�=

    I cannot log it in putty, no connection to serial port on PC, but I can parse it,
    I Removed the "0x" and, copy the data to an hex editor and save it.

    I hope you can use this format.

  • Hello Vince,

    I hope you allready know more.

    Waiting on a feedback.

    Greetings. Peter Kwekkeboom

  • Hi Peter,

    Thanks for the conversion, yes i was able to parse the logs. I see that the device starts successfully, which is a good sign.

    I just noticed you mentioned you are using the CC3120MOD. For this device, this device uses our CC31xx SDK and is not compatible with our gen 1 CC3100 SDK. Here is the link: http://www.ti.com/tool/SIMPLELINK-WIFI-CC3120-SDK-PLUGIN

    That being said, these SDKs only offer examples on platforms that you are not using, so you would need to port the host driver. Because of this, I would actually suggest porting the host driver from our CC3220 SDK. This gets updated every quarter, and gets updated at a quicker cadence than the CC31xx Plugin.

    http://www.ti.com/tool/SIMPLELINK-CC32XX-SDK

    The User.h should be similiar, so It shouldn't take you long to port. I believe after you do this, you'll be able to get sl_Start() to return.

    BR,

    Vince 

  • Hello Vince,

    Thanks for this feedback. I'm going to download and make the new porting.

    Gr. Peter

  • Hello Vince,

    I'm using FreeRtos, for the CC3100 there is an osi_freertos adaption file, in CC32xx I can't find this.

    Is there an example of an freeRtos porting?

    Gr. Peter

  • Peter,

    First if you want freeRTOS on your device, I would reach out to your MCU vendor. I found the following thread that might be helpful - https://community.nxp.com/thread/422461

    Once you have this up and running, porting the host driver should be simple. Include host driver in your example, and map all functions in user.h.

    BR,

    Vince 

  • Hello Vince,


    I allready have a FreeRtos with the controller I used, this is working project for my target hardware.

    For the wrong CC3100 SDK I managed to port the wifi host driver to my device, by using the deliverd "osi_freertos.c" in example projects of the CC3100 SDK. 

    But I need to port the CC32xx SDK wifi host driver for the CC3120. I'm looking for the simular example project, but that's missing.

    1. Can I use the "osi_freertos.c" from the CC3100 SDK?

    2. if not the deliverd freeRtos folder in ti/posix/freertos contain some restrictions that it's only can be used with IAR, but I'm not using IAR. How to solve this?

    Greetings. Peter

  • Peter,

    I would try using the portable example for your porting efforts on gen 2. 

    For the posix support, this gets tricky. What compiler are you using?(I assume Keil?) The issue is Keil does not have all the supporting files needed for our examples in the default compiler includes. I've seen another user be able to accomplish this by Installing IAR and opening the IAR project, then using this as a reference you can pull in compiler includes from the IAR compiler to the Keil compiler. Unfortunately that is all the info I know.

    Best Regards,

    Vince 

  • Hello Vince,

    I'm using the toolset of the LPC controller  "mcuxpresso" so the GNU compiler.

    Not sure what you mean by  "I would try using the portable example for your porting efforts on gen 2. " ? 

    1. Using osi_freertos file of older generation.

    or

    2. using an example of gen 2. Which example then?

    Gr. Peter

  • Peter,

    Sorry for the confusion. Are you starting from an example in our SDK and trying to port that to your MCU, or are just looking to bring in the host driver to an existing application on your MCU?

    Check out ch. 19 for the porting guide: http://www.ti.com/lit/ug/swru455i/swru455i.pdf

  • I wouldn't take anything from the Gen 1 SDK. Start fresh with the Gen 2 SDK and port the host driver. 

    BR,

    VInce

  • Hello Vince,

    In the gen 1 sdk there is an prepared os_adaption layer for freeRTOS, for the gen 2 SDK I couldn't find this.

    I've got a working project of my controller with FreeRtos. I'd like to add the wifi host driver to it.
    Which example or how advise you to start with.

    Steps untill 19.6 are very clear.
    Problem start with step 19.7 of porting guide, I hope there is a clean example for FreeRtos?

    The examples which I found are based on IAR and KEIL and needs some includes which I don't have.

    Greetings Peter

  • Peter,

    The osi_Freertos is a abstraction layer created to bridge MSP432 TI-RTOS with posix implemenation in user.h. For you, in user.h you can define these objects directly as they are referred to in freertos - Locking objects are mutexes.

    Best Regards,

    Vince 

  • Not yet had the time to go further with this.
    I had some problems with headers which are not available.
    For an other item of my project I found out that the FreeRtos version is used is pretty old.

    I was wondering if the FreeRtos version can cause any trouble by porting?

    So does the SDK2 version also works with older version of freeRtos like V8.0?

  • Hi Peter,

    I believe we recommend FreeRTOS V10 with our SDKs. I would definitely recommend updating this to the latest.

    BR,

    Vince 

  • Hello Vince,

    Thanks for this answer.

    Peter