%3CLINGO-SUB%20id%3D%22lingo-sub-1736804%22%20slang%3D%22en-US%22%3EDiagnosing%20errors%20in%20applications%20written%20for%20Azure%20Sphere%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1736804%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20monitoring%20the%20health%20of%20your%20applications%20written%20for%20Azure%20Sphere%2C%20you%20need%20to%20be%20able%20to%20diagnose%20bugs%20and%20errors.%20During%20application%20development%2C%20you%20can%20use%20a%20debugger%2C%20print%20statements%2C%20and%20similar%20tools%20to%20help%20find%20problems.%20However%2C%20when%20devices%20are%20deployed%20in%20the%20field%2C%20it%20becomes%20more%20challenging%20to%20debug%20an%20application%2C%20and%20a%20different%20approach%20is%20needed.%20For%20example%2C%20an%20application%20might%20unknowingly%20crash%20or%20exit%2C%20leaving%20you%20unable%20to%20detect%20the%20reason%20for%20the%20occurrence.%20Tools%20like%20the%20CLI%20command%20can%20help%20you%20gain%20a%20better%20understanding%20as%20to%20why%20your%20application%20crashed%20or%20reported%20an%20error.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20recently%20released%20additional%20documentation%20to%20help%20you%20interpret%20error%20reports%2C%20along%20with%20a%20new%20sample%20tutorial%20demonstrating%20how%20to%20analyze%20app%20crashes.%20Read%20on%20to%20find%20out%20about%20the%20new%20tools%20and%20additional%20ways%20to%20help%20make%20debugging%20easier%20in%20the%20future.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAutomatically%20generated%20error%20reports%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWhenever%20an%20issue%20occurs%20on%20your%20device%2C%20such%20as%20an%20app%20crash%20or%20an%20app%20exit%2C%20the%20device%20logs%20an%20error%20reporting%20event.%20These%20events%20are%20uploaded%20to%20the%20Azure%20Sphere%20Security%20Service%20(AS3)%20daily%2C%20and%20you%20can%20get%20a%20csv%20file%20containing%20the%20error%20reporting%20data%20by%20running%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Freference%2Fazsphere-tenant%23download-error-report%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3Eazsphere%20tenant%3C%2FSTRONG%3E%20%3CSTRONG%3Edownload-error-report%3C%2FSTRONG%3E%3C%2FA%3E%3CSPAN%3E%3CSTRONG%3E.%3C%2FSTRONG%3E%3C%2FSPAN%3E%20The%20csv%20file%20contains%20information%20on%20errors%20reported%20by%20devices%20in%20the%20current%20tenant%20from%20the%20last%2014%20days.%20The%20reports%20provide%20system-level%20error%20data%20that%20a%20traditional%20application%20would%20not%20be%20able%20to%20collect%20on%20its%20own.%20A%20sample%20error%20reporting%20entry%20in%20the%20csv%20is%3A%3C%2FP%3E%0A%3CPRE%3EAppCrash%20(exit_status%3D11%3B%20signal_status%3D11%3B%20signal_code%3D3%3B%20component_id%3D685f13af-25a5-40b2-8dd8-8cbc253ecbd8%3B%20%3CBR%20%2F%3Eimage_id%3D7053e7b3-d2bb-431f-8d3a-173f52db9675)%3C%2FPRE%3E%0A%3CP%3EThis%20example%20shows%20an%20error%20event%20as%20it%20appears%20in%20the%20log.%20Here%2C%20an%20AppCrash%20occurred%3B%20the%20additional%20information%20includes%20the%20exit%20status%2C%20signal%20status%2C%20signal%20code%2C%20component%20id%2C%20and%20image%20id.%20These%20details%20are%20helpful%20when%20it%20comes%20to%20diagnosing%20an%20error%20in%20an%20application.%20See%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fdeployment%2Finterpret-error-data%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECollect%20and%20interpret%20error%20data%3C%2FA%3E%20in%20the%20Azure%20Sphere%20documentation%20to%20understand%20how%20to%20use%20this%20information%20to%20debug.%20Additional%20interpretation%20details%20have%20recently%20been%20added.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20addition%20to%20the%20CLI%20command%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Freference%2Fazsphere-tenant%23download-error-report%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3Eazsphere%20tenant%20download-error-report%3C%2FSTRONG%3E%3C%2FA%3E%3CSTRONG%3E%2C%20%3C%2FSTRONG%3Eyou%20can%20also%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Frest%2Fapi%2Fazure-sphere%2Ferrorreporting%2Flist%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPublic%20API%3C%2FA%3E%20to%20acquire%20the%20same%20error%20reporting%20information.%20The%20API%20returns%20a%20JSON%20object%2C%20containing%20the%20same%20error%20reporting%20information%20as%20the%20csv%2C%20that%20you%20can%20parse%20according%20to%20your%20needs%3CEM%3E.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture1.png%22%20style%3D%22width%3A%20569px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F224286i8A4588317E747725%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Picture1.png%22%20alt%3D%22Picture1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EThe%20typical%20lifecycle%20for%20using%20error%20reporting%20data%20to%20remotely%20detect%20a%20problem%20with%20your%20application%20in%20the%20field%20and%20deploy%20a%20fix%20OTA.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENew%20tools%20for%20diagnosing%20applications%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAzure%20Sphere%20recently%20released%20an%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sphere-samples%2Ftree%2Fmaster%2FTutorials%2FErrorReporting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EError%20Reporting%20Tutorial%3C%2FA%3E.%20This%20tutorial%20demonstrates%20how%20you%20can%20interpret%20expected%20app%20crashes%20and%20app.%20The%20tutorial%20lets%20you%20simulate%20application%20crashes%20and%20exits%20for%20an%20Azure%20Sphere%20and%20test%20the%20Azure%20Sphere%20error%20reporting%20functionality%20as%20well%20as%20experiment%20with%20sample%20error%20reporting%20data.%20Within%2024%20hours%20after%20you%20run%20the%20tutorial%2C%20you%20can%20download%20a%20csv%20that%20contains%20error%20reporting%20events%2C%20and%20you%20can%20then%20follow%20the%20instructions%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fdeployment%2Finterpret-error-data%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECollect%20and%20interpret%20error%20data%3C%2FA%3E%20to%20learn%20how%20to%20use%20the%20csv%20to%20diagnose%20application%20failures.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGoing%20forward%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EExit%20codes%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3ETo%20further%20improve%20error%20diagnosis%2C%20try%20implementing%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fapp-development%2Fexit-codes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexit%20codes%3C%2FA%3E%20in%20your%20application%20code.%20Exit%20codes%20are%20important%20as%20they%20are%20reported%20directly%20from%20the%20application%20and%20help%20you%20determine%20where%20something%20went%20wrong%20in%20your%20app.%20Location-specific%20exit%20codes%20identify%20exactly%20where%20the%20exit%20happened.%20The%20exit%20codes%20will%20appear%20in%20the%20error%20reports%20and%20can%20be%20compared%20with%20your%20code%20to%20better%20understand%20where%20the%20application%20exited%20and%20why.%20By%20following%20the%20steps%20and%20example%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fapp-development%2Fexit-codes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexit%20codes%20documentation%3C%2FA%3E%2C%20you%20can%20easily%20implement%20exit%20codes%20and%20as%20a%20result%20be%20more%20equipped%20to%20debug%20and%20fix%20issues%20in%20the%20future.%20The%20highlighted%20portion%20of%20the%20sample%20error%20reporting%20entry%20below%20shows%20how%20exit%20codes%20appear%20in%20error%20reports%3A%3C%2FP%3E%0A%3CPRE%3EAppExit%20(exit_code%3D0%3B%20component_id%3D685f13af-25a5-40b2-8dd8-8cbc253ecbd8%3B%20%3CBR%20%2F%3Eimage_id%3D0a7cc3a2-f7c2-4478-8b02-723c1c6a85cd)%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture2.png%22%20style%3D%22width%3A%20505px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F224288i71A1C47891C46F85%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Picture2.png%22%20alt%3D%22Picture2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EExit%20code%20definitions%20from%20the%20Error%20Reporting%20tutorial.%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EWatchdog%20timers%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EAnother%20useful%20tool%20is%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-sphere%2Fapp-development%2Fwatchdog-timer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewatchdog%20timer%3C%2FA%3E.%20If%20an%20application%20becomes%20unresponsive%2C%20the%20system%20timer%20will%20act%20as%20a%20watchdog%20and%20restart%20the%20application.%20When%20the%20watchdog%20is%20set%20and%20expires%2C%20it%20raises%20a%20SIGALRM%20signal%20that%20the%20application%20is%20purposely%20unable%20to%20handle.%20As%20a%20result%2C%20the%20application%20terminates%20(or%20crashes)%20and%20restarts.%20The%20highlighted%20portion%20of%20the%20sample%20error%20reporting%20entry%20below%20shows%20how%20a%20watchdog%20timer%20alarm%20appears%20in%20an%20error%20report.%20Signal%20status%2014%20corresponds%20to%20a%20SIGALRM%2C%20indicating%20that%20the%20application%20crashed%20because%20a%20watchdog%20expired%3A%3C%2FP%3E%0A%3CPRE%3EAppCrash%20(exit_status%3D11%3B%20signal_status%3D14%3B%20signal_code%3D3%3B%20component_id%3D685f13af-25a5-40b2-8dd8-8cbc253ecbd8%3B%20%3CBR%20%2F%3Eimage_id%3D7053e7b3-d2bb-431f-8d3a-173f52db9675)%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENext%20steps%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWe%20have%20updated%20and%20published%20documentation%20to%20assist%20you%20in%20diagnosing%20your%20Azure%20Sphere%20applications%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFor%20more%20information%20on%20the%20CLI%20command%20%3CSTRONG%3Eazsphere%20tenant%20download-error-report%3C%2FSTRONG%3E%20to%20acquire%20your%20error%20report%20in%20csv%20form%20see%20our%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Freference%2Fazsphere-tenant%23download-error-report%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReference%20page%3C%2FA%3E%20(and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Frest%2Fapi%2Fazure-sphere%2Ferrorreporting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPublic%3C%2FA%3E%3CSPAN%3E%20API%3C%2FSPAN%3E%20if%20you%20prefer%20to%20acquire%20a%20json%20object).%3C%2FLI%3E%0A%3CLI%3ESee%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fdeployment%2Finterpret-error-data%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECollect%20and%20interpret%20error%20data%3C%2FA%3E%20to%20understand%20how%20to%20use%20the%20information%20provided%20in%20the%20report%20to%20diagnose%20your%20application.%3C%2FLI%3E%0A%3CLI%3ETry%20out%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sphere-samples%2Ftree%2Fmaster%2FTutorials%2FErrorReporting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EError%20Reporting%20Tutorial%3C%2FA%3E%20for%20a%20demonstration%20on%20how%20you%20can%20interpret%20app%20crashes%20and%20app%20exits.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ESee%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fapp-development%2Fexit-codes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexit%20codes%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure-sphere%2Fapp-development%2Fwatchdog-timer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewatchdog%20timer%3C%2FA%3E%20documentation%20for%20ways%20to%20further%20assist%20yourself%20in%20the%20future%20when%20writing%20applications.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAbout%20Azure%20Sphere%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAzure%20Sphere%20is%20a%20secured%2C%20high-level%20application%20platform%20with%20built-in%20communication%20and%20security%20features%20for%20internet-connected%20devices.%20It%20comprises%20a%20secured%2C%20connected%2C%20crossover%20microcontroller%20unit%20(MCU)%2C%20a%20custom%20high-level%20Linux-based%20operating%20system%20(OS)%2C%20and%20a%20cloud-based%20security%20service%20that%20provides%20continuous%2C%20renewable%20security.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ENeed%20help%3F%20Connect%20with%20experts%20through%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FAzureSphereSupport%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20forum%3C%2FA%3E%26nbsp%3Bor%20on%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FASStackoverflow%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EStack%20Overflow%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EShare%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F915433-azure-sphere%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eproduct%20feedback%20and%20requests%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EStay%20current%20with%20the%20latest%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fupdates%2F%3Fproduct%3Dazure-sphere%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Updates%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1736804%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Code.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207574i4EEA712FCFF27480%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Code.png%22%20alt%3D%22Code.png%22%20%2F%3E%3C%2FSPAN%3ETo%20make%20debugging%20easier%2C%20we%20recently%20release%20new%20tools%20to%20help%20interpret%20error%20reports%2C%20along%20with%20a%20new%20sample%20tutorial%20demonstrating%20how%20to%20analyze%20app%20crashes.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1736804%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sphere%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIoT%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIoT%20security%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

When monitoring the health of your applications written for Azure Sphere, you need to be able to diagnose bugs and errors. During application development, you can use a debugger, print statements, and similar tools to help find problems. However, when devices are deployed in the field, it becomes more challenging to debug an application, and a different approach is needed. For example, an application might unknowingly crash or exit, leaving you unable to detect the reason for the occurrence. Tools like the CLI command can help you gain a better understanding as to why your application crashed or reported an error.

 

We recently released additional documentation to help you interpret error reports, along with a new sample tutorial demonstrating how to analyze app crashes. Read on to find out about the new tools and additional ways to help make debugging easier in the future.

 

Automatically generated error reports

Whenever an issue occurs on your device, such as an app crash or an app exit, the device logs an error reporting event. These events are uploaded to the Azure Sphere Security Service (AS3) daily, and you can get a csv file containing the error reporting data by running azsphere tenant download-error-report. The csv file contains information on errors reported by devices in the current tenant from the last 14 days. The reports provide system-level error data that a traditional application would not be able to collect on its own. A sample error reporting entry in the csv is:

AppCrash (exit_status=11; signal_status=11; signal_code=3; component_id=685f13af-25a5-40b2-8dd8-8cbc253ecbd8; 
image_id=7053e7b3-d2bb-431f-8d3a-173f52db9675)

This example shows an error event as it appears in the log. Here, an AppCrash occurred; the additional information includes the exit status, signal status, signal code, component id, and image id. These details are helpful when it comes to diagnosing an error in an application. See Collect and interpret error data in the Azure Sphere documentation to understand how to use this information to debug. Additional interpretation details have recently been added.

 

In addition to the CLI command azsphere tenant download-error-report, you can also use the Public API to acquire the same error reporting information. The API returns a JSON object, containing the same error reporting information as the csv, that you can parse according to your needs.

 

Picture1.png

The typical lifecycle for using error reporting data to remotely detect a problem with your application in the field and deploy a fix OTA.

 

New tools for diagnosing applications

Azure Sphere recently released an Error Reporting Tutorial. This tutorial demonstrates how you can interpret expected app crashes and app. The tutorial lets you simulate application crashes and exits for an Azure Sphere and test the Azure Sphere error reporting functionality as well as experiment with sample error reporting data. Within 24 hours after you run the tutorial, you can download a csv that contains error reporting events, and you can then follow the instructions in Collect and interpret error data to learn how to use the csv to diagnose application failures.  

 

Going forward

Exit codes

To further improve error diagnosis, try implementing exit codes in your application code. Exit codes are important as they are reported directly from the application and help you determine where something went wrong in your app. Location-specific exit codes identify exactly where the exit happened. The exit codes will appear in the error reports and can be compared with your code to better understand where the application exited and why. By following the steps and example in the exit codes documentation, you can easily implement exit codes and as a result be more equipped to debug and fix issues in the future. The highlighted portion of the sample error reporting entry below shows how exit codes appear in error reports:

AppExit (exit_code=0; component_id=685f13af-25a5-40b2-8dd8-8cbc253ecbd8; 
image_id=0a7cc3a2-f7c2-4478-8b02-723c1c6a85cd)

Picture2.png

Exit code definitions from the Error Reporting tutorial. 

 

Watchdog timers

Another useful tool is the watchdog timer. If an application becomes unresponsive, the system timer will act as a watchdog and restart the application. When the watchdog is set and expires, it raises a SIGALRM signal that the application is purposely unable to handle. As a result, the application terminates (or crashes) and restarts. The highlighted portion of the sample error reporting entry below shows how a watchdog timer alarm appears in an error report. Signal status 14 corresponds to a SIGALRM, indicating that the application crashed because a watchdog expired:

AppCrash (exit_status=11; signal_status=14; signal_code=3; component_id=685f13af-25a5-40b2-8dd8-8cbc253ecbd8; 
image_id=7053e7b3-d2bb-431f-8d3a-173f52db9675)

 

Next steps

We have updated and published documentation to assist you in diagnosing your Azure Sphere applications:

  • For more information on the CLI command azsphere tenant download-error-report to acquire your error report in csv form see our Reference page (and Public API if you prefer to acquire a json object).
  • See Collect and interpret error data to understand how to use the information provided in the report to diagnose your application.
  • Try out the Error Reporting Tutorial for a demonstration on how you can interpret app crashes and app exits.

See the exit codes and watchdog timer documentation for ways to further assist yourself in the future when writing applications.

 

About Azure Sphere

Azure Sphere is a secured, high-level application platform with built-in communication and security features for internet-connected devices. It comprises a secured, connected, crossover microcontroller unit (MCU), a custom high-level Linux-based operating system (OS), and a cloud-based security service that provides continuous, renewable security.