<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81730/how-to-upgrade-52833-firmware-with-uart-interface</link><description>My project consists of STM32 + 4G + nrf52833. When the 52833 firmware needs to be updated, the cloud service will send the 52833 firmware to STM32, and then STM32 will send the firmware to 52833 through the UART interface. Now there are some questions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Nov 2021 10:15:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81730/how-to-upgrade-52833-firmware-with-uart-interface" /><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/340000?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 10:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a4b8dd-845e-4422-a95e-8f1478dada8c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have a look at this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50025/basic-bootloader-interrupt-forwarding/200587#200587"&gt;post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/339978?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 09:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f849980a-2b76-4fb6-8b56-35006559204c</guid><dc:creator>can23</dc:creator><description>&lt;p&gt;hi，&lt;/p&gt;
&lt;p&gt;For point 3, my application uses softdevice. Can you give me a demo code?&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/339834?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 13:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bb75fc4-75f7-4819-adca-2f76c1586f2c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Yes. Not sure why the branch instruction (BX) is needed though. You can also use the cmsis function __set_MSP() for the same.&lt;/li&gt;
&lt;li&gt;Looks ok.&lt;/li&gt;
&lt;li&gt;You can&amp;#39;t use the VTOR register if the application uses the Softdevice. Then the interrupt forwarding goes like this: MBR-&amp;gt;Softdevice-&amp;gt;app. You should look at how we do it in the bootloader (i.e. what MBR API we use to enable interrupt forwarding to the Softdevice). It&lt;span&gt;&amp;nbsp;will effectively bypass the Softdevice if using the VTOR register, but you only&amp;nbsp;can use the VTOR register if the app doesn&amp;#39;t rely on the Softdevice.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/339739?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 06:53:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55cacbed-7f4d-488a-b708-4f3af0171054</guid><dc:creator>can23</dc:creator><description>&lt;p&gt;I decided to write a simple bootloader code myself. At the same time, I divided the application flash into two banks. One bank is app code and the other is new firmware (bin file received by stm32f4). In the bootloader code, if there is new firmware, write the new firmware to the app code bank, and then jump to the app code bank. Now there are several problems to be confirmed:&lt;br /&gt;1. How to set the address of [main stack pointer]&lt;br /&gt;In stm32f4, I can configure the [main stack pointer] address through this statement:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__ asm void MSR_ MSP(u32 addr)
{
&amp;#160; &amp;#160;MSR MSP, r0 // set Main Stack value
&amp;#160; &amp;#160;BX r14
}&lt;/pre&gt;&lt;br /&gt;52833 can also use this statement to set?&lt;br /&gt;2. Check whether the stack top address is legal&lt;br /&gt;When jumping from bootloader to app, first check the stack top address. After the stack top address is legal, set the [main stack pointer] address, and finally jump to app. Like stm32f4:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void iap_ load_ app(u32 appxaddr)
{
    if(((*(vu32*)appxaddr)&amp;amp;0x2FFE0000)==0x20000000) // Check whether the stack top address is legal
    {
        jump2app=(iapfun)*(vu32*)(appxaddr+4);  //
        MSR_MSP(*(vu32*)appxaddr);              // Initialize app stack pointer
        jump2app();                             // Jump to app
    }
}&lt;/pre&gt;&lt;br /&gt;52833 how to check that the stack top address is legal?&lt;br /&gt;3. Interrupt vector of app&lt;br /&gt;In the app program, how to remap the interrupt vector address? for example in stm32f4:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    SCB - &amp;gt; vtor = flash_base | 0x10000; / / 0x10000 is the start offset address of APP program
    while(1)
    {
    }
}&lt;/pre&gt;&lt;br /&gt;So is 52833?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/339322?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 03:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af94a323-be67-4f8f-8958-ae57e7cd28bb</guid><dc:creator>can23</dc:creator><description>&lt;p&gt;thanks for your reply！&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to upgrade 52833 firmware with UART interface ？</title><link>https://devzone.nordicsemi.com/thread/339021?ContentTypeID=1</link><pubDate>Mon, 15 Nov 2021 12:59:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:863117fb-537d-4d9b-86a4-03bd86bd7f73</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. See&amp;nbsp;&lt;a title="DFU mode" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=8_1_3_5_0_2#lib_bootloader_dfu_mode"&gt;DFU mode&lt;/a&gt;&amp;nbsp;doc that&amp;nbsp;Entering DFU mode is triggered by one of the optional sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Button (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga2a0043889d40d5b09e524cc701f93fbf"&gt;NRF_BL_DFU_ENTER_METHOD_BUTTON&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Pin reset (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#gaa89bea64482f2c4d83919922e5e84bc3"&gt;NRF_BL_DFU_ENTER_METHOD_PINRESET&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Special value in GPREGRET register (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga4e1297da5d25948277b4323a6fb87659"&gt;NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Request from the application written to the settings page (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#gab540083b75cd50e020bbd166198476c4"&gt;NRF_BL_DFU_ENTER_METHOD_BUTTONLESS&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can enable&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga4e1297da5d25948277b4323a6fb87659"&gt;NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;/a&gt;&lt;span&gt;&amp;nbsp;in the sdk_config.h, and&amp;nbsp;&lt;/span&gt;write the s&lt;span&gt;pecial value in the retention register GPREGRET register&amp;nbsp;a flag (BOOTLOADER_DFU_START = 0xB1)&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;in the application and then do a soft reset (NVIC_SystemReset) to switch.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. Have a look at this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40706/fota-dfu-over-uart/158408#158408"&gt;post&lt;/a&gt;.&amp;nbsp;&lt;span&gt;Another project that does more or less the same is from one of our FAEs&amp;#39; github:&amp;nbsp;&lt;a href="https://github.com/jimmywong2003/nrf-slim-serial-uart-dfu-host-c-code"&gt;nrf-slim-serial-uart-dfu-host-c-code&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;3. There is no demo exactly as your requirement, but please see the above links I provide.&amp;nbsp;&lt;span&gt;They are not written for an STM, but it can be a starting point. In case you need it, you can also check the&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_dfu_transport_serial.html"&gt;bootloader&amp;#39;s serial transport documentation on infocenter&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>