Part Number:PROCESSOR-SDK-AM335X
Hi,
We meet a problem about reading the ADC in AM335X platform, the problem is as below:
1- The application is stuck while getting the ADC, the staus of the process is "D (Disk sleep)"
2- The stack of the process is as below:
[<c0599c9c>] am335x_tsc_se_set_once+0x138/0x1a0
[<c0781f3c>] tiadc_read_raw+0xe4/0x1b4
[<c077d174>] iio_channel_read+0xa8/0xb8
[<c077d220>] iio_read_channel_raw+0x4c/0x6c
[<bf09c070>] wfet_adc_read+0x70/0xb8 [wfos_adc]
[<bf0a4358>] wfet_battery_voltage_get_by_chan+0xc0/0xf8 [wfos_pm]
[<bf0a4650>] wfet_battery_read+0x54/0xdc [wfos_pm]
[<c0274684>] __vfs_read+0x38/0x12c
[<c0274810>] vfs_read+0x98/0x11c
[<c0274cf0>] SyS_read+0x4c/0xa0
[<c0108180>] arm_elf_read_implies_exec+0x50/0x50
[<ffffffff>] 0xffffffff
I have found the finally position of the stack, it is in ti_am335x_tscadc.c and the function is am335x_tscadc_need_adc
static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc)
{
DEFINE_WAIT(wait);
u32 reg;
regmap_read(tscadc->regmap, REG_ADCFSM, ®);
if (reg & SEQ_STATUS){
tscadc->adc_waiting = true;
prepare_to_wait(&tscadc->reg_se_wait, &wait,
TASK_UNINTERRUPTIBLE);
spin_unlock_irq(&tscadc->reg_lock);
schedule();
spin_lock_irq(&tscadc->reg_lock);
finish_wait(&tscadc->reg_se_wait, &wait);
/*
* Sequencer should either be idle or
* busy applying the charge step.
*/
regmap_read(tscadc->regmap, REG_ADCFSM, ®);
WARN_ON((reg & SEQ_STATUS) && !(reg & CHARGE_STEP));
tscadc->adc_waiting = false;
}
tscadc->adc_in_use = true;
}
when the REG_ADCFSM is busy, then the process enter in sleep mode and wait for wake-up, but nobody wake it,
so the process stuck all the time, please help to fix the problem, or give some ideas,thanks.
Shine:
请问用的是自己的板子还是EVM板?Processor SDK是哪个版本?
,
tian zhou:
你好,我们用的是自己的板子,SDK是ti-processor-sdk-linux-am335x-evm-05.00.00.15-Linux-x86-Install.bin
,
Shine:
请看一下下面的帖子是否有帮助? https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_am335x-adc-lock-up-in-kernel-v3-14 https://e2e.ti.com/support/processors-group/processors/f/processors-forum/423923/am335x-adc-hangs-sdk8/1516402
,
tian zhou:
你好,看了下,还是没有解决,其中第一个里面的修改我们现在5.0的代码里面已经包含了,第二个是将schedule改为schedule_timeout,本质上还是没有解决问题。
,
Shine:
我看到您的问题已经升级到e2e了,请关注下面帖子的回复。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1112948/processor-sdk-am335x-adc-fsm-busy-issue
,
tian zhou:
是的,谢谢
,
Shine:
不客气~
我看到e2e工程师已经在跟进了,请关注帖子的回复,谢谢!