<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Initialize and Deinitialize BLE in FRDM KW41Z in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1387288#M3468</link>
    <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;As FRDM KW41Z does not have a FlexNVM or driver in the SDK, I see I have to use the functions available in the&amp;nbsp;&lt;SPAN&gt;fsl_flash.c file (&lt;A href="https://community.nxp.com/t5/Wireless-Connectivity/FRDM-KW41Z-d-flash-read-write-FlexNVM/m-p/930780" target="_blank"&gt;https://community.nxp.com/t5/Wireless-Connectivity/FRDM-KW41Z-d-flash-read-write-FlexNVM/m-p/930780&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any example for the KW41Z in the SDK where data is stored and read in the Flash memory using the functions from fsl_flsh.c file? I can't find any.&lt;/P&gt;&lt;P&gt;If not, could you provide a short example of how to do this? I have seen that the NVM start address is stored at NV_STORAGE_START_ADDRESS_C in the linker file.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 12:09:43 GMT</pubDate>
    <dc:creator>dvdsosa</dc:creator>
    <dc:date>2021-12-15T12:09:43Z</dc:date>
    <item>
      <title>Initialize and Deinitialize BLE in FRDM KW41Z</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1386772#M3465</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I took the FreeRTOS Wireless UART BLE example from the SDK as the base for a project. First, instead of starting the system with the "startup_task", I start the system with a task that serves as a command-line interface (CLI) to query the board via UART on PC.&lt;/P&gt;&lt;P&gt;After that, I turn on the BLE with a command by the CLI (this command starts the "startup_task" in the same way as it is in the raw example but with some things commented, like the SerialManager init because it is already initialized, etc.).&lt;/P&gt;&lt;P&gt;Next, I switch BLE off with another command (destroying all tasks, queues, events, etc. and de-initializing the things I see I can do so). The problem comes when I turn BLE on again; the problem is located in the AppMain.c file in the if condition:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* BLE Host Stack Init */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;Ble_Initialize&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;App_GenericCallback&lt;/SPAN&gt;&lt;SPAN&gt;) != &lt;/SPAN&gt;&lt;SPAN&gt;gBleSuccess_c&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;panic&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Instead "&lt;EM&gt;gBleSuccess_c&lt;/EM&gt;" I got "&lt;EM&gt;gBleAlreadyInitialized_c&lt;/EM&gt;" from&amp;nbsp;Ble_Initialize as it is normal because it has been already initialized before. Looking inside Ble_Initialize, the one who returns "&lt;EM&gt;gBleAlreadyInitialized_c"&lt;/EM&gt; is the Ble_HostInitialize function, found in the static library "lib_ble_4-2_host_cm0p.a"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I think about De-Initialize the Ble but I do not find the other function of Ble_HostInitialize() to undo its initialization.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;As I have been working a lot of time on this project, I hope someone could help me to correctly switch BLE off, and then back on.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone know how could I De-Initialize the Ble with an opposite command to&amp;nbsp;Ble_Initialize() or a workaround?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;David.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:11:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1386772#M3465</guid>
      <dc:creator>dvdsosa</dc:creator>
      <dc:date>2021-12-15T12:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize and Deinitialize BLE in FRDM KW41Z</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1386809#M3466</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;An easy way is to use the software reset. You needn't care anything using this method. Use the function 'ResetMCU'. This function is in file 'Reset.c'&lt;/P&gt;
&lt;P&gt;If your data should be kept whatever the mcu's status is, you can try to save the data into flexnvm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 02:22:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1386809#M3466</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-12-15T02:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize and Deinitialize BLE in FRDM KW41Z</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1387288#M3468</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;As FRDM KW41Z does not have a FlexNVM or driver in the SDK, I see I have to use the functions available in the&amp;nbsp;&lt;SPAN&gt;fsl_flash.c file (&lt;A href="https://community.nxp.com/t5/Wireless-Connectivity/FRDM-KW41Z-d-flash-read-write-FlexNVM/m-p/930780" target="_blank"&gt;https://community.nxp.com/t5/Wireless-Connectivity/FRDM-KW41Z-d-flash-read-write-FlexNVM/m-p/930780&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any example for the KW41Z in the SDK where data is stored and read in the Flash memory using the functions from fsl_flsh.c file? I can't find any.&lt;/P&gt;&lt;P&gt;If not, could you provide a short example of how to do this? I have seen that the NVM start address is stored at NV_STORAGE_START_ADDRESS_C in the linker file.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:09:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1387288#M3468</guid>
      <dc:creator>dvdsosa</dc:creator>
      <dc:date>2021-12-15T12:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize and Deinitialize BLE in FRDM KW41Z</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1387687#M3470</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can refer the kw41's pFlash example. Write your data into the free flash.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 01:39:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Initialize-and-Deinitialize-BLE-in-FRDM-KW41Z/m-p/1387687#M3470</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-12-16T01:39:43Z</dc:date>
    </item>
  </channel>
</rss>

