HAB authentication succeeds with WARNING (Unsupported Engine – DCP) on i.MX RT dual image setup1050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HAB authentication succeeds with WARNING (Unsupported Engine – DCP) on i.MX RT dual image setup1050

411 Views
BiHDeveloper
Contributor I

Hi,
I am working on a secure boot implementation for the i.MX RT1050 MCU and would like to achieve dual image authentication — one for the second-stage bootloader and another for the application image, both located in external flash.

Setup Overview

  • SRK, IMG, and CSF certificates are generated using the NXP Secure Provisioning Tool (SPT).

  • The second-stage bootloader is signed and authenticated by the ROM using HAB.

  • The application image is stored after the bootloader in external flash and can be updated independently (e.g., via USB or OTA).

  • The second state bootloader calls the ROM HAB API to authenticate the application image before execution.

    Implementation Details

    Both images (bootloader + app) are signed with the same SRK/CSF key set.
    Inside the second-stage bootloader, I invoke HAB authentication as follows:

    load_addr = (uint32_t)hab_authenticate_image_no_dcd(1, ivt_offset, image_start, bytes);

    hab_image_entry_f hab_authenticate_image_no_dcd(uint8_t cid, uint32_t ivt_offset, uint32_t start, size_t bytes)
    {
    return g_habrvtTree->authenticate_image_no_dcd(cid, ivt_offset, (void **)&start, (size_t *)&bytes, NULL);
    }

    The authentication works — the function returns a valid reset handler address, confirming that the image is successfully verified.

    Issue: HAB WARNING (Unsupported Engine – DCP)

    After successful authentication, I query the HAB status and event log using hab_rvt_report_status() and hab_rvt_report_event().
    Although authentication passes, I consistently receive a HAB WARNING instead of HAB_SUCCESS.

    Example output:

    Hab rvt report status = 0x69, config = 0xcc, status = 0x99
    Report event #0 -> 0xf0
    [HAB EVENT #0] (44 bytes):
    DB 00 2C 43 69 0A C0 00 CA 00 24 00 02 C5 1B 00 ...

    When decoding this event per the HAB4 documentation, it indicates:

    • 0x69 → Warning

    • 0x0A → Unsupported Engine

    • 0xC0 → Event logged in hab_rvt.run_csf()

    • The sequence 02 C5 1B 00 maps to:

      • Image key verification index

      • Protocol: HAB_PCL_CMS

      • Engine: DCP

      • Default configuration

    From this, I understand that the ROM reports a Warning because it tries to use the DCP engine during CSF execution, but DCP is not properly initialized or available in my second-stage bootloader context.

    What I’ve Tried

    I’ve manually initialized DCP using the SDK driver:

     
    DCP_Init(DCP, &config);

    (with all channels enabled and default settings)

    However, the warning persists — authentication succeeds, but the event log still reports an Unsupported Engine (DCP).

    Questions

    1. How does the ROM initialize and use the DCP during the primary HAB authentication SSB process ?

    2. Is this WARNING expected or benign when calling HAB ROM APIs manually?

    3. Is it possible to invoke the ROM HAB authentication API from a custom bootloader and achieve HAB_SUCCESS (no warnings), or is this warning expected when using the ROM HAB API outside of the initial boot context?



0 Kudos
Reply
4 Replies

379 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @BiHDeveloper 

Thank you for reaching out!

Before diving further, could you manually modify the BD files to have the Header_Engine as any? Then let me know your results

diego_charles_2-1762816138764.png

Edit: after you update the bd file, as shown above, build the image again, beware of the SPT auto generating BD files when build image button. To avoid this you can run manually the build_image script from the project workspace. Then write the new image into the processor. 

Please let me know if you see any changes.

Diego

 

 

0 Kudos
Reply

260 Views
BiHDeveloper
Contributor I

Hi, thank you for the suggestion.

I already manually modified the BD files and set the Header_Engine field to any, but the result is still the same. I'm still receiving a HAB warning during authentication.

Below is the relevant part of my code (after hab exit) showing how I read the HAB events:

load_addr = (uint32_t)hab_authenticate_image_no_dcd(1, ivt_offset, image_start,
                                     bytes);
log_printf("HAB load address: %x\n", load_addr);
 

status = hab_exit();
log_printf("Hab exit status: 0x%x \r\n", status);

#if defined(CONFIG_HAB_CLOSE)
    status = hab_rvt_report_status(&config, &state);
    log_printf("Hab rvt report status = 0x%x, config = 0x%x, status = 0x%x \r\n", status, config, state);
#endif

__attribute__((section(".ocram_data"))) static uint8_t event_data[128];
log_printf("Event data ocram address: %x\n", &event_data);
size_t evt_bytes = sizeof(event_data);
uint32_t index = 0;

memset(event_data, 0, sizeof(event_data));

hab_status_t evt_status;
do
{
evt_bytes = sizeof(event_data);
evt_status = hab_rvt_report_event(HAB_WARNING, index, event_data, &evt_bytes);

log_printf("Report event #%d -> 0x%x\r\n", index, evt_status);

if (evt_status == HAB_SUCCESS)
{
log_printf("[HAB EVENT #%d] (%d bytes): ", index, evt_bytes);
for (uint32_t i = 0; i < evt_bytes; i++)
{
log_printf("%02X ", event_data[i]);
}
log_printf("\r\n");
index++;
}

} while (evt_status == HAB_SUCCESS);

0 Kudos
Reply

223 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @BiHDeveloper 

Thank you for taking a time to look on your side! 

On the past , I have removed the  HAB API warnings by changing  the engine from DCP to ANY on all of my BD files, on the past on the RT1060. So I need to investigate further with you. 

Could you share me your BD files, or any other related but over support ticket ?  This would help us to protect any information.  Please create a new support ticket, by navigating to https://support.nxp.com/s/?language=en_US  Please make reference to this case and my name so I can track the ticket. 

Diego

 

0 Kudos
Reply

139 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @BiHDeveloper 

Thank you for creating a ticket. Lets continue with the follow up there!

Diego

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2201723%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHAB%20authentication%20succeeds%20with%20WARNING%20(Unsupported%20Engine%20%E2%80%93%20DCP)%20on%20i.MX%20RT%20dual%20image%20setup1050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201723%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EI%20am%20working%20on%20a%20secure%20boot%20implementation%20for%20the%20%3CSTRONG%3Ei.MX%20RT1050%20MCU%3C%2FSTRONG%3E%20and%20would%20like%20to%20achieve%20%3CSTRONG%3Edual%20image%20authentication%3C%2FSTRONG%3E%20%E2%80%94%20one%20for%20the%20%3CSTRONG%3Esecond-stage%20bootloader%3C%2FSTRONG%3E%20and%20another%20for%20the%20%3CSTRONG%3Eapplication%20image%3C%2FSTRONG%3E%2C%20both%20located%20in%20external%20flash.%3C%2FP%3E%3CH3%20id%3D%22toc-hId-1997718968%22%20id%3D%22toc-hId-2001437018%22%3E%3CSTRONG%3ESetup%20Overview%3C%2FSTRONG%3E%3C%2FH3%3E%3CUL%3E%3CLI%3E%3CP%3ESRK%2C%20IMG%2C%20and%20CSF%20certificates%20are%20generated%20using%20the%20%3CSTRONG%3ENXP%20Secure%20Provisioning%20Tool%20(SPT)%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20%3CSTRONG%3Esecond-stage%20bootloader%3C%2FSTRONG%3E%20is%20signed%20and%20authenticated%20by%20the%20ROM%20using%20HAB.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20%3CSTRONG%3Eapplication%20image%3C%2FSTRONG%3E%20is%20stored%20after%20the%20bootloader%20in%20external%20flash%20and%20can%20be%20updated%20independently%20(e.g.%2C%20via%20USB%20or%20OTA).%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20second%20state%20bootloader%20calls%20the%20%3CSTRONG%3EROM%20HAB%20API%3C%2FSTRONG%3E%20to%20authenticate%20the%20application%20image%20before%20execution.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CH3%20id%3D%22toc-hId-190264505%22%20id%3D%22toc-hId-193982555%22%3E%3CSTRONG%3EImplementation%20Details%3C%2FSTRONG%3E%3C%2FH3%3E%3CP%3EBoth%20images%20(bootloader%20%2B%20app)%20are%20signed%20with%20the%20same%20SRK%2FCSF%20key%20set.%3CBR%20%2F%3EInside%20the%20second-stage%20bootloader%2C%20I%20invoke%20HAB%20authentication%20as%20follows%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3Eload_addr%20%3D%20(uint32_t)hab_authenticate_image_no_dcd(1%2C%20ivt_offset%2C%20image_start%2C%20bytes)%3B%3C%2FP%3E%3CP%3Ehab_image_entry_f%20hab_authenticate_image_no_dcd(uint8_t%20cid%2C%20uint32_t%20ivt_offset%2C%20uint32_t%20start%2C%20size_t%20bytes)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Ereturn%20g_habrvtTree-%26gt%3Bauthenticate_image_no_dcd(cid%2C%20ivt_offset%2C%20(void%20**)%26amp%3Bstart%2C%20(size_t%20*)%26amp%3Bbytes%2C%20NULL)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20authentication%20works%20%E2%80%94%20the%20function%20returns%20a%20%3CSTRONG%3Evalid%20reset%20handler%20address%3C%2FSTRONG%3E%2C%20confirming%20that%20the%20image%20is%20successfully%20verified.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CH3%20id%3D%22toc-hId--1617189958%22%20id%3D%22toc-hId--1613471908%22%3E%3CSTRONG%3EIssue%3A%20HAB%20WARNING%20(Unsupported%20Engine%20%E2%80%93%20DCP)%3C%2FSTRONG%3E%3C%2FH3%3E%3CP%3EAfter%20successful%20authentication%2C%20I%20query%20the%20HAB%20status%20and%20event%20log%20using%20hab_rvt_report_status()%20and%20hab_rvt_report_event().%3CBR%20%2F%3EAlthough%20authentication%20passes%2C%20I%20consistently%20receive%20a%20%3CSTRONG%3EHAB%20WARNING%3C%2FSTRONG%3E%20instead%20of%20HAB_SUCCESS.%3C%2FP%3E%3CP%3EExample%20output%3A%3CBR%20%2F%3E%3CBR%20%2F%3EHab%20rvt%20report%20status%20%3D%200x69%2C%20config%20%3D%200xcc%2C%20status%20%3D%200x99%3CBR%20%2F%3EReport%20event%20%230%20-%26gt%3B%200xf0%3CBR%20%2F%3E%5BHAB%20EVENT%20%230%5D%20(44%20bytes)%3A%3CBR%20%2F%3EDB%2000%202C%2043%2069%200A%20C0%2000%20CA%2000%2024%2000%2002%20C5%201B%2000%20...%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EWhen%20decoding%20this%20event%20per%20the%20%3CSTRONG%3EHAB4%20documentation%3C%2FSTRONG%3E%2C%20it%20indicates%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3E0x69%20%E2%86%92%20Warning%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E0x0A%20%E2%86%92%20Unsupported%20Engine%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E0xC0%20%E2%86%92%20Event%20logged%20in%20hab_rvt.run_csf()%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20sequence%2002%20C5%201B%2000%20maps%20to%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EImage%20key%20verification%20index%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EProtocol%3A%20HAB_PCL_CMS%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EEngine%3A%20DCP%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EDefault%20configuration%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EFrom%20this%2C%20I%20understand%20that%20the%20ROM%20reports%20a%20%3CSTRONG%3EWarning%20because%20it%20tries%20to%20use%20the%20DCP%20engine%3C%2FSTRONG%3E%20during%20CSF%20execution%2C%20but%20DCP%20is%20not%20properly%20initialized%20or%20available%20in%20my%20second-stage%20bootloader%20context.%3C%2FP%3E%3CH3%20id%3D%22toc-hId-870322875%22%20id%3D%22toc-hId-874040925%22%3E%3CSTRONG%3EWhat%20I%E2%80%99ve%20Tried%3C%2FSTRONG%3E%3C%2FH3%3E%3CP%3EI%E2%80%99ve%20manually%20initialized%20DCP%20using%20the%20SDK%20driver%3A%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EDCP_Init(DCP%2C%20%26amp%3Bconfig)%3B%20%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E(with%20all%20channels%20enabled%20and%20default%20settings)%3C%2FP%3E%3CP%3EHowever%2C%20the%20warning%20persists%20%E2%80%94%20authentication%20succeeds%2C%20but%20the%20event%20log%20still%20reports%20an%20%3CSTRONG%3EUnsupported%20Engine%20(DCP)%3C%2FSTRONG%3E.%3C%2FP%3E%3CH3%20id%3D%22toc-hId--937131588%22%20id%3D%22toc-hId--933413538%22%3E%3CSTRONG%3EQuestions%3C%2FSTRONG%3E%3C%2FH3%3E%3COL%3E%3CLI%3E%3CP%3EHow%20does%20the%20ROM%20initialize%20and%20use%20the%20DCP%20during%20the%20%3CSTRONG%3Eprimary%20HAB%20authentication%3C%2FSTRONG%3E%26nbsp%3BSSB%20process%20%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIs%20this%20%3CSTRONG%3EWARNING%3C%2FSTRONG%3E%20expected%20or%20benign%20when%20calling%20HAB%20ROM%20APIs%20manually%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3EIs%20it%20possible%20to%20invoke%20the%20ROM%20HAB%20authentication%20API%20from%20a%20custom%20bootloader%20and%20achieve%20%3CSTRONG%3EHAB_SUCCESS%3C%2FSTRONG%3E%20(no%20warnings)%2C%20or%20is%20this%20%3CSTRONG%3Ewarning%20expected%3C%2FSTRONG%3E%20when%20using%20the%20ROM%20HAB%20API%20outside%20of%20the%20initial%20boot%20context%3F%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202176%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20authentication%20succeeds%20with%20WARNING%20(Unsupported%20Engine%20%E2%80%93%20DCP)%20on%20i.MX%20RT%20dual%20image%20setup1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202176%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F210497%22%20target%3D%22_blank%22%3E%40BiHDeveloper%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20reaching%20out!%3C%2FP%3E%0A%3CP%3EBefore%20diving%20further%2C%20could%20you%20manually%20modify%20the%20BD%20files%20to%20have%20the%20Header_Engine%20as%20any%3F%20Then%20let%20me%20know%20your%20results%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22diego_charles_2-1762816138764.png%22%20style%3D%22width%3A%20549px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22diego_charles_2-1762816138764.png%22%20style%3D%22width%3A%20549px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364771iA133659121DC7BFA%2Fimage-dimensions%2F549x254%3Fv%3Dv2%22%20width%3D%22549%22%20height%3D%22254%22%20role%3D%22button%22%20title%3D%22diego_charles_2-1762816138764.png%22%20alt%3D%22diego_charles_2-1762816138764.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EEdit%3C%2FSTRONG%3E%3A%20after%20you%20update%20the%20bd%20file%2C%20as%20shown%20above%2C%20build%20the%20image%20again%2C%20beware%20of%20the%20SPT%20auto%20generating%20BD%20files%20when%20build%20image%20button.%20To%20avoid%20this%20you%20can%20run%20manually%20the%20build_image%20script%20from%20the%20project%20workspace.%20Then%20write%20the%20new%20image%20into%20the%20processor.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20let%20me%20know%20if%20you%20see%20any%20changes.%3C%2FP%3E%0A%3CP%3EDiego%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E