You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/11/04 20:56:44 UTC

[mynewt-core] branch master updated: hw/ipc_nrf5340: Always wait for net core to start

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 7015125  hw/ipc_nrf5340: Always wait for net core to start
7015125 is described below

commit 7015125c30794f3dca04bd57a8a5a0c9e05a5e62
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Nov 4 08:59:55 2021 +0100

    hw/ipc_nrf5340: Always wait for net core to start
    
    When application did not have embedded image net core startup
    time was pretty small and ipc driver did not wait for other
    core to finish.
    It worked correct as long as there was no application side
    IPC communication initiated before IPC on the net core finished
    its initialization.
    
    If some IPC communication was started before IPC was initialized
    interrupt that should be visible on net core side was cleared.
    
    That could happen if application was configured to be client of
    network core flash. In that case IPC communication was very
    fast resulting in reboot loop due to watchdog.
    
    With this change application side always waits till network core
    finishes IPC configuration.
---
 hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
index e1a3ee5..0e3611c 100644
--- a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
+++ b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
@@ -264,24 +264,12 @@ ipc_nrf5340_init(void)
     /* Start Network Core */
     NRF_RESET->NETWORK.FORCEOFF = RESET_NETWORK_FORCEOFF_FORCEOFF_Release;
 
-#if MYNEWT_VAL(NRF5340_EMBED_NET_CORE)
     /*
-     * TODO: Remove below workaround:
-     * For now app core waits for NET core to start.
-     * It is needed for case when network core was updated with new
-     * image and due to several second delay caused by bootloader
-     * copy image application starts to send HCI reset requests via
-     * IPC and network HCI transport is not really ready to handle
-     * more then one command.
+     * Waits for NET core to start and init it's side of IPC.
+     * It may take several seconds if there is net core
+     * embedded image in the application flash.
      */
-    if (&_binary_net_core_img_end - &_binary_net_core_img_start > 32) {
-        /*
-         * Application side prepared image for net core.
-         * When net core starts it's ipc_nrf5340_init() will clear those.
-         */
-        while (NRF_IPC->GPMEM[0]);
-    }
-#endif
+    while (NRF_IPC->GPMEM[0]);
 }
 #endif