HAB event

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

HAB event

496 Views
yosri_c
Contributor III

Hello NXP Support Team,

I am implementing secure boot on a custom i.MX RT1176 board and am preparing to program the SRK_HASH and SEC_CONFIG fuses. Before I do this, I need to verify that my image authentication is working correctly by capturing and analyzing the HAB status and event logs.

I have successfully signed my bootselector image using CST and the device boots in the open configuration. However, I am unsure of the practical steps to retrieve the HAB runtime information.

My current setup is as follows:

  • Target: i.MX RT1176 Custom Board

  • Boot Device: FlexSPI NOR Flash (XIP)

  • Image: A signed bootselector.bin placed at 0x60000000, with its CSF at 0x60010000.

  • Fuses: SEC_CONFIG and SRK_HASH are not yet programmed.

  • Tools: MCUXpresso IDE, CST 4.0.1, Custom flashloader.

My specific questions are:

  1. Runtime Access: What is the recommended method to access the HAB API from my application code? I am aware of the HAB RVT at 0x00211C0C . and where exactly do i find a header or a rom table for such APIs.

  2. Data Retrieval:  when i use The hab_report_event() function  or hab_entry() the boot fail in those .

  3. Example Code: Could you provide a simple code snippet outlining the essential steps to:

    • Initialize the HAB API interface.

    • Retrieve and print the overall status.

    • Loop through and print all available events from the audit log?

Objective: My primary goal is to confirm that the authentication process finds my CSF and executes the commands. Eventually, I need to see the status change from a failure (due to missing SRK) to a success (after SRK is fused) before locking the device.

A simple code example or a pointer to the relevant section of the documentation that covers this retrieval process would be extremely helpful. (i have documentation in CST but i only lists the HAB functions ) nor does it provide any offset of any HAB API .

Thank you for your assistance.

Tags (1)
0 Kudos
Reply
1 Reply

385 Views
yosri_c
Contributor III

I manage to solve the issue with the bootselector authentication and the event logs , now i have a status HAB_success when i check Bootselector(first stage bootloader) . my problem is when i try to do a POST_ROM authentication using a call to HABRVT APIs i get an event logs like this attached . i need some explanations please . (no one seems to reply) 

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2160745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHAB%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2160745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20class%3D%22%22%3EHello%20NXP%20Support%20Team%2C%3C%2FP%3E%3CP%20class%3D%22%22%3EI%20am%20implementing%20secure%20boot%20on%20a%20custom%20i.MX%20%3CSTRONG%3ERT1176%3C%2FSTRONG%3E%20board%20and%20am%20preparing%20to%20program%20the%20%3CSTRONG%3ESRK_HASH%3C%2FSTRONG%3E%20and%20%3CSTRONG%3ESEC_CONFIG%3C%2FSTRONG%3E%20fuses.%20Before%20I%20do%20this%2C%20I%20need%20to%20verify%20that%20my%20image%20authentication%20is%20working%20correctly%20by%20capturing%20and%20analyzing%20the%20HAB%20status%20and%20event%20logs.%3C%2FP%3E%3CP%20class%3D%22%22%3EI%20have%20successfully%20signed%20my%20bootselector%20image%20using%20CST%20and%20the%20device%20boots%20in%20the%20open%20configuration.%20However%2C%20I%20am%20unsure%20of%20the%20practical%20steps%20to%20retrieve%20the%20HAB%20runtime%20information.%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EMy%20current%20setup%20is%20as%20follows%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3ETarget%3A%3C%2FSTRONG%3E%20i.MX%20RT1176%20Custom%20Board%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EBoot%20Device%3A%3C%2FSTRONG%3E%20FlexSPI%20NOR%20Flash%20(XIP)%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EImage%3A%3C%2FSTRONG%3E%20A%20signed%20bootselector.bin%20placed%20at%200x60000000%2C%20with%20its%20CSF%20at%200x60010000.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EFuses%3A%3C%2FSTRONG%3E%26nbsp%3B%3CFONT%20face%3D%22Menlo%2C%20Monaco%2C%20Consolas%2C%20Courier%20New%2C%20monospace%22%20color%3D%22%23c7254e%22%3E%3CSPAN%3ESEC_CONFIG%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3Eand%20SRK_HASH%20are%20%3CSTRONG%3Enot%20yet%20programmed%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3ETools%3A%3C%2FSTRONG%3E%20MCUXpresso%20IDE%2C%20CST%204.0.1%2C%20Custom%20flashloader.%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EMy%20specific%20questions%20are%3A%3C%2FSTRONG%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3ERuntime%20Access%3A%3C%2FSTRONG%3E%20What%20is%20the%20recommended%20method%20to%20access%20the%20HAB%20API%20from%20my%20application%20code%3F%20I%20am%20aware%20of%20the%20HAB%20RVT%20at%20%3CSPAN%3E0x00211C0C%26nbsp%3B%3C%2FSPAN%3E.%20and%20where%20exactly%20do%20i%20find%20a%20header%20or%20a%20rom%20table%20for%20such%20APIs.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EData%20Retrieval%3A%3C%2FSTRONG%3E%26nbsp%3B%20when%20i%20use%20The%20%3CSTRONG%3Ehab_report_event%3C%2FSTRONG%3E()%20function%26nbsp%3B%20or%26nbsp%3B%3CSTRONG%3Ehab_entry%3C%2FSTRONG%3E()%20the%20boot%20fail%20in%20those%20.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EExample%20Code%3A%3C%2FSTRONG%3E%20Could%20you%20provide%20a%20simple%20code%20snippet%20outlining%20the%20essential%20steps%20to%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%20class%3D%22%22%3EInitialize%20the%20HAB%20API%20interface.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3ERetrieve%20and%20print%20the%20overall%20status.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3ELoop%20through%20and%20print%20all%20available%20events%20from%20the%20audit%20log%3F%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3EObjective%3A%3C%2FSTRONG%3E%20My%20primary%20goal%20is%20to%20confirm%20that%20the%20authentication%20process%20finds%20my%20CSF%20and%20executes%20the%20commands.%20Eventually%2C%20I%20need%20to%20see%20the%20status%20change%20from%20a%20failure%20(due%20to%20missing%20SRK)%20to%20a%20success%20(after%20SRK%20is%20fused)%20before%20locking%20the%20device.%3C%2FP%3E%3CP%20class%3D%22%22%3EA%20simple%20code%20example%20or%20a%20pointer%20to%20the%20relevant%20section%20of%20the%20documentation%20that%20covers%20this%20retrieval%20process%20would%20be%20extremely%20helpful.%20(i%20have%20documentation%20in%20CST%20but%20i%20only%20lists%20the%20HAB%20functions%20)%20nor%20does%20it%20provide%20any%20offset%20of%20any%20HAB%20API%20.%3C%2FP%3E%3CP%20class%3D%22%22%3EThank%20you%20for%20your%20assistance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2171923%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2171923%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20manage%20to%20solve%20the%20issue%20with%20the%20bootselector%20authentication%20and%20the%20event%20logs%20%2C%20now%20i%20have%20a%20status%20HAB_success%20when%20i%20check%20Bootselector(first%20stage%20bootloader)%20.%20my%20problem%20is%20when%20i%20try%20to%20do%20a%20POST_ROM%20authentication%20using%20a%20call%20to%20HABRVT%20APIs%20i%20get%20an%20event%20logs%20like%20this%20attached%20.%20i%20need%20some%20explanations%20please%20.%20(no%20one%20seems%20to%20reply)%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E