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.

CC3200 Flash File System Corruption on power off

Other Parts Discussed in Thread: CC3200, UNIFLASH, CC3200MOD

We are seeing a consistent issue with the CC3200 module file system flash being corrupted.

 The issue seems to only happen when we have an active wifi connection as follows:

-          Startup SimpleLink (sl_Start, …)

-          Connect Wifi as station to an access point

-          Disconnect power or reset the CC3200 via Reset button on dev board

-          On reboot, all sl_Fs* functions return error -49. Cannot create, read, open, query any files.

-          In order to recover, the flash must be formatted using the CCS Uniflash utility

 

NOTE: I have never seem this issue if there is no active Wifi connection (In this case SimpleLink is up with sl_Start, but there is no connection to an access point)

 

My understanding is that we need to shutoff SimpleLink (sl_Stop) prior to shutting down, but I have no way of detecting when the reset button might get pressed.

 

In referencing this app note : http://processors.wiki.ti.com/index.php/CC3100_%26_CC3200_SFlash_Recommendations#S-flash_access_by_the_WiFi_system

It appears this is a problem and can only be remedied by using the CCS Uniflash utility, and there is no option to format the filesystem flash from code.  This presents a real problem if this happens with end user devices.

 

Is there a known workaround?

Also, cross reference this user post with the same issue and no answer from TI:

e2e.ti.com/.../409695

  • Hi,

    Thank you for  your post.

    1. Please confirm that you are using CC3200 EVM when you see this issue
    2. You mention that you see the issue with CC3200 module. Can you please confirm that you are indeed using the module version of the EVM http://www.ti.com/tool/CC3200MODLAUNCHXL
    3. After the issue occurs, is it only file system operation that return error or other files in the serial flash as well?
    1. Does your application running on the MCU correctly?
    2. Does sl_Start succeed or return error?

    Thanks

    Ben

  • 1-2: We are using the CC3200 MODULE Version of the EVM
    3: I don't know what other files you mean. I only use the FS for storing a single text file. What other files should I be checking to verify this?
    1. Does is run after the FS is corrupt? I will need to verify, but I typically at this stage am running via the debugger, which runs fine
    2. sl_Start always succeeds, even when the FS is corrupt

    Also,

    - Can you please confirm the correct setting for formatting the flash in UniFlash? I am currently using 1MB
    - When the Format command is used in UniFlash, does it overwrite the service pack?
  • Hi,

    Thank you for providing more information.

    I would like to understand whether only your single file is corrupted or the entire serial flash.

    If the file that you are using is open while you loose the power or reset the device than the file may be corrupted. However, other files should not be impacted.

    After format you need to reprogram with service pack and MCU image and all other configuration that you store in serial flash.

    Can you please reproduce the issue while making sure that your file is closed correctly.

    Can you please verify the version of the service pack using sl_DevGet API in corruption state and not in corruption state after sl_Start?

    Can you please tell if your program can execute correctly when running from serial flash (not from debugger) after corruption happens?

    This will help me understand whether entire serial flash is corrupted or only the single file.

    Thanks

    Ben

  • Ben,
    The file is not open when the flash gets corrupted. Also, I am using ti_rtos

    **** - Can you please confirm the correct setting for flash format? We are currently using 1MB

    Good:
    • Format flash
    • Program service pack 1.0.0.10
    - Program flash, reboot
    • sl_start = 0
    • Chip: 67108880, MAC: 31.1.3.0.1, PHY: 1.0.3.34, NWP: 2.4.0.2, ROM 13107, HOST: 1.0.0.10
    Bad: (Note differences in MAC/PHY/NWP)
    • Program will not run from flash
    • Load and run image from debug:
    o sl_Start = 0
    o Chip: 67108880, MAC: 31.0.0.4.1, PHY: 1.5.3.3, NWP: 2.0.7.0, ROM 13107, HOST: 1.0.0.10
    o sl_GetInfo on existing file returns -49
    o Attempt to create a new file with a different name returns -49
  • Hi,

    I confirm that 1MB is the correct setting for Uniflash.

    Can you please provide the exact details to reproduce this issue step by step?

    If you can share the code you are using?

    Thanks

    Ben

  • Hi James,

    Getting the NO_DEVICE_IS_LOADED error means the serial flash could not be initialized. In your case formatting helps so most likely there is some kind of corruption as the program does not run and the service pack versions are ROM based and not flash based.

    Please follow Ben's request and provide 100% reproducible scenario.

    Additionally, when you get into the bad case situation, is it possible to run the attached utility and provide the output?https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/968/ReadFlash.exe

    Also, if there is a way to read the entire flash it can shed more light on the issue.

    Shlomi

  • Below are the results to ReadFlash when corrupted.

    I will need to take some time to give you a build that is paired down enough to isolate the problem. In the meantime, can you please answer the following ASAP?

    1 - What issues in my code would likely cause the flash to get corrupted? If the code is running in RAM, could a memory leak or buffer overrun cause the problem?
    2 - Can you please confirm proper initialization steps and sequence of ti-rtos as well as the proper includes, libraries, etc?
    3 - How would I read the entire flash as you propose?

    I am happy to share my project as long as it is kept private. Also, the project will not run on a baseline CC3200LP, as we have remapped a lot of the pins to connect to our peripherals. But having you review the main() and project settings would be great.

    Thanks,

    Jim

    ReadFlash Output:

    C:\Users\Jim\Downloads\Ti>readflash -p 24
    connect to device
    port opened
    wait and clear uart rx buffer
    set break signal
    --- please restart the device ---
    wait for ack
    receive ack
    connection succeeded
    get storage list
    wait for ack
    receive ack
    receive storage list
    exit bootldr connect
    Reading version info
    port opened
    wait for ack
    receive ack
    Bootloader version is (2, 1, 4, 0)
    It's a CC3200 device: PG1.33 or Higher
    Switch UART pinmux to APPS
    port opened
    wait for ack
    receive ack
    Setting Break Signal
    wait for ack
    receive ack
    Switch to NWP bootloader completed

    raw read
    port already opened
    wait for ack
    receive ack
    wait for ack
    receive ack
    Status request
    wait for ack
    receive ack
    wait for ack
    receive ack
    Status request
    wait for ack
    receive ack
    Disconnecting from device
    port opened
    wait for ack
    receive ack
    Disconnection complete
    exit bootldr disconnect
    reading flash completed
  • Jim,

    You should have FAT.bin file on the same directory where you executed the utility. Can you share it?

    Most likely flash corruption (if happens) is caused during sudden power off when serial flash is erased/wriiten so it is not something specific in your code.

    I do not see any code snippet shared by you.

    Regarding full reading of the serial flash, since you are using a module, it is more problematic. I need to implement another utility to do so.

    Shlomi

  • I renamed the FAT.bin to FAT.c so I could attach it

    ��y�A�`	*{Q��@���t��ܭwֿR\LS_��*K+v&� ��pf�ԬL�#S���v� �I�[X����^O3�h?�D�c��I�L���ND�后�8�,`l����&���N��Z��J�6��/�4L$����[h>0�2ы�A�L�S_��P,�y��PxA]���x����;�����2l%s�=�w�����/;_}����x�˼7��^��a��z�lj�th���c�������W~цJ7Eq�/.}����c�ᐏѱ�L��jyR��<�#��؆�`�l�zX
    {�"ߒ�p�My�~T<�6�V��7�)�(�	�pfm�W����xo/a"u#�D�+�7���[��� ��58��-��>=KʵݏY��� 7�H?.F��o����{]ZN`�/���<AN��VXu��m6ppB%�2l�{�R'ɺ���r�=�aܨ�t1d��Z��p�-�N���np��͚&�<�x^/�0�xm"F��p��=�xօ�c��P �Yݴ*�AjM�����޹�P:�
    M��\&�HX}�s\k]�{���
    Ui���V-A�]G�;�4�y�v8J8���rPÑ��wxj�r�A��4���Rx�/����[�Ş�0�hNy�r����"��Ӯ�
    ���ĕj�����$=��%
    7��6�^"�,������a:C#A�aN|�s��K�U廱�H�GF�o܏5�\,+]�_��)zI�krW�3$a
    ��z���Bo<��;m�?��]z`W�V7d��L��}0u�σJWF!�H;�7>�<G��s��wo~8h��1��W����G$�͙*��R��~M�M��f�Wr�*ť��P~�%�N��с���(�����mt��`-3�2��@��8BD{}��tK��U矔�~R�z:"GCt���npφ�^����z��C��]�߿d��l[��I��*���8��-�����&��}G5L�/f�Y�霥��)�*$3������nx�Rѥ���7�.�K:#'Y�@T�F�pt���`cP��}����M(`U�zE�3w|�_<ғ����f'�yB�!�R��믤�#���"�vSZ/`�����{ݔ���<���O��H����Z�0̤�X�.X���1���&�m����M���W0i�
    �����'��o��[Ӳ�kw���?�'E�y���̋}Vf�׌�=�Yƒ.I�X��h�Fe��-g���3S���Se8Dr��,(�"�ωð�0�Q�UXI�`�F�
    �|c�@��G�q���`нxV�q��{9�a���k2d8iC�C��l6{�i����N���p��E���}���[K�K�F j�k�нL��m�3k��D�����5�:��\��KVW�Z��L��ϻ,����p��i�~����#��V���D��������k�b��2�&����עI
    Y�w~#9e��%z,��>Sj�X��s��c�%�B(�����l�[�$��i�se���4���-�#7\�dΫ��R���=*Ç���D��1Q:N�v&��+%5�t/_
    h#��7�WH	��؃�`�(?�Q�K��N�e��v	�*���gS�B8ޮ[U��ޒ:�w%A�$;h���2�vW�S#�� 
    ����_�c��'���eJp�H����� �ꐣL@?��1Ct/BG����o������^��9fK����1�aU�v�R�@/�ަ%`�&��S`e����\S^����5EA� �=B��8�yEi֕����>%a��9��)݇I�,B��$�;B�w8�����JzR?�:Er�P��J��*�Z�)ׇ��VA��8
    /��s�?:\�|i���Z����[����尗m��j����#���mZ���&B=)�UI�T�3D���g>I��tQ����/�����2]X.��zH[�^1�
    8������Ad�|��Ho�����m_�]k̀Q�(i�K/���in��ڶ{M���̮������=��vV�GS�-�>���fJ��WzE�^���-������&�1~����Lc
    �dg��4%�:�
    #b�u����JƝK�]&�I����ڂ�%Cm�/+TY`�'9s���l��"��	[u^�X�<�ȫ��_�N��F��9꺋�:��8ዽ���yx�4Pf*�0�����݅j,q���uyV�HI���Ŏ�g[�yC��
    �Gz�>-�~�6��I�d��M��;Y��%~@+J���E哿7�wBY�8�����p9�J�H̊��y�x��P��!'\0�g[l�d-@��M�	���}�M��ɍ1J�T^\���>J^����hZ�QH�����`7�N��q2�VğZh�#y�zu��>u��f�+A�?�}2�o��S��l��qt�u����~`�9#��S`A�d��f�1C��^�T�_:�!�ƒ�J�]^m��g3ҫ*�[��!*�����ĸFt��\�W�!�aŞP��~I+��åy��N�"�D	
    �Y���Lt~2t�2O4Y��1��I�ؤRZP��"��V؎D��>�4��
    �=9{	��\��8��e��p��*�ÏY_�8���%˄2!��[��z7�B������>_~���"������F�gn�+7�S]
    �����&X#���|��,�9��1=:����S��_��bȋ����x
    D>~�~h-[KK�Η����b��/� �Q����0=8�f�Ȝ�$B���9��վj�t�zdk��F�;�:���RW�Ke���H���E)�Zo��U���M(�]�|0��&X>-(9 `��p�V(R�E�9����ǎ�q�#��.�3�Qf1����+<�U�݃�L����J�T�*WN�)r�-�)�Y+��]�l�I�2�9����e��� +;/��Y����0���%GT��&'�q����!�����J.�
    �
    �B���!]q	�+B�p�{3�s��
    �:(]>8>�,�h�=i��ȋ��%{k��W!ݞ����i�O�Ql��a$Ms/�h��<��ɽ?7�d��RoÆ�x*Ɋ��F��<������%T�3Σ���d�I
    ҫđս�7��YntJ�=��ˑŨv�2h}�C�'&c���k�V����"�
    �4-��0�g���t�
    �6����K��������c���
    �2��D���IK��H"�\�n�����C\��6�"�Rd��c�/��$gs�'K!�L_B��
    ?�s�Zf���e}���d罡�Ҙf�)2�r�4���1D���87HMNc�o@W;�9�=Y��厄�z#G=��ő�Q��ӷ�D�PnT��k�M�Ġi���U���mWp�n"��V��\N�qC�S7�;�����:�
    gat�vg�JR۔�I�G:;
    `�`�P8�ԓp�zDJ�V�������S��EƱ�S|c�1��d�<��!����;�wEҨI�I��G!�~�P��&P��
    RI�H��#�|�4������֍?M�)�oC�$u���b�}*��,J�:����C�/N�D�yXu3ju83���_o�藆�V�KyJ.�gp����|W�U~�&��*��]S�7D��ض�����7�g�뤴�v���,+b�h4��<U�`N�l���Y�U�P(
    ���OO��5��F��&���B����(�����ma�ۢ�<�*WWh,ӡ�XHp�\?I2�	�,e�hAZ�Fž�>�_��w+X��H�=��k�%���En����r[zu�"!	trU�D��ڙd6"!�:!I1\5"j׌<�z2����I�̮R[X�;���nST:�c<��x6�lhMI&ku��C��e����\��q��ٴwh|uTh��n�N��;��`��v�-���A�]��S�џ�4}.�m#ն�����螅���Q�(�1�#'��VXg=�%zg�����@I��}��*qa"2���e���w~��ض�%g�5Y�K23�bB����Ȁaցz�]}�Z#?���G�fx���>��o��U���t�<*��aGH磵.���R���A1���'��J����g�᫼R�apx6
    t�E�ӯ�Q8��5f
    CI�Td��8���MS��aj$�T)�c��5�t�ؑJjF���Hd�Z�yb����0W���??����Rbu�Y^�x�8��"\�=A4�v
    ���E��
    �BJ�'c�/���%$�l4�ă�KOA/�n��9�^�E�mJ��F�t���nf*Z(��T���k��U=��"���J1���L�1��/h���Ԥ3�'��y|�H��0P�*�8�Ҏ��C��SM�;i8�;���`�*=8��B�V~���zl	X�ѣ_��1X��kF!ӸA�+�=��^����|�Bl�}|Q!����w|t�Z�Έ�
    VW��_F�	!�r�1c��J�?�{m_���T�q��������TߢC�Ҝ�8��|@�ϔ����N���T�R^���Pg�������x~h����6��豕�>9��v@��n��ɲх1eg�xӡZ����2\(2>�����q�e���L����>�lt*�J��͖y���]�)HƷ�*�	��
    ��o��/N���S�(�Sr������=Q:���&
    L1uM�'n6<q�u^]���\�'�H�>����t?	�ڤ��l����:^�K6,�9ـ��ͫ�����s�J{xtD��(�����h�E��iq�C�7G�U�	������o��/h��l7+���W�Ar��iV,04�L����s���dl~��Ob��7��1�]���bR���X�|!	s���+��ۥ3%нr#�(D�$Kw^�!��I�?z3
    2������s_�eG�TCT�E���@xK��]S��[_E�=�3�f���7z�m�D�g�X-�"��2���?H�!o*ߎ�����,K�.��L��u�|Pr�I��J.�h��r(�r�՛}2������Y1�(d\�N�M��n�aÃGޣ�;S�>��BQO�Xq���&6ows����b�C��~, U@����]�_e:64
    ��wbxi�c��&�(��S34�*��ڟ�m�	m^X�QNEb�E_
    ��Z
    Y��6줼�=���L���NA99Z�����q	�gnA���m���۫Ŀ",��{�|�l.}կ�
    �7ݶ�
    XZ�(����Vdu�="�D"��s	�N�=��C2�n�<Q�W�����,1�^R
    Z��̗=![�	-;Fnަ���e��㠬���8�TUy�ׂ��gX�@�L"J�찦'l	S.ʲy��T�Lå��]�M0��*/Ɠ�}a�e!;�����Z�+
    ��"�g�7خ8���Rg6��0���2*(�i�M��2�/��e�@������|�$j�􅲞����@Tz�E��ս�"7n����T�)�����˙V�����[���� �^��p�4Ix���:E�2O�N��g@2��lOO��2�HY|ߢNg*
    /�.�J�Ѹ�ep~���$
    ���V<�gv�t'[��f��
    ����G�d��jT4�ݱ/t�c��c�#"��6��K1�E�bS��6���q��%�ez�������U�[!
    ��8�?��+��go������"�J�!��9*c��s	~�Dqn�Zw>d�XjW�grnl�LB�GMԂ�Ӣ]�S&l!��q�wC���kL%�dɊ܁Lo��GD�!DrVk0�5P�>|�A����Uhu�!��J�\b����/*�.h�����F��d� ��ֶ|�;G�&JT���
    `�}�-mW/4dL�M�N�5���i��ɧ���E��
    `H_��]���
    |�x5}��r���.�����
    +E���(Z��c���g�$�P�d7���h��C��T0�e��Z���	|,��{!�p2 �/]tLXEV������V���{B��QJC���V�+�hr�тY'���X�~�n-�_������m"��81���>��Vx��R�eFp���:P�fw
    ���ւ� �s�\m��E�B�^�BZ؟��~�C� w>נ
    �Y���k ]�D抏y�����x�����>������)3A;Q��TGCL�{���&(��֋n�Ο3\���»��-f���aչ����]:�ΐ2�ۢ�F�'_GZ�S[�;���h���?�|m��8�tvGQi_Q�X�֣�@���t��~���>��]\��Ub��zo+:�˴�]�c���O�=��!`(ܗ���$��v���9�H���-8��N�Dn8>٘W��	"ԧe��x`���l�Brwt��4�,>�v��
    J��f>O��/[��h�?��mNO%�B�<iY�E�&ۡI:���6��{�/b:����z������6Q���_ǒ�Su��������m�Rտ��s��n��\�ো�A8^��㴜�rg9'��ڻ+��$�ܘͥ&�5�`k�:K����G3zYQ�C3	u��D�b&H�A�����S��2S/A:ӡ��\��}=���ţ7nE�}�V6��>q��)�VM�?xM��i0�t��Ȼxys��ռIS��,e%B���鲉�"���9�/($� �+��(�d�
    ���0�=��o�q�p��p�(.�4E�X�y�H:��X@'�v=�\�V�䬢���N#(do�����꯽Csp�xf���#��)?����?�g]m�[\���aݥ��Y��`		�3��O��`�2�T�"	$�Hs�~���cԾh[�`�o�hV��SXu���h	!N* ��P���s��{[%��`�+-�nB]��d�I�ݵ`@Yx|�K���IS��Ә��F���[�iq�1���\�x���ο��M�������z)fk:n	���P,�qEF=��ō�O����	=��W	I	#�s�����1P����cݮ���6�k'?�
    �Qk��>�'(�+��;;|�g`�5�1�M��&�
    ^�>�yL�rE�Y�0}�MP��/�.�w�$7e�a]eW��ŀ�L��ˇ���ub��øab�����4D��CxvP�!�Ƙ����cCǐ"�0!��X#���^��g�2�1�o�^���u���L�9~D�]��'F h�GIr�+ ���…l�՚���;m�����r�љ���|�[������p"`��|6�ً�S����I��/rX}H:�Ы����
    �X�a�A�C��D�.�:)�8�s$���N��y��s��G��_�~���j;��nt_�`x P����x��R�M0
    �M�0C�
    ǖt�n���݆'��Y+��"f�G�I+�^QA'�ElG���Y�e
     i���+�	M��^�����"���GS#*-��=��C@�V��g�"��1�n�ھn�闍C:I?�3,����@r�Y��l�>5����s�R?�R��,Z�ZQ�]V��w)_}G�C$�\�7��P�hE����}K�i2�TW���D���(�8a��[�6��N
    �5h�����W�-|�떍�~V��B��fY�����vyeT�X'�#\>����:r�?��-!O�>��b��� �Vۈ��N6G{%a��'�����s��2��6^��y|� ��tV�6����㢸յ�����d� a9}���N'�R~����Dh��
    �������G4|`�>�S˓
    �2໢�a�N�9��'�y샱bm@2�<���D�@�Ϥ{��8g��q�X@~BΞ;�w�^'����/a��c���g�Jc���}΍�wE�EŻ�4�W�	�Z�K�4��l��b]�����11�;�ot���Um��(�.a�~X0x���t���I�m�}Da�Ʉ"���h!c��qJ�����>O5����0*���ϋ��O00��n���N���$��j�jXr�-�W�X:V���=��(V��6`a�ޒk�p�x���R��d��n`K��-�cM�Ж��V�O|Y)��r
    ��eq�M�ݮ��l������=+��K'l_LVQ��|_&A���={�Rua�xT��hkP%�z�$�$o|o��

  • Jim,

    It is really all gibberish. Even if there is some flash corruption, I would expect to see it in the FAT.

    Can you try formatting the board via Uniflash and then run this utility? I would like to see a valid FAT first.

    Shlomi

  • I had this very problem happen to me the other day, though I have only had it happen once. I was no longer able to read files from the file system even though the firmware booted properly. Same error code (-49) on all file system API including deleting and creating a file. I believe it to be a file system corruption or corruption of the FAT table.

    The reason I suggest this, is because not even the boot rom and Uniflash were able to communicate with the flash. Attempts to apply the service pack with Uniflash resulted in an Open error. I don't have the original message, but both the service pack programming as well as programming the other files all failed. The only way I was able to recover the board was to format and start again. I have not made any earnest attempts to re-create the issue as of yet.

    The difference in my case is we are using a custom board (not the module) and have had great success with it thus far. Additionally, this board was built with the Micron flash (M25PX80) whose use was later discouraged. ( Wiki post here )

    I have attributed my flash corruption failure to the use of this Micron Flash. But I am very interested in how Jim's issue is resolved to ensure I am correct in my bad flash assumption.

  • Jim,

    Any update on the above?

    Shlomi

  • Shlomi,

    I had to create a minimum build on the CC3200MOD dev board that would reproduce the problem.

    I have that now and am ready to upload it.  Please provide a mans to upload it so it remains private, as there is still some project specific code in it.

    I will also provide the steps to configure and reproduce the error.

    Thanks,

    Jim

  • Hi James,

    Please use my Email shlomii@ti.com

    Also note I'll be Out till Oct-06 so I'll loop in relevant people to maintain support.

    Regards,

    Shlomi

  • Hi,

    I am closing the thread as this thread is taken offline.

    Shlomi

  • RESOLVED! - Nobody can tell me why, but upgrading to the following tools/libraries fixed the issue:

    Compiler: TI v5.2.6

    TI-RTOS for Simplelink: 2.14.3.28

    XDCTools: 3.31.1.33

    CCS Uniflash: Version: 3.4.0.00002