Загрузка данных


uart:~$ kernel thread list
Scheduler: 56 since last call
Threads:
 0x80009088 clock     
        options: 0x2, priority: 12 timeout: 51
        state: sleeping, entry: 0x60015c85
        Total execution cycles: 44646962 (46 %)
        stack size 16384, unused 15144, usage 1240 / 16384 (7 %)

 0x80008f38 pa_thread_hnd_out
        options: 0x0, priority: 11 timeout: 0
        state: pending, entry: 0x60015c85
        Total execution cycles: 218327142 (1 %)
        stack size 2048, unused 1456, usage 592 / 2048 (28 %)

 0x80008de8 i2s_thread_out
        options: 0x0, priority: 11 timeout: 5063
        state: pending, entry: 0x60015c85
        Total execution cycles: 61242295 (0 %)
        stack size 1024, unused 680, usage 344 / 1024 (33 %)

 0x80008c98 pa_thread_hnd_in
        options: 0x0, priority: 11 timeout: 0
        state: pending, entry: 0x60015c85
        Total execution cycles: 6466835 (0 %)
        stack size 2048, unused 1704, usage 344 / 2048 (16 %)

 0x80008b48 i2s_thread_in
        options: 0x0, priority: 11 timeout: 1
        state: pending, entry: 0x60015c85
        Total execution cycles: 26452583 (0 %)
        stack size 1024, unused 712, usage 312 / 1024 (30 %)

 0x800089f8 pjsua_0   
        options: 0Ix22, S_IN: Failed to read data: -5
priority: 12 timeout: 12
        state: pending, entry: 0x60015c85
        Total execution cycles: 1220821932 (6 %)
        stack size 20480, unused 7040, usage 13440 / 20480 (65 %)

 0x800088a8 ev_thread 
        options: 0x0, priority: 12 timeout: 0
        state: pending, entry: 0x60015c85
        Total execution cycles: 77685 (0 %)
        stack size 1024, unused 752, usage 272 / 1024 (26 %)

 0x80008758 media     
        options: 0x2, priority: 12 timeout: 47
        state: sleeping, entry: 0x60015c85
        Total execution cycles: 165835344 (0 %)
        stack size 4096, unused 2448, usage 1648 / 4096 (40 %)

 0x80008608 main_thread
        options: 0x2, priority: 10 timeout: 5259
        state: sleeping, entry: 0x60015c85
        Total execution cycles: 595826002 (3 %)
        stack size 30720, unused 14304, usage 16416 / 30720 (53 %)

 0x80009440 usbd_msc  
        options: 0x0, priority: -1 timeout: 0
        state: pending, entry: 0x6001a6e1
        Total execution cycles: 29998 (0 %)
        stack size 1024, unused 736, usage 288 / 1024 (28 %)

 0x80007ba0 lcd_thread_id
        options: 0x0, priority: 13 timeout: 0
        state: pending, entry: 0x6000c051
        Total execution cycles: 16722 (0 %)
        stack size 1024, unused 760, usage 264 / 1024 (25 %)

 0x80009558 input     
        options: 0x0, priority: 14 timeout: 0
        state: pending, entry: 0x6001b451
        Total execution cycles: 13502 (0 %)
        stack size 1024, unused 776, usage 248 / 1024 (24 %)

 0x80009978 rx_q[0]   
        options: 0x0, priority: -1 timeout: 0
        state: pending, entry: 0x600c28c7
        Total execution cycles: 22945637 (0 %)
        stack size 2048, unused 1632, usage 416 / 2048 (20 %)

 0x80009820 net_mgmt  
        options: 0x0, priority: -1 timeout: 0
        state: pending, entry: 0x6003c87d
        Total execution cycles: 8512 (0 %)
        stack size 896, unused 656, usage 240 / 896 (26 %)

 0x80009b28 tcp_work  
        options: 0x0, priority: -14 timeout: 0
        state: pending, entry: 0x6003c87d
        Total execution cycles: 10073 (0 %)
        stack size 1024, unused 784, usage 240 / 1024 (23 %)

 0x80009328 usbd      
        options: 0x0, priority: -8 timeout: 0
        state: pending, entry: 0x6001911d
        Total execution cycles: 19944 (0 %)
        stack size 1024, unused 768, usage 256 / 1024 (25 %)

*0x80008230 shell_uart
        options: 0x0, priority: 14 timeout: 0
        state: queued, entry: 0x60011fa9
        Total execution cycles: 73553035 (0 %)
        stack size 2048, unused 924, usage 1124 / 2048 (54 %)

 0x8000a200 sysworkq  
        options: 0x1, priority: -1 timeout: -9223372036854775808
        state: pending, entry: 0x6003c87d
        Total execution cycles: 7469498 (0 %)
        stack size 1664, unused 1200, usage 464 / 1664 (27 %)

 0x80009c70 udc_work_q
        options: 0x0, priority: -1 timeout: 0
        state: pending, entry: 0x6003c87d
        Total execution cycles: 7964 (0 %)
        stack size 512, unused 272, usage 240 / 512 (46 %)

 0x80009da8 ENET_RX   
        options: 0x2, priority: -14 timeout: 0
        state: pending, entry: 0x6003c87d
        Total execution cycles: 25246371 (0 %)
        stack size 2048, unused 1552, usage 496 / 2048 (24 %)

 0x80007cd8 logging   
        options: 0x0, priority: 14 timeout: -9223372036854775808
        state: pending, entry: 0x6000f755
        Total execution cycles: 1094641 (0 %)
        stack size 2048, unused 1688, usage 360 / 2048 (17 %)

 0x80009f90 idle      
        options: 0x1, priority: 15 timeout: 0
        state: , entry: 0x6003b9dd
        Total execution cycles: 3166339280 (40 %)
        stack size 384, unused 312, usage 72 / 384 (18 %)


[7/7] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:     1170228 B         4 MB     27.90%
             RAM:      319324 B        32 MB      0.95%
            ITCM:        7880 B        32 KB     24.05%
            DTCM:      110784 B       160 KB     67.62%
           OCRAM:          0 GB        64 KB      0.00%
        IDT_LIST:          0 GB        32 KB      0.00%

i2s буфера в DTCM

#define SAMPLE_FREQUENCY    8000
#define NUMBER_OF_CHANNELS  1
#define SAMPLE_BIT_WIDTH    16
#define BYTES_PER_SAMPLE    sizeof(int16_t)

#define ZEPHYR_AUDIO_INITIAL_BLOCKS 2

/* Such block length provides an echo with the delay of 50 ms. */
#define SAMPLES_PER_BLOCK   ((SAMPLE_FREQUENCY / 40) * NUMBER_OF_CHANNELS)
// 34 block's per 20ms
#define ZEPHYR_AUDIO_BLOCK_COUNT ZEPHYR_AUDIO_INITIAL_BLOCKS + 32

#define ZEPHYR_AUDIO_BLOCK_SIZE  (BYTES_PER_SAMPLE * SAMPLES_PER_BLOCK)

K_MEM_SLAB_DEFINE_IN_SECT_STATIC(mem_slab_rx, __dtcm_noinit_section, ZEPHYR_AUDIO_BLOCK_SIZE, ZEPHYR_AUDIO_BLOCK_COUNT, 4);
K_MEM_SLAB_DEFINE_IN_SECT_STATIC(mem_slab_tx, __dtcm_noinit_section, ZEPHYR_AUDIO_BLOCK_SIZE, ZEPHYR_AUDIO_BLOCK_COUNT, 4);