nRF5340 NET Core PCD Update Fails in NCS v2.6.3+ (SoftDevice Lib Change)

Environment:
- Hardware: Custom nRF5340 board
- Current Stable SDK: NCS v2.6.2
- Issue SDKs: NCS v2.6.3 and v2.6.4
- Toolchain: Zephyr / Nordic Connect SDK

Issue Description:
Hi, we are experiencing a regression when upgrading our project from NCS v2.6.2 to v2.6.3 or higher. While builds remain stable on v2.6.2, any image built with v2.6.3+ fails the Network Core firmware update procedure via PCD.

The failure occurs in the application core calling pcd_network_core_update(), returning the generic error: "Network core update failed"

Root Cause Analysis:
1. Binary Delta: Comparing the NET core binaries (signed_by_b0_app.bin), the v2.6.3+ image is 240 bytes larger than the v2.6.2 version.
2. Binary Divergence: There is a total mismatch in the headers/initial bytes between the working and non-working versions.
3. Library Dependency: We have isolated the change to the static libraries in: nrfxlib/softdevice_controller/ Since the C source code remains unchanged, the increased footprint or internal changes in these closed-source libraries appears to be breaking the PCD handshake or exceeding a partition boundary.

Questions:
A. Are there known issues with the SoftDevice Controller library size/PCD compatibility in the v2.6.x maintenance releases?
B. Could this 240-byte increase be causing a silent overflow in the NET core partition that PCD isn't explicitly reporting?
C. Is there a specific configuration change required in pm_static.yml or the Partition Manager to accommodate the updated libraries in v2.6.3+?

  • Hi,

    I have not been able to find any known issues that match this description, nor any similar reports. Can you share you rmemory paritioning? What is the size of pcd_sram in particular? Have you learned anything more from debugging (particularily if you have debugged in nrf/subsys/pcd/src/pcd.c and see some error return codes)?

  • Hi Einar,

    The error is specifically within the network_core_pcd_cmdset() function (defined in nrf/subsys/pcd/src/pcd.c).

    On the first iteration within the do-while loop (the only one in that function), when the assignment is executed

    command_status = pcd_fw_copy_status_get();

    PCD_STATUS_FAILED is immediately returned, and execution terminates after printing the error message mentioned above ("Network core update failed").

    Regarding the size of pcd_sram, it has remained at 8KB, as it was previously.

    Our netcore FW update is 177944 B in size with the new SKD (with SDK v2.6.2 it was 177704 B), but we have 256 KB for the CPUNET flash_primary, so it doesn't appear to be a memory saturation issue.

  • Hi,

    I see. Can you debug a bit in the network core bootloader (netboot/B0n) to see more of what causes the error? I would start looking at where pcd_fw_copy_invalidate() is called in nrf/samples/nrf5340/netboot/src/main.c, and backtracking from there it should be possible to see more precisely what failed.

  • Hi Einar,

    By continuing debugging, we understood the probable cause of the error was an incorrect buffer flushing procedure that prevented a complete flush of buffered writes.
    The flush was only performed when the stream buffer, which we configured to 512 B, was full.
    So, in reality, the problem was occurring even before, except that the FW generated with the old SDKs had a size closer to a multiple of 512:
    - with SDK v2.6.2, the size is 177,704 B, or 347 * 512 + 40
    - with SDK v2.6.3, the size is 177,944 B, or 347 * 512 + 280
    So, with the old SDK, 40 B remained in RAM that wasn't written to the flash, but these were probably padding and/or alignment bytes, since everything worked correctly. With the new SDK, however, 280 B remain in RAM, and this truncation is significant.
    Therefore this case can be considered solved. Thank you.

Related