This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ram size reduction options with zephyr

hello Nordic

i am want to run an ncs based application (that is running on nrf52840, -> trying to create single code for 2 boards i have), when i set to run the same application on the nrf52832 i see compilation fails cause not enough space for ram. so to see where i stand and how/what i can reduce in ram i tested how much ram is taken for the simplest peripheral example.

here are the results:

Path                                                                                             Size    %  
==============================================================================================================
Root                                                                                            30888 100.00%
├── (hidden)                                                                                     3065  9.92%
├── (no paths)                                                                                   5076 16.43%
│   ├── SystemCoreClock                                                                             4  0.01%
│   ├── _SEGGER_RTT                                                                               168  0.54%
│   ├── __compound_literal.0                                                                       24  0.08%
│   ├── __compound_literal.1                                                                       24  0.08%
│   ├── __compound_literal.10                                                                      20  0.06%
│   ├── __compound_literal.11                                                                      20  0.06%
│   ├── __compound_literal.12                                                                      24  0.08%
│   ├── __compound_literal.13                                                                      20  0.06%
│   ├── __compound_literal.14                                                                      12  0.04%
│   ├── __compound_literal.15                                                                       9  0.03%
│   ├── __compound_literal.16                                                                       4  0.01%
│   ├── __compound_literal.17                                                                      10  0.03%
│   ├── __compound_literal.18                                                                       8  0.03%
│   ├── __compound_literal.19                                                                      20  0.06%
│   ├── __compound_literal.2                                                                       28  0.09%
│   ├── __compound_literal.20                                                                       4  0.01%
│   ├── __compound_literal.21                                                                       4  0.01%
│   ├── __compound_literal.22                                                                       4  0.01%
│   ├── __compound_literal.23                                                                       8  0.03%
│   ├── __compound_literal.24                                                                       4  0.01%
│   ├── __compound_literal.25                                                                       4  0.01%
│   ├── __compound_literal.26                                                                       4  0.01%
│   ├── __compound_literal.27                                                                       8  0.03%
│   ├── __compound_literal.28                                                                       4  0.01%
│   ├── __compound_literal.3                                                                       24  0.08%
│   ├── __compound_literal.4                                                                       64  0.21%
│   ├── __compound_literal.5                                                                       24  0.08%
│   ├── __compound_literal.6                                                                       28  0.09%
│   ├── __compound_literal.7                                                                       84  0.27%
│   ├── __compound_literal.8                                                                       28  0.09%
│   ├── __compound_literal.9                                                                       16  0.05%
│   ├── _kernel                                                                                    48  0.16%
│   ├── _sw_isr_table                                                                             312  1.01%
│   ├── bt_auth                                                                                     4  0.01%
│   ├── bt_dev                                                                                    504  1.63%
│   ├── cli.2                                                                                      16  0.05%
│   ├── default_settings_nvs.0                                                                     64  0.21%
│   ├── dev.0                                                                                       4  0.01%
│   ├── dynamic_regions.0                                                                          12  0.04%
│   ├── events.0                                                                                   60  0.19%
│   ├── gpio_initialized.0                                                                          1  0.00%
│   ├── hci_buffer.0                                                                               73  0.24%
│   ├── heartrate.0                                                                                 1  0.00%
│   ├── hrm.0                                                                                       2  0.01%
│   ├── ident.1                                                                                     1  0.00%
│   ├── k_sys_work_q                                                                              160  0.52%
│   ├── on.3                                                                                        4  0.01%
│   ├── once.1                                                                                      1  0.00%
│   ├── ops.0                                                                                      32  0.10%
│   ├── pub_key_cb.0                                                                                8  0.03%
│   ├── rtt_term_mutex                                                                             20  0.06%
│   ├── settings_handlers                                                                           8  0.03%
│   ├── settings_load_srcs                                                                          8  0.03%
│   ├── settings_save_dst                                                                           4  0.01%
│   ├── str.1                                                                                      30  0.10%
│   ├── str.3                                                                                     129  0.42%
│   ├── sym_4UPCEGANXTW4CY2APTG4M3ASURYRAOSICOABFVQ                                                 4  0.01%
│   ├── sym_BQU3DXYQO6CVRTZ73QCZ3ROACVRWF5BM63HWZBA                                                 4  0.01%
│   ├── sym_I2ECAHYJUC2B2QUHO3QKLB2MXHP4E2UH6ISXFDY                                                 4  0.01%
│   ├── sym_RIJRDO5P75BJM27PPQHZSDMFCKFZWFJNGCJA52I                                                 4  0.01%
│   ├── sym_SXHUVOM4EI7L4NGF2KWSQ6ZLB3KNNMW76PXITUA                                               467  1.51%
│   ├── sym_VQ35Q3R547AGSAUE3MG4FJPAHAQLVUOXVCL6PHY                                                 3  0.01%
│   ├── sym_X2CGJY32WPU5QR6XFTHTAS6KO4LV2ENSTHTXMQI                                                28  0.09%
│   ├── sym_Z5WZCMHZDI7RNMVB5GZYQIRS7P3BTO7552UV62I                                                 1  0.00%
│   ├── sym_ZBLSXVK5T67DMHUVRGQNLJO5IMUQ4ERRIIDJ55A                                                 4  0.01%
│   ├── wait_q.0                                                                                    8  0.03%
│   ├── z_idle_threads                                                                            128  0.41%
│   ├── z_interrupt_stacks                                                                       2080  6.73%
│   └── z_main_thread                                                                             128  0.41%
├── /                                                                                             304  0.98%
│   └── home                                                                                      304  0.98%
│       └── zhershkovitch                                                                         304  0.98%
│           └── workspace                                                                         304  0.98%
│               └── sample_test                                                                   304  0.98%
│                   └── peripheral                                                                304  0.98%
│                       └── src                                                                   304  0.98%
│                           ├── cts.c                                                              11  0.04%
│                           │   ├── ct                                                             10  0.03%
│                           │   └── ct_update                                                       1  0.00%
│                           └── main.c                                                            293  0.95%
│                               ├── auth_cb_display                                                36  0.12%
│                               ├── conn_callbacks                                                 28  0.09%
│                               ├── gatt_callbacks                                                  8  0.03%
│                               ├── ind_params                                                     24  0.08%
│                               ├── indicating                                                      1  0.00%
│                               ├── signed_value                                                    4  0.01%
│                               ├── simulate_vnd                                                    1  0.00%
│                               ├── vnd_auth_uuid                                                  17  0.06%
│                               ├── vnd_auth_value                                                 21  0.07%
│                               ├── vnd_enc_uuid                                                   17  0.06%
│                               ├── vnd_long_cep                                                    2  0.01%
│                               ├── vnd_long_value                                                 75  0.24%
│                               ├── vnd_uuid                                                       17  0.06%
│                               ├── vnd_value                                                      21  0.07%
│                               └── vnd_wwr_value                                                  21  0.07%
├── WORKSPACE                                                                                    5513 17.85%
│   ├── modules                                                                                  1128  3.65%
│   │   ├── crypto                                                                                  4  0.01%
│   │   │   └── tinycrypt                                                                           4  0.01%
│   │   │       └── lib                                                                             4  0.01%
│   │   │           └── source                                                                      4  0.01%
│   │   │               └── ecc.c                                                                   4  0.01%
│   │   │                   └── g_rng_function                                                      4  0.01%
│   │   ├── debug                                                                                1040  3.37%
│   │   │   └── segger                                                                           1040  3.37%
│   │   │       └── SEGGER                                                                       1040  3.37%
│   │   │           └── SEGGER_RTT.c                                                             1040  3.37%
│   │   │               ├── _acDownBuffer                                                          16  0.05%
│   │   │               └── _acUpBuffer                                                          1024  3.32%
│   │   └── hal                                                                                    84  0.27%
│   │       └── nordic                                                                             84  0.27%
│   │           └── nrfx                                                                           84  0.27%
│   │               └── drivers                                                                    84  0.27%
│   │                   └── src                                                                    84  0.27%
│   │                       ├── nrfx_gpiote.c                                                      80  0.26%
│   │                       │   └── m_cb                                                           80  0.26%
│   │                       └── nrfx_ppi.c                                                          4  0.01%
│   │                           └── m_channels_allocated                                            4  0.01%
│   └── nrf                                                                                      4385 14.20%
│       ├── drivers                                                                                72  0.23%
│       │   └── mpsl                                                                               72  0.23%
│       │       ├── clock_control                                                                   4  0.01%
│       │       │   └── nrfx_clock_mpsl.c                                                           4  0.01%
│       │       │       └── event_handler                                                           4  0.01%
│       │       └── flash_sync                                                                     68  0.22%
│       │           └── flash_sync_mpsl.c                                                          68  0.22%
│       │               └── _context                                                               68  0.22%
│       ├── lib                                                                                    20  0.06%
│       │   └── multithreading_lock                                                                20  0.06%
│       │       └── multithreading_lock.c                                                          20  0.06%
│       │           └── mpsl_lock                                                                  20  0.06%
│       └── subsys                                                                               4293 13.90%
│           ├── bluetooth                                                                        3049  9.87%
│           │   └── controller                                                                   3049  9.87%
│           │       ├── hci_driver.c                                                             2978  9.64%
│           │       │   ├── entropy_source                                                          4  0.01%
│           │       │   ├── recv_thread_data                                                      128  0.41%
│           │       │   ├── recv_thread_stack                                                    1056  3.42%
│           │       │   ├── sdc_mempool                                                          1766  5.72%
│           │       │   └── sem_recv                                                               24  0.08%
│           │       └── hci_internal.c                                                             71  0.23%
│           │           └── cmd_complete_or_status                                                 71  0.23%
│           └── mpsl                                                                             1244  4.03%
│               └── init                                                                         1244  4.03%
│                   └── mpsl_init.c                                                              1244  4.03%
│                       ├── sem_signal                                                             24  0.08%
│                       ├── signal_thread_data                                                    128  0.41%
│                       ├── signal_thread_stack                                                  1056  3.42%
│                       └── timeslot_context                                                       36  0.12%
└── ZEPHYR_BASE                                                                                 16930 54.81%
    ├── arch                                                                                        1  0.00%
    │   └── arm                                                                                     1  0.00%
    │       └── core                                                                                1  0.00%
    │           └── aarch32                                                                         1  0.00%
    │               └── mpu                                                                         1  0.00%
    │                   └── arm_mpu.c                                                               1  0.00%
    │                       └── static_regions_num                                                  1  0.00%
    ├── drivers                                                                                   292  0.95%
    │   ├── clock_control                                                                          88  0.28%
    │   │   └── clock_control_nrf.c                                                                88  0.28%
    │   │       ├── __devstate_dts_ord_26                                                           4  0.01%
    │   │       ├── data                                                                           80  0.26%
    │   │       └── hfclk_users                                                                     4  0.01%
    │   ├── console                                                                                 4  0.01%
    │   │   └── uart_console.c                                                                      4  0.01%
    │   │       └── uart_console_dev                                                                4  0.01%
    │   ├── entropy                                                                                88  0.28%
    │   │   └── entropy_nrf5.c                                                                     88  0.28%
    │   │       ├── __devstate_dts_ord_36                                                           4  0.01%
    │   │       └── entropy_nrf5_data                                                              84  0.27%
    │   ├── flash                                                                                  36  0.12%
    │   │   └── soc_flash_nrf.c                                                                    36  0.12%
    │   │       ├── __devstate_dts_ord_52                                                           4  0.01%
    │   │       ├── dev_layout                                                                      8  0.03%
    │   │       └── sem_lock                                                                       24  0.08%
    │   ├── gpio                                                                                   32  0.10%
    │   │   └── gpio_nrfx.c                                                                        32  0.10%
    │   │       ├── __devstate_dts_ord_10                                                           4  0.01%
    │   │       └── gpio_nrfx_p0_data                                                              28  0.09%
    │   ├── serial                                                                                 24  0.08%
    │   │   └── uart_nrfx_uarte.c                                                                  24  0.08%
    │   │       ├── __devstate_dts_ord_49                                                           4  0.01%
    │   │       └── uarte_0_data                                                                   20  0.06%
    │   └── timer                                                                                  20  0.06%
    │       ├── nrf_rtc_timer.c                                                                    16  0.05%
    │       │   ├── cc_data                                                                         8  0.03%
    │       │   ├── int_mask                                                                        4  0.01%
    │       │   └── last_count                                                                      4  0.01%
    │       └── sys_clock_init.c                                                                    4  0.01%
    │           └── __devstate_sys_init_sys_clock_driver_init0                                      4  0.01%
    ├── kernel                                                                                   3529 11.43%
    │   ├── init.c                                                                               1409  4.56%
    │   │   ├── z_idle_stacks                                                                     352  1.14%
    │   │   ├── z_main_stack                                                                     1056  3.42%
    │   │   └── z_sys_post_kernel                                                                   1  0.00%
    │   ├── sched.c                                                                                12  0.04%
    │   │   ├── pending_current                                                                     4  0.01%
    │   │   ├── slice_max_prio                                                                      4  0.01%
    │   │   └── slice_time                                                                          4  0.01%
    │   ├── system_work_q.c                                                                      2080  6.73%
    │   │   └── sys_work_q_stack                                                                 2080  6.73%
    │   ├── timeout.c                                                                              20  0.06%
    │   │   ├── announce_remaining                                                                  4  0.01%
    │   │   ├── curr_tick                                                                           8  0.03%
    │   │   └── timeout_list                                                                        8  0.03%
    │   └── work.c                                                                                  8  0.03%
    │       └── pending_cancels                                                                     8  0.03%
    ├── lib                                                                                         8  0.03%
    │   ├── libc                                                                                    4  0.01%
    │   │   └── minimal                                                                             4  0.01%
    │   │       └── source                                                                          4  0.01%
    │   │           └── stdout                                                                      4  0.01%
    │   │               └── stdout_console.c                                                        4  0.01%
    │   │                   └── _stdout_hook                                                        4  0.01%
    │   └── os                                                                                      4  0.01%
    │       └── printk.c                                                                            4  0.01%
    │           └── _char_out                                                                       4  0.01%
    └── subsys                                                                                  13100 42.41%
        ├── bluetooth                                                                           10270 33.25%
        │   ├── host                                                                            10261 33.22%
        │   │   ├── att.c                                                                        1077  3.49%
        │   │   │   ├── _k_mem_slab_buf_att_slab                                                   68  0.22%
        │   │   │   ├── _k_mem_slab_buf_chan_slab                                                 328  1.06%
        │   │   │   ├── _k_mem_slab_buf_req_slab                                                   84  0.27%
        │   │   │   ├── att_slab                                                                   28  0.09%
        │   │   │   ├── cancel                                                                     28  0.09%
        │   │   │   ├── chan_slab                                                                  28  0.09%
        │   │   │   ├── net_buf_data_prep_pool                                                    325  1.05%
        │   │   │   ├── net_buf_prep_pool                                                         120  0.39%
        │   │   │   ├── prep_pool                                                                  40  0.13%
        │   │   │   └── req_slab                                                                   28  0.09%
        │   │   ├── buf.c                                                                        1328  4.30%
        │   │   │   ├── discardable_pool                                                           40  0.13%
        │   │   │   ├── hci_rx_pool                                                                40  0.13%
        │   │   │   ├── net_buf_data_discardable_pool                                             135  0.44%
        │   │   │   ├── net_buf_data_hci_rx_pool                                                  730  2.36%
        │   │   │   ├── net_buf_data_num_complete_pool                                              7  0.02%
        │   │   │   ├── net_buf_discardable_pool                                                   72  0.23%
        │   │   │   ├── net_buf_hci_rx_pool                                                       240  0.78%
        │   │   │   ├── net_buf_num_complete_pool                                                  24  0.08%
        │   │   │   └── num_complete_pool                                                          40  0.13%
        │   │   ├── conn.c                                                                        765  2.48%
        │   │   │   ├── acl_conns                                                                 192  0.62%
        │   │   │   ├── acl_tx_pool                                                                40  0.13%
        │   │   │   ├── callback_list                                                               4  0.01%
        │   │   │   ├── conn_change                                                                16  0.05%
        │   │   │   ├── conn_tx                                                                    48  0.16%
        │   │   │   ├── frag_pool                                                                  40  0.13%
        │   │   │   ├── free_tx                                                                    24  0.08%
        │   │   │   ├── net_buf_acl_tx_pool                                                        72  0.23%
        │   │   │   ├── net_buf_data_acl_tx_pool                                                  219  0.71%
        │   │   │   ├── net_buf_data_frag_pool                                                     62  0.20%
        │   │   │   └── net_buf_frag_pool                                                          48  0.16%
        │   │   ├── ecc.c                                                                          76  0.25%
        │   │   │   ├── dh_key_cb                                                                   4  0.01%
        │   │   │   ├── pub_key                                                                    64  0.21%
        │   │   │   └── pub_key_cb_slist                                                            8  0.03%
        │   │   ├── gatt.c                                                                        330  1.07%
        │   │   │   ├── callback_list                                                               8  0.03%
        │   │   │   ├── cf_cfg                                                                     32  0.10%
        │   │   │   ├── db_hash                                                                   120  0.39%
        │   │   │   ├── gatt_sc                                                                    88  0.28%
        │   │   │   ├── init                                                                        4  0.01%
        │   │   │   ├── last_static_handle                                                          2  0.01%
        │   │   │   ├── sc_ccc                                                                     24  0.08%
        │   │   │   ├── sc_cfg                                                                     24  0.08%
        │   │   │   ├── sc_restore_params                                                          24  0.08%
        │   │   │   └── service_init                                                                4  0.01%
        │   │   ├── hci_core.c                                                                   4314 13.97%
        │   │   │   ├── cmd_data                                                                   24  0.08%
        │   │   │   ├── disconnected_handles                                                        2  0.01%
        │   │   │   ├── hci_cmd_pool                                                               40  0.13%
        │   │   │   ├── net_buf_data_hci_cmd_pool                                                 140  0.45%
        │   │   │   ├── net_buf_hci_cmd_pool                                                       48  0.16%
        │   │   │   ├── ready_cb                                                                    4  0.01%
        │   │   │   ├── rx_thread_data                                                            128  0.41%
        │   │   │   ├── rx_thread_stack                                                          2232  7.23%
        │   │   │   ├── tx_thread_data                                                            128  0.41%
        │   │   │   └── tx_thread_stack                                                          1568  5.08%
        │   │   ├── hci_ecc.c                                                                    1428  4.62%
        │   │   │   ├── cmd_sem                                                                    24  0.08%
        │   │   │   ├── ecc                                                                        96  0.31%
        │   │   │   ├── ecc_thread_data                                                           128  0.41%
        │   │   │   ├── ecc_thread_stack                                                         1176  3.81%
        │   │   │   └── flags                                                                       4  0.01%
        │   │   ├── keys.c                                                                        144  0.47%
        │   │   │   ├── aging_counter_val                                                           4  0.01%
        │   │   │   ├── key_pool                                                                  136  0.44%
        │   │   │   └── last_keys_updated                                                           4  0.01%
        │   │   ├── l2cap.c                                                                       232  0.75%
        │   │   │   └── bt_l2cap_pool                                                             232  0.75%
        │   │   ├── settings.c                                                                     16  0.05%
        │   │   │   └── save_id_work                                                               16  0.05%
        │   │   └── smp.c                                                                         551  1.78%
        │   │       ├── bondable                                                                    1  0.00%
        │   │       ├── bt_smp_pool                                                               520  1.68%
        │   │       ├── oobd_present                                                                1  0.00%
        │   │       ├── sc_local_pkey_ready                                                        24  0.08%
        │   │       ├── sc_public_key                                                               4  0.01%
        │   │       └── sc_supported                                                                1  0.00%
        │   └── services                                                                            9  0.03%
        │       ├── bas.c                                                                           1  0.00%
        │       │   └── battery_level                                                               1  0.00%
        │       ├── dis.c                                                                           7  0.02%
        │       │   └── dis_pnp_id                                                                  7  0.02%
        │       └── hrs.c                                                                           1  0.00%
        │           └── hrs_blsc                                                                    1  0.00%
        ├── logging                                                                              2765  8.95%
        │   ├── log_backend_rtt.c                                                                  38  0.12%
        │   │   ├── backend_cb_log_backend_rtt                                                      8  0.03%
        │   │   ├── char_buf                                                                       16  0.05%
        │   │   ├── host_present                                                                    1  0.00%
        │   │   ├── log_output_rtt_control_block                                                   12  0.04%
        │   │   └── panic_mode                                                                      1  0.00%
        │   ├── log_backend_uart.c                                                                 25  0.08%
        │   │   ├── backend_cb_log_backend_uart                                                     8  0.03%
        │   │   ├── log_output_uart_control_block                                                  12  0.04%
        │   │   ├── uart_dev                                                                        4  0.01%
        │   │   └── uart_output_buf                                                                 1  0.00%
        │   ├── log_core.c                                                                       1642  5.32%
        │   │   ├── backend_attached                                                                1  0.00%
        │   │   ├── buffered_cnt                                                                    4  0.01%
        │   │   ├── dropped_cnt                                                                     4  0.01%
        │   │   ├── initialized                                                                     4  0.01%
        │   │   ├── list                                                                            8  0.03%
        │   │   ├── log_process_thread_sem                                                         24  0.08%
        │   │   ├── log_process_thread_timer                                                       56  0.18%
        │   │   ├── log_strdup_pool                                                                28  0.09%
        │   │   ├── log_strdup_pool_buf                                                           576  1.86%
        │   │   ├── logging_stack                                                                 800  2.59%
        │   │   ├── logging_thread                                                                128  0.41%
        │   │   ├── panic_mode                                                                      1  0.00%
        │   │   ├── proc_tid                                                                        4  0.01%
        │   │   └── timestamp_func                                                                  4  0.01%
        │   ├── log_msg.c                                                                        1052  3.41%
        │   │   ├── log_msg_pool                                                                   28  0.09%
        │   │   └── log_msg_pool_buf                                                             1024  3.32%
        │   └── log_output.c                                                                        8  0.03%
        │       ├── freq                                                                            4  0.01%
        │       └── timestamp_div                                                                   4  0.01%
        ├── pm                                                                                     24  0.08%
        │   └── power.c                                                                            24  0.08%
        │       ├── pm_notifiers                                                                    8  0.03%
        │       ├── post_ops_done                                                                   4  0.01%
        │       └── z_power_state                                                                  12  0.04%
        ├── settings                                                                               37  0.12%
        │   └── src                                                                                37  0.12%
        │       ├── settings.c                                                                     20  0.06%
        │       │   └── settings_lock                                                              20  0.06%
        │       ├── settings_init.c                                                                 1  0.00%
        │       │   └── settings_subsys_initialized                                                 1  0.00%
        │       └── settings_nvs.c                                                                 16  0.05%
        │           └── settings_nvs_itf                                                           16  0.05%
        └── storage                                                                                 4  0.01%
            └── flash_map                                                                           4  0.01%
                └── flash_map_default.c                                                             4  0.01%
                    └── flash_map                                                                   4  0.01%
==============================================================================================================
                                                                                                30888

it takes almost half the ram of the nrf52832

 and it seems to me very poor situation, any ideas how can i reduce ram take with ncs ? 

obviously i have many more things on my app that i will try to reduce but currently zephyr part in my app takes 80% of the ram ... it looks like there was no way for ncs supporting the smaller socs (below nrf52840, nrf53, nrf9160 etc.)

what is your say/ advice on that matter (and ideas for reducing ram take )? 

hope to read from you soon

best regards

Ziv

Parents
  • Hi Ziv, 

    Could you please provide your project ? 

    In most of our example with BLE, by default RAM requirement for Zephyr and the BLE stack takes about 28kB of RAM. Which is 43.5% of the RAM on the nRF52832. 
    But if you try the minimum configuration, for example by using the prj_minimal.conf in peripheral_lbs the RAM usage is reduced down to 19kB. This means no logging, no advanced feature like Data length update, PHY update , etc. 

  • hi Hung

    well i have been doing some ram reduction, mostly achieved by decreasing stacks sizes

    so my prj.conf looks like that now

    CONFIG_FLASH=y
    
    CONFIG_NUM_COOP_PRIORITIES=5
    CONFIG_NUM_PREEMPT_PRIORITIES=10
    
    CONFIG_CMSIS_DSP=y
    CONFIG_CMSIS_DSP_FASTMATH=y
    CONFIG_CMSIS_DSP_TRANSFORM=y
    CONFIG_CMSIS_DSP_FILTERING=y
    CONFIG_CMSIS_DSP_SUPPORT=y
    
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_CBPRINTF_FP_SUPPORT=y
    
    #Allow use of legacy devicetree macros
    # CONFIG_LEGACY_DEVICETREE_MACROS=y
    
    CONFIG_NO_OPTIMIZATIONS=n       #Compiler optimizations will be set to -O0 independently of other options.
    CONFIG_SIZE_OPTIMIZATIONS=y     #Compiler optimizations will be set to -Os independently of other options.
    CONFIG_SPEED_OPTIMIZATIONS=n    #Compiler optimizations will be set to -O2 independently of other options.
    CONFIG_DEBUG_OPTIMIZATIONS=n    #Compiler optimizations will be set to -Og independently of other options.
    
    CONFIG_TINYCBOR=y
    CONFIG_CBOR_FLOATING_POINT=y
    
    # BLE Related Configs
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_TPS=y
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_DIS_MANUF="Augury Inc."
    CONFIG_BT_DIS_SERIAL_NUMBER=y
    CONFIG_BT_DIS_FW_REV=y
    CONFIG_BT_DIS_HW_REV=y
    CONFIG_BT_DIS_SW_REV=n
    CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
    
    # Below is setup to let DIS information be read from settings
    CONFIG_SETTINGS_RUNTIME=y
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_NONE=y
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_DIS_SETTINGS=y
    CONFIG_BT_DIS_STR_MAX=50
    CONFIG_BT_GATT_CACHING=n
    CONFIG_BT_HCI_VS_EXT=n
    CONFIG_BT_LL_SW_SPLIT=y
    
    # I2C Related Configs
    CONFIG_I2C=y
    CONFIG_I2C_0=n
    CONFIG_I2C_GPIO=y
    
    # ADC Related Configs
    CONFIG_ADC=y
    CONFIG_ADC_ASYNC=y
    
    # Enable mcumgr.
    CONFIG_MCUMGR=y
    
    CONFIG_ASSERT=y
    CONFIG_WATCHDOG=y
    
    
    # Ensure an MCUboot-compatible binary is generated.
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem"   #mcuboot key
    CONFIG_MCUBOOT_IMAGE_VERSION="1.0.5"
    CONFIG_MCUBOOT_IMG_MANAGER=y
    
    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    
    
    # Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    
    
    
    # Required by the `taskstat` command.
    CONFIG_THREAD_MONITOR=y
    
    # Enable statistics and statistic names.
    CONFIG_STATS=y
    CONFIG_STATS_NAMES=y
    
    # Enable all core commands.
    CONFIG_MCUMGR_CMD_FS_MGMT=y
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    CONFIG_MCUMGR_CMD_STAT_MGMT=y
    
    
    # sensors
    CONFIG_NRFX_GPIOTE=y
    CONFIG_NRFX_PPI=y
    CONFIG_NRFX_TIMER0=y
    CONFIG_NRFX_TIMER1=y
    CONFIG_NRFX_TIMER2=y
    CONFIG_NRFX_TIMER3=y
    CONFIG_NRFX_TIMER4=y
    CONFIG_SPI=y
    CONFIG_SPI_ASYNC=y
    
    
    CONFIG_GPIO=y
    
    # LOG
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_BUFFER_SIZE=2048
    CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n
    
    # enable console over SEGGER RTT
    CONFIG_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=8192
    
    CONFIG_SENSOR=y
    CONFIG_TEMP_NRF5=y
    CONFIG_IIS3DWB=y
    CONFIG_IIS3DWB_CALC_REAL_ODR=y
    CONFIG_IIS3DWB_TRIGGER_OWN_THREAD=y
    CONFIG_IIS3DWB_FIFO_TH=36
    CONFIG_IIS3DWB_TEMPERATURE_SUPPORT=y
    CONFIG_IIS3DWB_FIFO_DATA_READY_INT_PIN_1=y
    
    
    CONFIG_AUGU_GPIO_POWER=y  #also in canary.conf
    
    
    CONFIG_FPU=y
    CONFIG_PM_DEVICE=y
    

    and the specific board 832.conf looks like this 

    
    CONFIG_BT_DEVICE_NAME="Halo_EP"
    CONFIG_BT_DIS_MODEL="Halo"
    
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=256
    CONFIG_BT_RX_STACK_SIZE=1024
    
    CONFIG_MAIN_STACK_SIZE=1024
    CONFIG_MPSL_SIGNAL_STACK_SIZE=640
    
    CONFIG_IDLE_STACK_SIZE=128
    CONFIG_ISR_STACK_SIZE=1024
    # keep CONFIG_HEAP_MEM_POOL_SIZE=16384 because this is needed by usb /nrfx modules
    # CONFIG_HEAP_MEM_POOL_SIZE=16384
    # CONFIG_HEAP_MEM_POOL_SIZE=10240
    # CONFIG_HEAP_MEM_POOL_SIZE=8192
    # CONFIG_HEAP_MEM_POOL_SIZE=4096
    # CONFIG_HEAP_MEM_POOL_SIZE=3600
    # CONFIG_HEAP_MEM_POOL_SIZE=2048
    # CONFIG_HEAP_MEM_POOL_SIZE=1024
    
    CONFIG_NRFX_SPIM=y
    CONFIG_NRFX_SPIM0=y
    
    # CONFIG_SERIAL=n
    
    # Configurations set based on thread analyzer output.
    # CONFIG_SDC_RX_STACK_SIZE=324
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    CONFIG_BT_HCI_TX_STACK_SIZE=640
    
    
    # Disable features not needed
    # CONFIG_TIMESLICING=n
    # CONFIG_MINIMAL_LIBC_MALLOC=n
    
    # Disable Bluetooth features not needed
    CONFIG_BT_DEBUG_NONE=y
    CONFIG_BT_ASSERT=n
    # CONFIG_BT_DATA_LEN_UPDATE=n
    CONFIG_BT_PHY_UPDATE=n
    # CONFIG_BT_GATT_CACHING=n
    # CONFIG_BT_GATT_SERVICE_CHANGED=n
    # CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
    # CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
    # CONFIG_BT_HCI_VS_EXT=n
    
    
    # Disable Bluetooth controller features not needed
    CONFIG_BT_CTLR_PRIVACY=n
    CONFIG_BT_CTLR_PHY_2M=n
    # Reduce Bluetooth buffers
    CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=1
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=43
    CONFIG_BT_BUF_EVT_RX_COUNT=2
    
    CONFIG_BT_CONN_TX_MAX=2
    CONFIG_BT_L2CAP_TX_BUF_COUNT=2
    CONFIG_BT_CTLR_RX_BUFFERS=1
    CONFIG_BT_BUF_ACL_TX_COUNT=3
    CONFIG_BT_BUF_ACL_TX_SIZE=27
    

    but i get this assertion when i try to run (soc is nrf52832, not happening for the nrf52840 board)

    what is also strange to me that in the other board (for nrf52840) which also has some other sensors, it .conf looks like this:

    CONFIG_BOARD_USE_NFC=y
    CONFIG_BOARD_LEDS=y
    CONFIG_LEDS_DEBUG=n
    CONFIG_LEDS_PRODUCTION=y
    
    CONFIG_BT_DEVICE_NAME="Canary_EP"
    CONFIG_BT_DIS_MODEL="Canary"
    
    # NFC Related Configs
    CONFIG_NFC_T2T_NRFXLIB=y
    CONFIG_NFC_NDEF=y
    CONFIG_NFC_NDEF_MSG=y
    CONFIG_NFC_NDEF_RECORD=y
    CONFIG_NFC_NDEF_TEXT_RECORD=y
    
    
    # Enable flash operations.
    CONFIG_FLASH_JESD216_API=y
    CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n
    CONFIG_FLASH_TESTS=n
    
    # Some command handlers require a large stack.
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    CONFIG_LIS2DW12=n
    CONFIG_LIS2DW12_TRIGGER_OWN_THREAD=y
    
    CONFIG_LTC3335=y
    CONFIG_LTC3335_PRE_SCALAR=8
    
    
    # from prj_re4_lis.conf:
    CONFIG_AUGU_LIS3MDL=y
    CONFIG_AUGU_LIS3MDL_TRIGGER_OWN_THREAD=y
    CONFIG_AUGU_LIS3MDL_CALC_REAL_ODR=y
    
    CONFIG_AUGU_SI7210=y
    
    CONFIG_AUGU_FLASH_W25N=y
    
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y

    if i look at the build/zephyr/.config file i see that in the nrf there is =y for all spi and spim and in the other board (with the nrf52832 soc) i have to implicitly add 

    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    
    [00000023] <inf> AUGU_GPIO_POWER: augu_power_resource_init: SENSORS_ON
    [00000024] <inf> IIS3DWB: iis3dwb_init
    [00000024] <inf> IIS3DWB: iis3dwb_init: buff size = 1440, unit size = 10, queue size = 144
    [00000026] <err> IIS3DWB: master bus not found: SPI_1
    ASSERTION FAIL [z_spin_lock_valid(l)] @ WEST_TOPDIR/zephyr/include/spinlock.h:129
    
      Recursive spinlock 0x5a7
    
    [00000035] <err> os: r0/a1:  0x00000004  r1/a2:  0x00000081  r2/a3:  0x00000007
    [00000035] [1;31m<err> os: r3/a4:  0x00000000 r12/ip:  0x80000000 r14/lr:  0x000183ff
    [00000035] <err> os:  xpsr:  0x41000000
    [00000036] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
    [00000037] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
    [00000037] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
    [00000038] <err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
    [00000038] <err> os: fpscr:  0x000000000m
    [00000038] <err> os: Faulting instruction address (r15/pc): 0x0003d224
    [00000038] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
    [00000039] <err> os: Current thread: 0x20004c50 (main)
    [00020458] [1;31m<err> fatal_error: Resetting system
    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***

    the assertion is after this function call in my code (it never reaches the function after):

    static int iis3dwb_init_interface(const struct device *dev)
    {
    	struct iis3dwb_data *iis3dwb = dev->data;
    	const struct iis3dwb_device_config *cfg = dev->config;
    	
    	iis3dwb->iis_spi_data.augu_spi.spi_dev = device_get_binding(cfg->bus_name);
    	if (!iis3dwb->iis_spi_data.augu_spi.spi_dev) {
    		LOG_ERR("master bus not found: %s", cfg->bus_name);
    		return -EINVAL;
    	}

    so first, is it a default configuration difference between the 2 boards (for soc 52840 vs soc 52832) with regards to spi/spim ??

    and second, what is the meaning of the assertion which happens even if i add this to the board with the nrf52832 ??

    CONFIG_NRFX_SPIM1=y
    CONFIG_NRFX_SPIM2=y
    
    CONFIG_NRFX_SPI=y
    CONFIG_NRFX_SPI0=y
    CONFIG_NRFX_SPI1=y
    CONFIG_NRFX_SPI2=y

    (i can also add the .config files of each build if that will help)

    p.s.

    if i add this to my nrf832.conf

    'CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y'
    then it passes the previose assertion place but still assert and i am not sure where yet:
    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    
    [00000023] <inf> AUGU_GPIO_POWER: augu_power_resource_init: SENSORS_ON
    [00000024] <inf> IIS3DWB: iis3dwb_init
    [00000024] <inf> IIS3DWB: iis3dwb_init: buff size = 1440, unit size = 10, queue size = 144
    [00000026] <inf> IIS3DWB: iis3dwb_spi_uninit done
    [00001676] <inf> IIS3DWB: iis3dwb_spi_init done
    [00002343] <inf> IIS3DWB: good chip ID 1230m
    [00002364] <inf> IIS3DWB: init timer (timer instance ID = 3)
    [00002364] <inf> IIS3DWB: nrfx_ppi_channel_alloc: chan = 0[0m
    [00002374] <inf> IIS3DWB: iis3dwb_spi_uninit done
    ASSERTION FAIL [z_spin_lock_valid(l)] @ WEST_TOPDIR/zephyr/include/spinlock.h:129
    
      Recursive spinlock 0x5a7
    
    [04409371] <err> os: r0/a1:  0x00000004  r1/a2:  0x00000081  r2/a3:  0x0000000c
    [04409371] <err> os: r3/a4:  0x00000000 r12/ip:  0x80000000 r14/lr:  0x000183ff
    [04409372] <err> os:  xpsr:  0x61000000[0m
    [04409372] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
    [04409373] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
    [04409373] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
    [04409374] <err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
    [04409374] <err> os: fpscr:  0x00000000
    [04409374] <err> os: Faulting instruction address (r15/pc): 0x0003df9c
    [04409374] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
    [04409375] <err> os: Current thread: 0x20004d38 (main)
    [04429301] <err> fatal_error: Resetting system
    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***

    hope to read from you soon

    best regards

    Ziv 

  • Hi Ziv, 

    I think we need to go step by step.

    Have you managed to make any working firmware running on nRF52832 that accessing SPI + BLE without any RAM reduction configuration ?

    I don't think having basic SPI and BLE would exceed the RAM size of the nRF52832. 

     I noticed that you have both I2C(TWI) and SPI enable. Please be aware that that they share the same instance ID and can't be used at the same time (for example SPI0 and TWI0). Here is from the nRF52832 spec:


Reply
  • Hi Ziv, 

    I think we need to go step by step.

    Have you managed to make any working firmware running on nRF52832 that accessing SPI + BLE without any RAM reduction configuration ?

    I don't think having basic SPI and BLE would exceed the RAM size of the nRF52832. 

     I noticed that you have both I2C(TWI) and SPI enable. Please be aware that that they share the same instance ID and can't be used at the same time (for example SPI0 and TWI0). Here is from the nRF52832 spec:


Children
  • hi Hung

    I noticed that you have both I2C(TWI) and SPI enable. Please be aware that that they share the same instance ID and can't be used at the same time (for example SPI0 and TWI0)

    yes i am aware of that but thanks for mentioning

    i have managed to build and run and i will put my configs here to maybe help some searchers 

    #prj.conf
    CONFIG_NUM_COOP_PRIORITIES=5
    CONFIG_NUM_PREEMPT_PRIORITIES=10
    
    CONFIG_NEWLIB_LIBC=y
    CONFIG_CMSIS_DSP=y
    CONFIG_CMSIS_DSP_FASTMATH=y
    CONFIG_CMSIS_DSP_TRANSFORM=y
    CONFIG_CMSIS_DSP_FILTERING=y
    CONFIG_CMSIS_DSP_SUPPORT=y
    
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_CBPRINTF_FP_SUPPORT=y
    
    #Allow use of legacy devicetree macros
    # CONFIG_LEGACY_DEVICETREE_MACROS=y
    
    CONFIG_NO_OPTIMIZATIONS=n       #Compiler optimizations will be set to -O0 independently of other options.
    CONFIG_SIZE_OPTIMIZATIONS=y     #Compiler optimizations will be set to -Os independently of other options.
    CONFIG_SPEED_OPTIMIZATIONS=n    #Compiler optimizations will be set to -O2 independently of other options.
    CONFIG_DEBUG_OPTIMIZATIONS=n    #Compiler optimizations will be set to -Og independently of other options.
    
    CONFIG_TINYCBOR=y
    CONFIG_CBOR_FLOATING_POINT=y
    
    # BLE Related Configs
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_TPS=y
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_DIS_MANUF="Augury Inc."
    CONFIG_BT_DIS_SERIAL_NUMBER=y
    CONFIG_BT_DIS_FW_REV=y
    CONFIG_BT_DIS_HW_REV=y
    CONFIG_BT_DIS_SW_REV=n
    CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
    
    # Below is setup to let DIS information be read from settings
    CONFIG_SETTINGS_RUNTIME=y
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_NONE=y
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_DIS_SETTINGS=y
    CONFIG_BT_DIS_STR_MAX=50
    CONFIG_BT_GATT_CACHING=n
    CONFIG_BT_HCI_VS_EXT=n
    CONFIG_BT_LL_SW_SPLIT=y
    
    # I2C Related Configs
    CONFIG_I2C=y
    CONFIG_I2C_0=n
    CONFIG_I2C_GPIO=y
    
    # ADC Related Configs
    CONFIG_ADC=y
    CONFIG_ADC_ASYNC=y
    
    # Enable mcumgr.
    CONFIG_MCUMGR=y
    
    CONFIG_ASSERT=y
    CONFIG_WATCHDOG=y
    
    
    # Ensure an MCUboot-compatible binary is generated.
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem"   #mcuboot key
    CONFIG_MCUBOOT_IMAGE_VERSION="1.1.3"
    CONFIG_MCUBOOT_IMG_MANAGER=y
    
    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    
    
    # Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    
    # Enable flash operations.
    CONFIG_FLASH=y
    CONFIG_FLASH_JESD216_API=y
    CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n
    
    # Enable the LittleFS file system.
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y
    
    # Required by the `taskstat` command.
    CONFIG_THREAD_MONITOR=y
    
    # Enable statistics and statistic names.
    CONFIG_STATS=y
    CONFIG_STATS_NAMES=y
    
    # Enable all core commands.
    CONFIG_MCUMGR_CMD_FS_MGMT=y
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    CONFIG_MCUMGR_CMD_STAT_MGMT=y
    
    
    # sensors
    CONFIG_NRFX_GPIOTE=y
    CONFIG_NRFX_PPI=y
    CONFIG_NRFX_TIMER0=y
    CONFIG_NRFX_TIMER1=y
    CONFIG_NRFX_TIMER2=y
    CONFIG_NRFX_TIMER3=y
    CONFIG_NRFX_TIMER4=y
    CONFIG_SPI=y
    CONFIG_SPI_ASYNC=y
    
    
    CONFIG_GPIO=y
    
    # LOG
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_BUFFER_SIZE=2048
    CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n
    
    # enable console over SEGGER RTT
    CONFIG_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=8192
    
    CONFIG_SENSOR=y
    CONFIG_TEMP_NRF5=y
    CONFIG_IIS3DWB=y
    CONFIG_IIS3DWB_CALC_REAL_ODR=y
    CONFIG_IIS3DWB_TRIGGER_OWN_THREAD=y
    CONFIG_IIS3DWB_FIFO_TH=36
    CONFIG_IIS3DWB_TEMPERATURE_SUPPORT=y
    CONFIG_IIS3DWB_FIFO_DATA_READY_INT_PIN_1=y
    
    #myboard.conf
    CONFIG_AUGU_GPIO_POWER=y 
    
    
    CONFIG_FPU=y
    CONFIG_PM_DEVICE=y
    
    
    # SPI Flash
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y
    CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    
    # Enable flash operations.
    CONFIG_FLASH_MAP=y
    CONFIG_FLASH_TESTS=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_25LP128=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_BT_RX_STACK_SIZE=1024
    
    # CONFIG_MAIN_STACK_SIZE=1024
    CONFIG_MPSL_SIGNAL_STACK_SIZE=640
    
    CONFIG_IDLE_STACK_SIZE=128
    CONFIG_ISR_STACK_SIZE=1024
    # keep CONFIG_HEAP_MEM_POOL_SIZE=16384 because this is needed by usb /nrfx modules
    # CONFIG_HEAP_MEM_POOL_SIZE=16384
    # CONFIG_HEAP_MEM_POOL_SIZE=10240
    # CONFIG_HEAP_MEM_POOL_SIZE=8192
    # CONFIG_HEAP_MEM_POOL_SIZE=4096
    # CONFIG_HEAP_MEM_POOL_SIZE=3600
    # CONFIG_HEAP_MEM_POOL_SIZE=2048
    CONFIG_HEAP_MEM_POOL_SIZE=1024
    
    CONFIG_NRFX_SPIM=y
    CONFIG_NRFX_SPIM1=y
    
    CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y
    
    # CONFIG_SERIAL=n
    
    # Configurations set based on thread analyzer output.
    # CONFIG_SDC_RX_STACK_SIZE=324
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    CONFIG_BT_HCI_TX_STACK_SIZE=640
    
    
    # Disable features not needed
    # CONFIG_TIMESLICING=n
    # CONFIG_MINIMAL_LIBC_MALLOC=n
    
    # Disable Bluetooth features not needed
    # CONFIG_BT_DEBUG_NONE=y
    # CONFIG_BT_ASSERT=n
    # CONFIG_BT_DATA_LEN_UPDATE=n
    CONFIG_BT_PHY_UPDATE=n
    # CONFIG_BT_GATT_CACHING=n
    # CONFIG_BT_GATT_SERVICE_CHANGED=n
    # CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
    # CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
    # CONFIG_BT_HCI_VS_EXT=n
    
    
    # Disable Bluetooth controller features not needed
    CONFIG_BT_CTLR_PRIVACY=n
    CONFIG_BT_CTLR_PHY_2M=n
    # Reduce Bluetooth buffers
    CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=1
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=43
    CONFIG_BT_BUF_EVT_RX_COUNT=2
    
    CONFIG_BT_CONN_TX_MAX=2
    CONFIG_BT_L2CAP_TX_BUF_COUNT=2
    CONFIG_BT_CTLR_RX_BUFFERS=1
    CONFIG_BT_BUF_ACL_TX_COUNT=3
    CONFIG_BT_BUF_ACL_TX_SIZE=27
    

    my issue now is actually working with spi_nor module for an external flash i have, i opened a new thread for that:  

    https://devzone.nordicsemi.com/f/nordic-q-a/88263/using-spi_nor-driver-with-nrf-sdk-connect-zephyr---driver-not-found

    best regards

    Ziv

Related