Board: Custom board
Chip: NRF28323 - 512K flash 64K RAM
SDK 2.4.0 - ZEPHYR 3.3.99 - CMake 3.20.5 - West 1.0.0 - VSCode pluggin v2023.4.179
We used to program with SEGGER and the SOFTDEVICE, but in this project we decided to start using ZEPHYR and we already regret it, implementing the DUF before was so easy now is a nightmare.
We used as base a CTS sample because we need to ge the current time for our project, after working on it, we decide to add the FOTA functionality, we managed to fix a lot of issues, but one is wining.
We added to our project the SMP service and the config options mentioned in the FOTA documentation, but we get, the FLASH overflow error "zephyr\zephyr_pre0.elf section `text' will not fit in region `FLASH' -region `FLASH' overflowed by 81964 bytes"
So we read all the post in the forum about it, in all the post the recommendation is is to increase the MCUBOOT partition size until the problem is fixed, but here is where we found this funny behavior.
|
CONFIG_PM_PARTITION_SIZE_MCUBOOT
|
MCBOOT size | Overflow in bytes |
| 0x8000 | 32KB | 81964 |
| 0xc000 | 48KB | 90156 |
| 0x10000 | 64KB | 98348 |
| 0x40000 | 256KB | 196652 |
So my understanding is that when we get the overflow message is related to the APP not to the MCUBOOT, unless I misunderstood something.
So the solution to increase the size of the MCUBOOT partition to fix the problem can't fix it.
Here are the CMAKE WARNINGS I got while building.
CMake Warning at C:/nrf_sdk/v2.4.0/nrf/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt:14 (message): MCUmgr Bluetooth OTA DFU: suboptimal configuration of Bluetooth Controller buffers. Consider using optimal values defined in the C:/nrf_sdk/v2.4.0/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig file for CONFIG_BT_BUF_ACL_TX_SIZE, CONFIG_BT_BUF_ACL_RX_SIZE and CONFIG_BT_CTLR_DATA_LENGTH_MAX options CMake Warning at C:/nrf_sdk/v2.4.0/nrf/samples/common/mcumgr_bt_ota_dfu/CMakeLists.txt:27 (message): MCUmgr Bluetooth OTA DFU: suboptimal configuration of Bluetooth Host buffers. Consider using optimal values defined in the C:/nrf_sdk/v2.4.0/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig file for CONFIG_BT_BUF_ACL_TX_SIZE, CONFIG_BT_BUF_ACL_RX_SIZE and CONFIG_BT_L2CAP_TX_MTU options
CMake Warning (dev) at F:/_SW/_ATL_projects/ATLRR00158_Ice_Sensor/ATLRR00158_Ice_Sensor/build/mcuboot/child_image_preload.cmake:7 (set):
Syntax error in cmake code at
F:/_SW/_ATL_projects/ATLRR00158_Ice_Sensor/ATLRR00158_Ice_Sensor/build/mcuboot/child_image_preload.cmake:7
when parsing string
c:\nrf_sdk\toolchains\31f4403e35\opt\bin\python.exe
Invalid escape sequence \3
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at C:/nrf_sdk/v2.4.0/zephyr/CMakeLists.txt:838 (message): No SOURCES given to Zephyr library: lib__libc__common Excluding target from build.
This is the prj.conf file
CONFIG_HEAP_MEM_POOL_SIZE=1024 #CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 #2040 previous to adding FOTA CONFIG_MAIN_STACK_SIZE=4096 #Configuration for BT CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="xxxxxxx" CONFIG_BT_DEVICE_APPEARANCE=768 #Configuration GATT client CONFIG_BT_GATT_CLIENT=y #ENABLE manager CONFIG_BT_GATT_DM=y #Enable of Security Manager Protocol support CONFIG_BT_SMP=y # Enable CTS client CONFIG_BT_CTS_CLIENT=y # Enable Device Information service CONFIG_BT_DIS=y CONFIG_BT_DIS_FW_REV=y CONFIG_BT_DIS_FW_REV_STR="xxxxxx" CONFIG_BT_DIS_HW_REV=y CONFIG_BT_DIS_HW_REV_STR="xxxx" CONFIG_BT_DIS_MANUF="xxxxxxx" CONFIG_BT_DIS_MODEL="xxxxxxxx" CONFIG_BT_DIS_SERIAL_NUMBER=y CONFIG_BT_DIS_SERIAL_NUMBER_STR="SN01xxxxxx" CONFIG_BT_DIS_SW_REV=y CONFIG_BT_DIS_SW_REV_STR="xxxxx" CONFIG_BT_DIS_PNP=n # Enable bondings CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y #Enable RTT to read the logging CONFIG_CONSOLE=y CONFIG_USE_SEGGER_RTT=y CONFIG_RTT_CONSOLE=y #Enable log and use the RTT backend CONFIG_LOG=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_BACKEND_SHOW_COLOR=y CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=y CONFIG_LOG_DEFAULT_LEVEL=1 # CONFIG_UART_CONSOLE=n CONFIG_PRINTK=y #Enable GPIO control CONFIG_GPIO=y CONFIG_DEBUG_THREAD_INFO=y CONFIG_DEBUG_OPTIMIZATIONS=y # #Enable ADC CONFIG_ADC=y #enable primt float CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048 CONFIG_CBPRINTF_FP_SUPPORT=y # Enable FOTA DFU CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y # Allow for large Bluetooth data packets. CONFIG_BT_L2CAP_TX_MTU=498 CONFIG_BT_BUF_ACL_RX_SIZE=502 CONFIG_BT_BUF_ACL_TX_SIZE=502 CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 # Enable the Bluetooth mcumgr transport (unauthenticated). CONFIG_MCUMGR_TRANSPORT_BT=y CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y # Enable the Shell mcumgr transport. CONFIG_BASE64=y CONFIG_SHELL=y CONFIG_SHELL_BACKEND_SERIAL=n CONFIG_MCUMGR_TRANSPORT_SHELL=y # Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies. # MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands, # transmitted with the maximum possible MTU value: 498 bytes. CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=2475 CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 # Enable the LittleFS file system. CONFIG_FILE_SYSTEM=y CONFIG_FILE_SYSTEM_LITTLEFS=y # Enable file system commands CONFIG_MCUMGR_GRP_FS=y # Enable the storage erase command. CONFIG_MCUMGR_GRP_ZBASIC=y CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y # Disable Bluetooth ping support CONFIG_BT_CTLR_LE_PING=n # Disable shell commands that are not needed CONFIG_CLOCK_CONTROL_NRF_SHELL=n CONFIG_DEVICE_SHELL=n CONFIG_DEVMEM_SHELL=n CONFIG_FLASH_SHELL=n
I tried to use from VSCODE the memory report but I get an error, I have the SDK and my project files in different drives, so maybe that's why.
How can I fix this? We spent 3 days stuck on this,
Can you suggest how to configure the pm_static.yml to fix this problem?
Thanks for the support.