Reflash vector table in a secure way

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

Reflash vector table in a secure way

1,312 Views
emmanuelaguilas
Contributor II

Hello,

I'm having troubles finding if there is a secure way to reflash the vector table, with other micro-controllers that I just to work with, this was done by manually flashing a vector table in another region and set it as the starting point, then reflashing the default region with the new vector table and making it the start point again when the reflash process done.

Is this handle in a similar way on the S32K? do you have any document for reference?

Regards.

2 Replies

1,026 Views
RadekS
NXP Employee
NXP Employee

Hi Emmanuel,

As Diana said, you may create new vector table in another region and change VTOR register.

That may be important e.g. for dual application solution like Bootloader at default vector table area and application vector table in another Flash/RAM region.

 

The reflashing default vector table may be dangerous since the vector table occupied the same flash sector as initial Stack Pointer and Program Counter values.

Unexpected reset during first sector reflashing may cause MCU brick (you may need JTAG for loading new software).

 

Some of Kinetis MCUs offers flash bank swap, but this feature is not available for the S32k family.

 

So, if you expect that your application will be changed in the future without debugger connection, the vector table should be located out of the first sector anyway.  


I hope it helps you

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,026 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Emmanuel,

The CM0+ and CM4 core support a programmable Vector Table Offset Register (VTOR).
Vector table is located at addresses 0x0 (Stack Pointer) and 0x4 (Program Counter).

I assume you can move the vector table to another address and after reset set VTOR to point to this vector table address.

Best regards,

Diana