I2S传输报错 fatal error on ISR 怎么调试解决

蓝牙传输数据使用i2s输出,播放音乐就会报错

[16:03:51.948] [283678] I/audio deplayback_th: audio_open type=1 d=253 rw=1 tx cache=8192 rx cache=0

[16:03:51.948] [283689] I/audio audiosvr: audio cmd=0

[16:03:51.949] [283694] I/audio audiosvr: audio_client_start h=2001f500 n=a2dp t=1 f=1 d=253

[16:03:51.950] [283704] I/audio audiosvr: notify listern(0, 0)

[16:03:51.951] [283710] I/audio audiosvr: audio_device_open in d=0 busy=0 reg=1 c=0x2001f500

[16:03:51.951] [283719] I/audio audiosvr: device 0 info reg=1 busy=

[16:03:51.951] 0:

[16:03:51.952] [283726] I/audio audiosvr: device 0 info end

[16:03:51.953] [283732] I/audio audiosvr: server first stream

[16:03:51.953] [283737] I/audio audiosvr: device 0 first stream

[16:03:51.954] [283744] I/audio audiosvr: device count tx=0 rx=0 busy=0

[16:03:51.955] [283751] I/audio audiosvr: hardware_device_open i

[16:03:51.955] n: r=0 t=0 b=0 d=0 c=0x0x2001f500 f=1

[16:03:51.956] [283761] I/audio audiosvr: audio_device_speaker_open in r=0 t=0 c=0x0x2001f500 f=1

[16:03:51.957] [283773] I/audio audiosvr: need init tx=1 rx=0

[16:03:51.958] [283779] I/drv.audprc audiosvr: set g_eq_enable=1

[16:03:51.959] [283786] I/audio audiosvr: (tx rx

[16:03:51.959] ): ch[2,0] rate(44100 0)

[16:03:51.959] [283794] I/audio audiosvr: i2

[16:03:51.959] s: samplerate=44100 ch=2

[16:03:51.960] [283801] I/drv.i2s_audio audiosvr: Configure audio chn 2, samplerate 44100, bitwidth 16

[16:03:51.960]

[16:03:51.961] [283812] I/drv.i2s_audio audiosvr: I2S use exteranl interface 0

[16:03:51.961]

[16:03:51.962] [283820] I/audio audiosvr: open PA, unmute DAC

[16:03:51.963] sifli[283826] I/audio ISR: start_rx need_adc_rx=0

[16:03:51.964] Assertion failed at function:bf0_audio_trans, line numbe

[16:03:51.964] r:846 ,(size <= AUDIO_DATA_SIZE / 2)

[16:03:51.964] Previous ISR enable 0

[16:03:51.964] ===================

[16:03:51.965] Thread Info

[16:03:51.965] ===================

[16:03:51.966] pri status sp top stack size max used left tick error

[16:03:51.967] ------------- — ------- ---------- ---------- ---------- ------ ---------- —

[16:03:51.968] i2s_health 29 suspend 0x20021188 0x20021288 0x00000400 73% 0x0000000f 000

[16:03:51.969] bts 12 ready 0x20020d60 0x20020e70 0x00000c00 51% 0x00000007 000

[16:03:51.970] KE_EVT3 10 suspend 0x2001ef80 0x2001eff4 0x00000400 36% 0x00000014 000

[16:03:51.971] KE_EVT0 25 suspend 0x2001ea48 0x2001eac0 0x00000400 12% 0x00000014 000

[16:03:51.972] KE_EVT2 12 suspend 0x2001e380 0x2001e47c 0x00001000 22% 0x0000000e 000

[16:03:51.973] tshell 20 suspend 0x200186c8 0x20018844 0x00001000 16% 0x0000000a 000

[16:03:51.974] deplayback_th 12 ready 0x2000ee90 0x2000f028 0x00000800 43% 0x00000006 000

[16:03:51.975] bt_downvoice 11 suspend 0x2000bcf0 0x2000be10 0x000007d0 37% 0x00000009 000

[16:03:51.976] audiosvr 11 ready 0x2000df58 0x2000e210 0x00002400 11% 0x00000006 000

[16:03:51.977] tidle 31 ready 0x20011618 0x2001166c 0x00000200 23% 0x00000004 000

[16:03:51.978] timer 4 suspend 0x200094e0 0x20009534 0x00000400 08% 0x00000009 000

[16:03:51.979] main 10 suspend 0x200168b0 0x200169cc 0x00000800 40% 0x00000010 000

[16:03:51.979] ===================

[16:03:51.979] Mailbox Info

[16:03:51.979] ===================

[16:03:51.980] entry size suspend thread

[16:03:51.980] ------- ---- ---- --------------

[16:03:51.980] bt_app 0000 0008 0

[16:03:51.981] ===================

[16:03:51.981] MessageQueue Info

[16:03:51.981] ===================

[16:03:51.981] entry suspend thread

[16:03:51.982] -------- ---- --------------

[16:03:51.982] ===================

[16:03:51.982] Mutex Info

[16:03:51.982] ===================

[16:03:51.983] owner hold suspend thread

[16:03:51.983] --------------- -------- ---- --------------

[16:03:51.983] bts2_mu (null) 0000 0

[16:03:51.984] bts2_mu (null) 0000 0

[16:03:51.984] bts2_mu (null) 0000 0

[16:03:51.984] ble_flash_mutex (null) 0000 0

[16:03:51.985] audio_svr audiosvr 0001 0

[16:03:51.985] rtc (null) 0000 0

[16:03:51.986] ulog lock audiosvr 0001 0

[16:03:51.986] fslock (null) 0000 0

[16:03:51.986] i2c_bus_lock (null) 0000 0

[16:03:51.987] i2c_bus_lock (null) 0000 0

[16:03:51.987] i2c_bus_lock (null) 0000 0

[16:03:51.987] ===================

[16:03:51.988] Semaphore Info

[16:03:51.988] ===================

[16:03:51.988] v suspend thread

[16:03:51.989] ------------------- — --------------

[16:03:51.989] bt_avrcp_vol_change 001 0

[16:03:51.989] bt_av_sink 001 0

[16:03:51.989] bts2_ev 001 0

[16:03:51.990] KE 000 1:KE_EVT3

[16:03:51.991] KE 000 1:KE_EVT0

[16:03:51.991] ke_mem_ext 001 0

[16:03:51.991] ke_mem_ext 001 0

[16:03:51.991] ke_mem_ext 001 0

[16:03:51.992] ke_mem_ext 001 0

[16:03:51.992] KE 000 1:KE_EVT2

[16:03:51.992] sifli 000 0

[16:03:51.993] shrx 000 0

[16:03:51.993] epic 001 0

[16:03:51.993] aes_drv 001 0

[16:03:51.993] drv_eDma 001 0

[16:03:51.994] gpadc 001 0

[16:03:51.994] i2c4 000 0

[16:03:51.994] i2c2 000 0

[16:03:51.995] i2c1 000 0

[16:03:51.995] heap 001 0

[16:03:51.995] flash2 001 0

[16:03:51.996] ===================

[16:03:51.996] Memory Info

[16:03:51.996] ===================

[16:03:51.997] total memory: 433284 used memory : 65624 maximum allocated memor

[16:03:51.997] y: 65624

[16:03:51.997] ===================

[16:03:51.997] MemoryHeap Info

[16:03:51.998] ===================

[16:03:51.998] pool size max used size available size

[16:03:51.999] ------- ---------- ------------- --------------

[16:03:51.999] =====================

[16:03:52.000] PSP: 0x0x2000dfa0, MS

[16:03:52.000] P: 0x0x20001efc

[16:03:52.000] =====================

[16:03:52.000] sp: 0x20001f58

[16:03:52.000] psr: 0x40000046

[16:03:52.000] r00: 0x00000000

[16:03:52.000] r01: 0x00000017

[16:03:52.001] r02: 0x000002bb

[16:03:52.001] r03: 0x30000000

[16:03:52.001] r12: 0x12061115

[16:03:52.001] lr: 0x1204d143

[16:03:52.001] pc: 0x1204d143

[16:03:52.003] =====================

[16:03:52.003] fatal error on ISR

在 audio_server.c 中

#if defined(SOFTWARE_TX_MIX_ENABLE) || defined(AUDIO_RX_USING_I2S) || defined(AUDIO_TX_USING_I2S)
#define TX_DMA_SIZE (CODEC_DATA_UNIT_LEN)

TX_DMA_SIZE 的大小應該是 320,有設定 AUDIO_RX_USING_I2S 這個宏嗎?

或者強制將 TX_DMA_SIZE 定義為 CODEC_DATA_UNIT_LEN

AUDIO_DATA_SIZE 在頭文件中,應該是 640,確認一下是否如此

或强制把TX_DMA_SIZE定义为CODEC_DATA_UNIT_LEN, 在audio_server.c里

企業微信截圖_17623310269087

CONFIG_AUDIO_RX_USING_I2S=y