This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to layout net-core flash

i changed the net-core flash partition and saved it to pm_static.yml.
everything is ok while i build multi-image(mcuboot, cpuapp, b0n, cpunet) until my partner wants to build single net-core image.
it always prompts "Partition manager failed: Incorrect amount of gaps found in static configuration.".
is here anyone who can help me to solve this problem?

complier prompt this:

Partition 'nvs_storage' is not included in the dynamic resolving since it is statically defined.
Partition manager failed: Incorrect amount of gaps found in static configuration. There must be exactly one gap in the static configuration to support placing the dynamic partitions (such as 'app'). Gaps found (0): The most common solution to this problem is to fill the smallest of these gaps with statically defined partition(s) until there is only one gap left. Alternatively re-order the already defined static partitions so that only one gap remains.
Failed to partition region flash_primary, size of region: 262144
Partition Configuration:
app:
size: 210944
b0n:
placement:
after:
- start
size: 34304
b0n_container:
size: 34816
hci_rpmsg:
size: 210944
nvs_storage:
placement:
after:
- hci_rpmsg
size: 16384
provision:
placement:
after:
- b0n
size: 512


the follow is the content of pm_static.yml file.

# pm_static.yml
app:
address: 0x1008800
end_address: 0x103C000
orig_span: &id001
- hci_rpmsg
region: flash_primary
size: 0x33800
span: *id001
nvs_storage:
address: 0x103C000
end_address: 0x1040000
size: 0x4000
placement:
after:
- hci_rpmsg
region: flash_primary
b0n:
address: 0x1000000
end_address: 0x1008600
placement:
after:
- start
region: flash_primary
size: 0x8600
b0n_container:
address: 0x1000000
end_address: 0x1008800
orig_span: &id002
- b0n
- provision
region: flash_primary
size: 0x8800
span: *id002
hci_rpmsg:
address: 0x1008800
end_address: 0x103C000
region: flash_primary
size: 0x33800
provision:
address: 0x1008600
end_address: 0x1008800
placement:
after:
- b0n
region: flash_primary
size: 0x200
sram_primary:
address: 0x21000000
end_address: 0x21010000
region: sram_primary
size: 0x10000

Parents
  • Hi,

    What sample are you trying to build? The hci_rpmsg sample ?

    What version of nRF Connect SDK (NCS) are you using? v1.6.0 ?

  • I'm sorry for the incomplete information.

    the SDK version is 1.6.1, and borad is nrf5340dk.

    here is the prj_multiple_image.conf file:

    ### Bootloader Configuration
    CONFIG_BOOTLOADER_MCUBOOT=y
    
    ### Main Therad
    CONFIG_MAIN_STACK_SIZE=2048
    
    ### Miscellaneous
    #10K
    CONFIG_HEAP_MEM_POOL_SIZE=10240
    
    ### Log
    CONFIG_LOG=y
    CONFIG_APP_DEBUG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_SERIAL=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
    CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE=4096
    CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP=y
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
    #CONFIG_LOG_BUFFER_SIZE=28000
    ### Debug miscellaneous
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=n
    
    ### Net Core Contorl
    CONFIG_BOARD_ENABLE_CPUNET=y
    
    ### device
    CONFIG_WATCHDOG=y
    CONFIG_WDT_DISABLE_AT_BOOT=n
    CONFIG_ADC=y
    CONFIG_ADC_NRFX_SAADC=y
    CONFIG_I2C=y
    
    #UART 
    CONFIG_UART_ASYNC_API=y
    CONFIG_SERIAL=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_UART_0_NRF_HW_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
    ### when use the other uart ,please add the UART_x macro
    CONFIG_NRFX_UARTE1=y
    CONFIG_UART_1_NRF_HW_ASYNC=y
    CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
    
    ###flash
    CONFIG_FLASH=y
    CONFIG_SOC_FLASH_NRF=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_NVS=y
    # for random generate
    # CONFIG_STACK_POINTER_RANDOM=0
    # CONFIG_TEST_RANDOM_GENERATOR=y
    # CONFIG_TIMER_RANDOM_GENERATOR=y
    
    ###multiple_image
    CONFIG_BLE_NETWORK_CORE=y
    
    

    We enabled CONFIG_BOOTLOADER_MCUBOOT and CONFIG_BLE_NETWORK_CORE to build 4 images: mcuboot, b0n, net-core-image, app-core-image.

    We plan to reserve a small amount of storage for the net-core for future use.

Reply
  • I'm sorry for the incomplete information.

    the SDK version is 1.6.1, and borad is nrf5340dk.

    here is the prj_multiple_image.conf file:

    ### Bootloader Configuration
    CONFIG_BOOTLOADER_MCUBOOT=y
    
    ### Main Therad
    CONFIG_MAIN_STACK_SIZE=2048
    
    ### Miscellaneous
    #10K
    CONFIG_HEAP_MEM_POOL_SIZE=10240
    
    ### Log
    CONFIG_LOG=y
    CONFIG_APP_DEBUG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_SERIAL=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
    CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE=4096
    CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP=y
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
    #CONFIG_LOG_BUFFER_SIZE=28000
    ### Debug miscellaneous
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=n
    
    ### Net Core Contorl
    CONFIG_BOARD_ENABLE_CPUNET=y
    
    ### device
    CONFIG_WATCHDOG=y
    CONFIG_WDT_DISABLE_AT_BOOT=n
    CONFIG_ADC=y
    CONFIG_ADC_NRFX_SAADC=y
    CONFIG_I2C=y
    
    #UART 
    CONFIG_UART_ASYNC_API=y
    CONFIG_SERIAL=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_UART_0_NRF_HW_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
    ### when use the other uart ,please add the UART_x macro
    CONFIG_NRFX_UARTE1=y
    CONFIG_UART_1_NRF_HW_ASYNC=y
    CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
    
    ###flash
    CONFIG_FLASH=y
    CONFIG_SOC_FLASH_NRF=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_NVS=y
    # for random generate
    # CONFIG_STACK_POINTER_RANDOM=0
    # CONFIG_TEST_RANDOM_GENERATOR=y
    # CONFIG_TIMER_RANDOM_GENERATOR=y
    
    ###multiple_image
    CONFIG_BLE_NETWORK_CORE=y
    
    

    We enabled CONFIG_BOOTLOADER_MCUBOOT and CONFIG_BLE_NETWORK_CORE to build 4 images: mcuboot, b0n, net-core-image, app-core-image.

    We plan to reserve a small amount of storage for the net-core for future use.

Children
  • multi-image(mcuboot, cpuapp, b0n, cpunet) until my partner wants to build single net-core image.

    A solution might be to don't apply the pm_static.yaml on the single net-core image build, or have a separate pm_static.yaml for that build.

  • we give up the 4-in-1(mcuboot, cpuapp, b0n, cpunet) compile method now. but we cannot fixed the cpunet compile error.  would you give me some help?

    compile command:

    west build -d build -b nrf5340dk_nrf5340_cpunet

    compile error:

    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    Partition 'nvs_storage' is not included in the dynamic resolving since it is statically defined.
    Partition manager failed: Incorrect amount of gaps found in static configuration. There must be exactly one gap in the static configuration to support placing the dynamic partitions (such as 'app'). Gaps found (0): The most common solution to this problem is to fill the smallest of these gaps with statically defined partition(s) until there is only one gap left. Alternatively re-order the already defined static partitions so that only one gap remains.
    Failed to partition region flash_primary, size of region: 262144
    Partition Configuration:
    app:
      size: 202752
    b0n:
      placement:
        after:
        - start
      size: 34304
    b0n_container:
      size: 34816
    hci_rpmsg:
      size: 202752
    nvs_storage:
      placement:
        before:
        - end
      size: 24576
    provision:
      placement:
        after:
        - b0n
      size: 512
    
    CMake Error at C:/workspace/4_projects/T2/2_code/NCS_YD/nrf/cmake/partition_manager.cmake:224 (message):
      Partition Manager failed, aborting. 

    prj.conf of cpunet:

    ### Bootloader Configuration
    CONFIG_SECURE_BOOT=y
    
    ### Main Therad
    CONFIG_MAIN_STACK_SIZE=2048
    
    ### Miscellaneous
    #10K
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    
    ### Log
    CONFIG_LOG=y
    CONFIG_APP_DEBUG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_SERIAL=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
    CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE=2048
    CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP=y
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
    #CONFIG_LOG_BUFFER_SIZE=28000
    
    ### Debug miscellaneous
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=n
    
    ### device
    CONFIG_WATCHDOG=y
    CONFIG_WDT_DISABLE_AT_BOOT=n
    
    #flash
    CONFIG_FLASH=y
    CONFIG_SOC_FLASH_NRF=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_NVS=y
    #IIC
    CONFIG_I2C=y
    #RPC
    CONFIG_IPM=y
    CONFIG_IPM_NRFX=y
    CONFIG_IPM_MSG_CH_1_ENABLE=y
    CONFIG_IPM_MSG_CH_1_RX=y
    CONFIG_IPM_MSG_CH_0_ENABLE=y
    CONFIG_IPM_MSG_CH_0_TX=y
    CONFIG_OPENAMP=y
    CONFIG_TINYCBOR=y
    CONFIG_RPMSG_MASTER=n
    CONFIG_THREAD_CUSTOM_DATA=y
    CONFIG_ENTROPY_GENERATOR=y
    CONFIG_NRF_RPC=y
    CONFIG_NRF_RPC_CBOR=y
    CONFIG_NRF_RPC_THREAD_STACK_SIZE=4096
    CONFIG_NRF_RPC_LOG_LEVEL_INF=y
    CONFIG_NRF_RPC_TR_LOG_LEVEL_INF=y
    CONFIG_NRF_RPC_OS_LOG_LEVEL_INF=y
    
    ### power manage
    CONFIG_PM_DEVICE=y
    
    ### config clock
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL is not set
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON=y
    CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_PERIOD=4000
    CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=1
    CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF=2
    # CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_DEBUG is not set
    
    ### test mode
    CONFIG_RD_TEST_MODE_DEF=n
    
     

    here is the pm_static.yml file content of cpunet:

    app:
      address: 0x1008800
      end_address: 0x103a000
      orig_span: &id001
      - hci_rpmsg
      region: flash_primary
      size: 0x31800
      span: *id001
    b0n:
      address: 0x1000000
      end_address: 0x1008600
      placement:
        after:
        - start
      region: flash_primary
      size: 0x8600
    b0n_container:
      address: 0x1000000
      end_address: 0x1008800
      orig_span: &id002
      - b0n
      - provision
      region: flash_primary
      size: 0x8800
      span: *id002
    hci_rpmsg:
      address: 0x1008800
      end_address: 0x103a000
      region: flash_primary
      size: 0x31800
    nvs_storage:
      address: 0x103a000
      end_address: 0x1040000
      placement:
        before:
        - end
      region: flash_primary
      size: 0x6000
    provision:
      address: 0x1008600
      end_address: 0x1008800
      placement:
        after:
        - b0n
      region: flash_primary
      size: 0x200
    #shared memory
    pcd_sram:
      address: 0x2007e000
      end_address: 0x20080000
      region: pcd_sram
      size: 0x2000
    sram_primary:
      address: 0x21000000
      end_address: 0x21010000
      region: sram_primary
      size: 0x10000
    

  • Hi,

    leisir said:
    but we cannot fixed the cpunet compile error.

    Sorry for the delay. Were you able to resolve the compile error?

    The easiest way to add a static configuration is to take the full partition layout that is available after you configure you project in "build-folder/partitions.yml" - this file can be copied to pm_static.yml and modified per your needs.

    From https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration

    we have that, "
    When modifying static configurations, keep in mind the following:

    * There can only be one unoccupied gap per region.

    * All statically defined partitions in regions with end_to_start or start_to_end placement strategy must be packed at the end or the start of the region, respectively.

    "

  • Thank you for your reply. We have solved the problem.Relaxed

Related