BAF (Boot Assist flash)

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

BAF (Boot Assist flash)

Jump to solution
1,934 Views
AshokSubramani
Contributor III

I am currently working on the BAF configuration. According to the MPC5746C Safety Manual, write access to the BAF region should be disabled by setting the  PFLASH_PFCR3[BAF_DIS] bit, to prevent execution from non-safety-compliant code.

During debugging, I placed a breakpoint in the bootloader’s main() function and observed that the PFLASH_PFCR3[BAF_DIS] bit was already set (i.e., execution from the BAF region was disabled) before reaching this point.

Could you please confirm:

  • Does the BAF itself automatically set this bit before branching to the application’s start vector?

  • Or is it still recommended to explicitly configure PFLASH_PFCR3[BAF_DIS] = 1 in the bootloader application to comply with safety requirements?

 

AshokSubramani_0-1754472920732.png

 

Tags (1)
0 Kudos
Reply
1 Solution
1,914 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have done the test.

I can see it is set by BAF itself once I have placed breakpoint on the read/write PFCR3 register.

Code stopped on entry to the register.

petervlna_0-1754546741505.png

 

Best regards,

Peter

View solution in original post

4 Replies
1,920 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

write access to the BAF region should be disabled by setting the  PFLASH_PFCR3[BAF_DIS] bit, to prevent execution from non-safety-compliant code.

disabling BAF execution in PFLASH control register3 (PFLASHC_PFCR3[BAF_DIS]

petervlna_0-1754479728886.png

petervlna_1-1754479788233.png

During debugging, I placed a breakpoint in the bootloader’s main() function and observed that the PFLASH_PFCR3[BAF_DIS] bit was already set (i.e., execution from the BAF region was disabled) before reaching this point.

Not execution. But access to the BAF flash region.

Could you please confirm:

  • Does the BAF itself automatically set this bit before branching to the application’s start vector?

I expect not as it is no documented. The default reset value is BAF_DIS=0. But I do not expect it since if it is set, BAF wont be able execute the branch to startup of application. It just makes no sense to have it set in BAF execution.

  • Or is it still recommended to explicitly configure PFLASH_PFCR3[BAF_DIS] = 1 in the bootloader application to comply with safety requirements?

 Yes, it is recommended.

I would check where your SW is BAF_DIS setting by placing breakpoint on write to BAF_DIS in your debugger.

Best regards,

Peter

0 Kudos
Reply
1,917 Views
AshokSubramani
Contributor III

I placed a breakpoint in the startup file at the CPU0 entry point address (0xF8C010), which lies within the boot header section. Based on this observation, I assume that the PFLASHC_PFCR3[BAF_DIS] bit is being set by the Boot Assist Flash (BAF) itself before branching to the user application. Please confirm if this understanding is correct.

 

AshokSubramani_0-1754480639557.png

AshokSubramani_1-1754480797032.png

 

 

0 Kudos
Reply
1,915 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have done the test.

I can see it is set by BAF itself once I have placed breakpoint on the read/write PFCR3 register.

Code stopped on entry to the register.

petervlna_0-1754546741505.png

 

Best regards,

Peter

1,910 Views
AshokSubramani
Contributor III
So, In application we dont need to set PFLASHC_PFCR3[BAF_DIS] separately .
0 Kudos
Reply