{"id":4576,"date":"2023-12-28T03:24:51","date_gmt":"2023-12-28T03:24:51","guid":{"rendered":"https:\/\/www.canbushack.com\/?p=4576"},"modified":"2024-07-23T07:46:54","modified_gmt":"2024-07-23T07:46:54","slug":"accessing-diagnostic-session-control-uds-service-0x10","status":"publish","type":"post","link":"https:\/\/canbushack.com\/web\/accessing-diagnostic-session-control-uds-service-0x10\/","title":{"rendered":"Accessing diagnostic session control (uds service 0x10)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4576\" class=\"elementor elementor-4576\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ee14274 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ee14274\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d2c44f4\" data-id=\"d2c44f4\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b60bc4a elementor-widget elementor-widget-text-editor\" data-id=\"b60bc4a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">The service 10 (0x10) or Diagnostic Session Control (DSC) is a Unified Diagnostic Session (UDS) service for controlling the Diagnostic Session of the ECUs or control modules within the car. This service is used to change from a current diagnostic session to a different one in an ECU.<\/span><\/p><p><span style=\"font-weight: 400;\">Different diagnostic sessions can be configured in the ECU, but the four (4) main sessions, or subfunctions, of the Service ID 10 are:<\/span><\/p><table><tbody><tr><td><p><b>Byte 1<\/b><\/p><\/td><td><p><b>Byte 2<\/b><\/p><\/td><td><p><b>Session<\/b><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">01<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Default<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">02<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Programming<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">03<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Extended<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">04<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Safety<\/span><\/p><\/td><\/tr><\/tbody><\/table><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When the car is running and no specific diagnostic communication is happening outside the ECU, then we are in <\/span><b>default session 0x01<\/b><span style=\"font-weight: 400;\">.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When a flashing tool is connected and a new program is being flashed into the ECU, we are in <\/span><b>programming mode 0x02<\/b><span style=\"font-weight: 400;\">.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When a tester or tool is connected and there are some extra functionalities (for instance, activation tests), we are in <\/span><b>extended version 0x03<\/b><span style=\"font-weight: 400;\">.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The <\/span><b>safety session 0x04<\/b><span style=\"font-weight: 400;\"> is used to test all safety critical diagnostic functions, such as airbag deployment, braking system, etc. This session has a security access service to protect against unauthorized activation of emergency systems that could lead to damage of people or the car itself (deployment of airbags, for instance). This system works with an exchange of seed and key. No access should be possible without the algorithm to calculate the key, given a specific seed<\/span><span style=\"font-weight: 400;\">.<\/span><\/li><\/ul><p><span style=\"font-weight: 400;\">Transition from one session to another can occur only in a specific way, as shown in the following diagram:<\/span><\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-4590\" src=\"https:\/\/www.canbushack.com\/wp-content\/uploads\/2023\/12\/sd.png\" alt=\"\" width=\"505\" height=\"185\" srcset=\"https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd.png 505w, https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd-350x128.png 350w, https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd-18x7.png 18w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/p><p><span style=\"font-weight: 400;\">This means that we can move from the default session to the programming or extended sessions, but we can\u2019t, for instance, move from the extended session to the programming one. For this, we would need to change from the extended session to the default one first, and then move from the default session to the programming one.<\/span><\/p><p><span style=\"font-weight: 400;\">We are in default session and want to move to the extended session:<\/span><\/p><table><tbody><tr><td>\u00a0<\/td><td><p><b>DSC Service<\/b><\/p><\/td><td><p><b>Session<\/b><\/p><\/td><td><p><b>P2<\/b><\/p><p><b>server timer<\/b><\/p><\/td><td><p><b>P2*<\/b><\/p><p><b>server timer<\/b><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Current session<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">01<\/span><\/p><\/td><td>\u00a0<\/td><td>\u00a0<\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Transmit<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">03<\/span><\/p><\/td><td>\u00a0<\/td><td>\u00a0<\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Response (positive)<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">50<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">03<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">00 32<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">01 F4<\/span><\/p><\/td><\/tr><\/tbody><\/table><p><span style=\"font-weight: 400;\">Now, if we want to move to the programming session, we will receive a negative response and a code explaining the reason for it:<\/span><\/p><table><tbody><tr><td>\u00a0<\/td><td><p><b>DSC Service<\/b><\/p><\/td><td><p><b>Session<\/b><\/p><\/td><td><p><b>NRC<\/b><\/p><p><b>(negative response code)<\/b><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Current session<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">03<\/span><\/p><\/td><td>\u00a0<\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Transmit<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">02<\/span><\/p><\/td><td>\u00a0<\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">Response (negative)<\/span><\/p><\/td><td><p><b>7F<\/b><\/p><\/td><td><p><span style=\"font-weight: 400;\">10<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">22<\/span><\/p><\/td><\/tr><\/tbody><\/table><p><span style=\"font-weight: 400;\">The timers P2 and P2* indicate the timeframe between the moment we send the request to a session, and the moment we get a response from the module. P2 indicates the maximum time in <\/span><i><span style=\"font-weight: 400;\">ms<\/span><\/i><span style=\"font-weight: 400;\"> in which the ECU is supposed to send a response, whether positive, negative, or a request for more time (NRC 0x78). P2* indicates the maximum time, in total, to receive a positive response (multiplied by <\/span><i><span style=\"font-weight: 400;\">10ms<\/span><\/i><span style=\"font-weight: 400;\">).<\/span><\/p><p><span style=\"font-weight: 400;\">P2 is the 3rd and 4th byte in the response.<\/span><\/p><p><span style=\"font-weight: 400;\">P2* is the 5th and 6th byte in the response.<\/span><\/p><p style=\"text-align: left;\"><strong>Example:<br \/><img decoding=\"async\" class=\"size-full wp-image-4595 alignleft\" src=\"https:\/\/www.canbushack.com\/wp-content\/uploads\/2023\/12\/sd2.png\" alt=\"\" width=\"397\" height=\"60\" srcset=\"https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd2.png 397w, https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd2-350x53.png 350w, https:\/\/canbushack.com\/web\/wp-content\/uploads\/2023\/12\/sd2-18x3.png 18w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><br \/><\/strong><\/p><p><strong><br \/><br \/>Request:<\/strong><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">02 indicates a single frame message, 2 bytes long.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Request to enter Service 10.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">03 Extended session.<\/span><\/li><\/ul><p><strong>Response:<\/strong><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">06 indicates a single frame message, 6 bytes long.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">50 is the positive response to the SID 10.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">03 Extended session.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Timers as shown in the table below.<\/span><\/li><\/ul><table><tbody><tr><td>\u00a0<\/td><td><p><span style=\"font-weight: 400;\">HEX<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Decimal<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Scaler<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Time<\/span><\/p><\/td><\/tr><tr><td><p><b>P2servermax (Bytes 3 and 4)<\/b><\/p><\/td><td><p><span style=\"font-weight: 400;\">00 32<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">50<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">1 ms<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">50 ms<\/span><\/p><\/td><\/tr><tr><td><p><b>P2*servermax<\/b><\/p><p><b>(Bytes 5 and 6)<\/b><\/p><\/td><td><p><span style=\"font-weight: 400;\">01 F4<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">500<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">10 ms<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">5 sec<\/span><\/p><\/td><\/tr><\/tbody><\/table><p><span style=\"font-weight: 400;\">This means that after the request is sent, the ECU has 50ms (P2) to send a response back, whether positive or negative. If the ECU needs more time, it will send back a RCR-RP (0x78) or <\/span><i><span style=\"font-weight: 400;\">Request Correctly Received-Response Pending<\/span><\/i><span style=\"font-weight: 400;\">, and another 50ms cycle will take place. This cycle will repeat until the total time reaches P2*, 5 sec. After this, we will receive a negative response with its corresponding NRC.<\/span><\/p><p><span style=\"font-weight: 400;\">In some cases, the positive response does not necessarily need to show, which means that we will get into the corresponding session without seeing a direct positive response.<\/span><\/p><p><span style=\"font-weight: 400;\">The negative response codes for the diagnostic control sessions can be:<\/span><\/p><table><tbody><tr><td><p><b>NRC<\/b><\/p><\/td><td><p><b>Description<\/b><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">0x12<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Sub-function not supported.<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">0x13<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Incorrect message length or invalid format.<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">0x22<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Conditions not correct or criteria not met.<\/span><\/p><\/td><\/tr><tr><td><p><span style=\"font-weight: 400;\">0x78<\/span><\/p><\/td><td><p><span style=\"font-weight: 400;\">Response pending\/waiting.<\/span><\/p><\/td><\/tr><\/tbody><\/table><p><span style=\"font-weight: 400;\">To summarize, understanding the Diagnostic Session Control (DSC) service, particularly within the context of Unified Diagnostic Session (UDS) for automotive electronic control units (ECUs), is vital for effective diagnostics and maintenance of vehicles. The four primary sessions &#8211; Default, Programming, Extended, and Safety &#8211; serve distinct purposes and come with specific access conditions. The transition between these sessions follows well-defined rules and timing constraints, enforced by timers P2 and P2*. Additionally, the negative response codes (NRC) provide valuable insights into potential issues or limitations during session control.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The service 10 (0x10) or Diagnostic Session Control (DSC) is a Unified Diagnostic Session (UDS) service for controlling the Diagnostic Session of the ECUs or control modules within the car. This service is used to change from a current diagnostic session to a different one in an ECU. Different diagnostic sessions can be configured in [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":4577,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-4576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/posts\/4576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/comments?post=4576"}],"version-history":[{"count":0,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/posts\/4576\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/media\/4577"}],"wp:attachment":[{"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/media?parent=4576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/categories?post=4576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/canbushack.com\/web\/wp-json\/wp\/v2\/tags?post=4576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}