ADC driver for app control (Legato 16.07, WP85xx)?


#1

Hi there,

How can we read the ADC within the app? At present all the documentation points to issuing

cm adc read EXT_ADC1

at the shell to do so. I would very much prefer to do it in C.

Also, I keep getting Read EXT_ADC<1:2> failed when issuing this command. Listing the ADCs is fine. Any reason for the failure?

Best regards,

Royan


#2

you can look at the adc tutorial at

https://github.com/mangOH/mangOH/tree/master/samples/tutorials/hardwareInterfaces/adc/NoiseSensor

cheers,
Ashish


#3

Hi Ashish,

Thanks a lot for the link. I have tried it but ended up with the following error:

Jan 6 00:26:52 swi-mdm9x15 user.err Legato: =ERR= | serviceDirectory[594]/serviceDirectory_exe T=main | serviceDirectory.c DispatchToServer() 713 | Client (uid 1019 ‘appnoiseData’, pid 854) disagrees with server (uid 0 ‘root’, pid 647) on protocol ID of service 'noiseDat
Jan 6 00:26:52 swi-mdm9x15 user.emerg Legato: EMR | noiseData[854]/framework T=main | messagingSession.c ReceiveSessionOpenResponse() 725 | Unexpected server response: -6 (LE_FAULT).
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | proc.c proc_SigChildHandler() 1354 | Process ‘noiseData’ (PID: 854) has exited with exit code 1.
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | proc.c GetFaultAction() 1151 | No fault action specified for process ‘noiseData’. Assuming ‘ignore’.
Jan 6 00:26:52 swi-mdm9x15 user.warn Legato: -WRN- | supervisor[569]/supervisor T=main | app.c app_SigChildHandler() 1641 | Process ‘noiseData’ in app ‘noiseData’ faulted: Ignored.
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | app.c app_SigChildHandler() 1694 | app ‘noiseData’ has stopped.
Jan 6 00:26:53 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | sandbox.c sandbox_Remove() 1450 | ‘noiseData’ sandbox removed.
Jan 6 00:26:53 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | supervisor.c DeleteAppObj() 575 | Application ‘noiseData’ has stopped.
Jan 6 00:26:55 swi-mdm9x15 user.err Legato: =ERR= | appCtrl[890]/framework T=main | cgroups.c OpenCgrpFile() 167 | Could not open file ‘/sys/fs/cgroup/freezer/noiseData/tasks’. No such file or directory.

Wonder what is causing this?

Best regards,

Royan


#4

Can you inform me of the following:
a. Firmware/legato version of your module
b. Legato on your host
regards,
ashish

ps: you can move this question to the mangoh forum: forum.mangoh.io