nrf5340 net core upgrade

Hi,

I just found that upgrade the net core need to set CONFIG_SERIAL=y and enable the UART in dts file, otherwise, it hangs on the network_core_pcd_cmdset function when upgrading the net core FW,  pcd_fw_copy_status_get() always returns 0.  Is this expected?  if yes, I would like to disable the net core's UART to save the current consumption, any workarounds?

static int network_core_pcd_cmdset(const void *src_addr, size_t len, bool wait)
{
	int err;
	/* Ensure that the network core is turned off */
	nrf_reset_network_force_off(NRF_RESET, true);

	err = pcd_cmd_write(src_addr, len, PCD_NET_CORE_APP_OFFSET);
	if (err != 0) {
		LOG_INF("Error while writing PCD cmd: %d", err);
		return err;
	}

	nrf_reset_network_force_off(NRF_RESET, false);
	LOG_INF("Turned on network core");

	if (!wait) {
		return 0;
	}

	do {
		/* Wait for 1 second to avoid issue where network core
		 * is unable to write to shared RAM.
		 */
		k_busy_wait(1 * USEC_PER_SEC);

		err = pcd_fw_copy_status_get();
	} while (err == PCD_STATUS_COPY);

	if (err == PCD_STATUS_COPY_FAILED) {
		LOG_ERR("Network core update failed");
		return err;
	}

	nrf_reset_network_force_off(NRF_RESET, true);
	LOG_INF("Turned off network core");
	network_core_pcd_tidy();
	return 0;
}

Parents Reply
  • Hi,

    Which version of the SDK do you use?

     NCS 2.3.0

    How was the new netcore firmware transferred to the nRF5340?

     I transfer the FW  via BLE(NCS standard SMP protocol) and USB CDC(Our own custom protocol ), and both of them have the same issue. By the way, when it hangs on the network core upgrade,  if I reset the nrf5340 via reset PIN, it can continue to upgrade the network core successfully.

    Do you update the network core from the application or from MCUboot?

    transfer the FW from the application, and do the image swap from MCUBoot .

    in addition, I upgrade the application core and network core over the external flash at the same time (The simultaneous update of multiple images).

Children
Related