<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Zephyr use lot of memory for unused fonction</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114014/zephyr-use-lot-of-memory-for-unused-fonction</link><description>Hello 
 I&amp;#39;ve noticed that Zephyr uses a lot of memory with all its libraries. My code only takes up 15%, but I&amp;#39;m already out of available space. I&amp;#39;ve been trying to play with flags to reduce flash size. Many of Zephyr&amp;#39;s embedded functions aren&amp;#39;t used</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Aug 2024 11:36:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114014/zephyr-use-lot-of-memory-for-unused-fonction" /><item><title>RE: Zephyr use lot of memory for unused fonction</title><link>https://devzone.nordicsemi.com/thread/498814?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 11:36:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffdb1efd-7288-4979-8c66-4fa50f796108</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Normally our BLE sample is well optimized, I am not sure which sample you have referred to make your own BLE application. So one more thing worth to check is if your application has big different with the closest BLE sample.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr use lot of memory for unused fonction</title><link>https://devzone.nordicsemi.com/thread/498805?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 11:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1871fb7b-f712-467e-9044-d74b03acd174</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;I assume you are using nRF52833 now, you can easily switch&amp;nbsp;to nRF52840 to get double size flash and memory if your application need more resources in the further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr use lot of memory for unused fonction</title><link>https://devzone.nordicsemi.com/thread/498794?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 10:56:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d80038a7-7251-41fe-aaba-05a7530d4ff9</guid><dc:creator>fabien-ch</dc:creator><description>&lt;p&gt;Thank you for your answer. I&amp;#39;ve already follow this guide :&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FLASH&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_IMG_MANAGER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_IMG_ENABLE_IMAGE_CHECK&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUBOOT_IMG_MANAGER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_IMG_ERASE_PROGRESSIVELY&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_REBOOT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PICOLIBC&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PICOLIBC_IO_C99_FORMATS&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span&gt;#TO CHANGE &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MAIN_STACK_SIZE&lt;/span&gt;&lt;span&gt;=16384 &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Enable mcumgr.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Enable most core commands.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_CMD_IMG_MGMT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_CMD_OS_MGMT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Allow for large Bluetooth data packets.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;/span&gt;&lt;span&gt;=255&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;/span&gt;&lt;span&gt;=251&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_CMD_TX_SIZE&lt;/span&gt;&lt;span&gt;=255&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE&lt;/span&gt;&lt;span&gt;=255&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/span&gt;&lt;span&gt;=247&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Enable the Bluetooth (unauthenticated) and shell mcumgr transports.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_SMP_BT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_SMP_BT_AUTHEN&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Some command handlers require a large stack.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE&lt;/span&gt;&lt;span&gt;=8192&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MULTITHREADING&lt;/span&gt;&lt;span&gt;=y &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_I2C&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SIZE_OPTIMIZATIONS&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FORCE_NO_ASSERT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_WATCHDOG&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# USB configuration&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_USB_DEVICE_STACK&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_LINE_CTRL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Power management &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PM&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Drivers and peripherals&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PINMUX&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Boot&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOT_BANNER&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Disable Bluetooth features not needed&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_DEBUG_NONE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_ASSERT&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_DATA_LEN_UPDATE&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_PHY_UPDATE&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_HCI_VS_EXT&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Disable Bluetooth controller features not needed&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;# CONFIG_BT_CTLR_PRIVACY=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;# CONFIG_BT_CTLR_PHY_2M=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Disable features not needed&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_ASSERT&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_USB_DEVICE_REMOTE_WAKEUP&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m very impressed by the scope of Zephyr&amp;#39;s size in comparison to my code, which takes up only 15%. (I know mcuboot cut half of my size)&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr use lot of memory for unused fonction</title><link>https://devzone.nordicsemi.com/thread/498782?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 10:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e2f7c77-370b-439e-90f6-3a3226d7f0ef</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Fabien,&lt;/p&gt;
&lt;p&gt;The percentage of zephyr memory usage depends on two factors. The first one is your chip memory size and the second is the libraries used by your application from Zephyr projects.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/test_and_optimize/optimizing/memory.html"&gt;Memory footprint optimization (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/memory-optimization-with-the-nrf-connect-sdk"&gt;(+) Memory Optimization with the nRF Connect SDK - Software - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can refer to above pages to do memory footprint optimizing. Make use the unused libraries are not checked in the configuration files. Otherwise, you have to consider switch to chips with bigger memory size.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>