1、#EMBEDDEDOSSUMMITFlexible system design via RPC:Embracing distributed computing in ZephyrYuval Peress,GoogleEmail:Discord:yuval#5515GitHub:yperessChromebooks ship with an EC and a separate Application Processor(AP)Many APs(Intel and AMD)come with a dedicated sensor coreWe wanted to move the sensor l
2、ogic to reduce the cost of the ECBut how?Dependencies,tests,and prior designs were brokenPortable designPigweed RPCs and protobuffersTransitioning from headers to servicesAn exampleAgenda#EMBEDDEDOSSUMMITPortable designhint:theyre microservicesSYSWORKQSHELLTASK_TOUCHPADTASK_CHG_RAMPTASK_USB_CHGTASK_
3、DPSTASK_CHARGERTASK_CHIPSETTASK_MOTIONSENSETASK_USB_MUXTASK_HOSTCMDTASK_KEYPROTOTASK_POWERBTNTASK_KEYSCANTASK_PD_CTASK_PD_INT_CChromiums EC has many tasksSensorsPower DeliverySensor logic can be on a dedicate core such as Intels ISH or AMDs SFH.Power delivery(PD)logic can be on PD chipDoes it matter
4、 where the task lives?With the right design,the service and clients never need to be rewritten#EMBEDDEDOSSUMMITPigweed RPCs and protobufsPigweed is a collection of tools/modulesHighly tuned for embedded applicationsModules in this talk:pw_rpcpw_hdlcWhat is Pigweed?RPC conceptsUnary RPCClient Streami
5、ngServer StreamingAsynchronousset_valpasses an int and saves it on the servicereturns a status when finishedget_valpasses no argsreturns a status and the current valueA simple servicePigweed uses server streams for logging(pw_log_rpc)Client makes a request to the service(EC)and gets back a streamEac
6、h message on the stream is a log messageWhen data is generated with some latencyWhen to use streams?#Add the remoteremotes:-name:pigweed url-base:https:/ pigweed to the projectprojects:-name:pigweed remote:pigweed revision:mainHow to set it up(west.yml)?How to set it up(kConfig)?Enable C+How to set