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


#define SAMPLE_FREQUENCY    16000
#define NUMBER_OF_CHANNELS  1
#define SAMPLE_BIT_WIDTH    16
#define BYTES_PER_SAMPLE    sizeof(int16_t)
#define SAMPLES_PER_BLOCK   ((SAMPLE_FREQUENCY / 10) * NUMBER_OF_CHANNELS)
#define ZEPHYR_AUDIO_BLOCK_COUNT ZEPHYR_AUDIO_INITIAL_BLOCKS + 32

#define SLAB_BUFFER_SIZE (ZEPHYR_AUDIO_BLOCK_SIZE * ZEPHYR_AUDIO_BLOCK_COUNT)

static uint8_t __attribute__((section("OCRAM"))) rx_slab_buffer[SLAB_BUFFER_SIZE];
static uint8_t __attribute__((section("OCRAM"))) tx_slab_buffer[SLAB_BUFFER_SIZE];

При компиляции:
[7/7] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:     1170252 B         4 MB     27.90%
             RAM:      321116 B        32 MB      0.96%
            ITCM:        7880 B        32 KB     24.05%
            DTCM:       83584 B       160 KB     51.02%
           OCRAM:        3392 B        64 KB      5.18%
        IDT_LIST:          0 GB        32 KB      0.00%

При работе:
s_good(slab, slab->free_list)] @ WEST_TOPDIR/zephyr/kernel/mem_slab.c:234
        slab corruption detected
[00:00:25.116,000] <err> os: r0/a1:  0x00000004  r1/a2:  0x000000ea  r2/a3:  0x00000002
[00:00:25.116,000] <err> os: r3/a4:  0x00000004 r12/ip:  0x0000621c r14/lr:  0x6003b7df
[00:00:25.116,000] <err> os:  xpsr:  0x01000016
[00:00:25.116,000] <err> os: s[ 0]:  0x8001950c  s[ 1]:  0x80024744  s[ 2]:  0x00000000  s[ 3]:  0x800041ac
[00:00:25.116,000] <err> os: s[ 4]:  0x600d75b0  s[ 5]:  0x00000000  s[ 6]:  0x80024740  s[ 7]:  0x00000000
[00:00:25.116,000] <err> os: s[ 8]:  0x80004300  s[ 9]:  0x60031f23  s[10]:  0x600d75b0  s[11]:  0x00000005
[00:00:25.116,000] <err> os: s[12]:  0x00000061  s[13]:  0x20201060  s[14]:  0x00000000  s[15]:  0x600d7424
[00:00:25.116,000] <err> os: fpscr:  0x600dada8
[00:00:25.116,000] <err> os: Faulting instruction address (r15/pc): 0x600bd1d4
[00:00:25.116,000] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:25.116,000] <err> os: Fault during interrupt handling

Это неудивительно, т.к. буфера slab i2s должны занимать намного больше места в OCRAM, а при компиляции пишет 3392B