K8x OTA Firmware Update

cancel
Showing results for 
Search instead for 
Did you mean: 

K8x OTA Firmware Update

Jump to solution
450 Views
deniscollis
Contributor V

I'd like some ideas on how to achieve Over-The-Air Firmware Updates on the K8x family.  My board has plenty of QSPI flash and an i2c connection with a 4G LTE comms module.   The comms module can forward a binary firmware image as a packet steam, but is too under-resourced to store the entire image, or to implement a bootloader host.

For performance reasons, the K8x's main application should run from internal program flash.  

Labels (1)
Tags (2)
1 Solution
299 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Question: Can MainApp change its own the Flash Configuration Field? Or do I need a RAM Function to do it?

TS: Yes, MainApp can change its own Flash configuration field.

There is an application note AN4695 about how to avoid read while write error with Flash operation.

It just required RAM function to do Flash command operation.

Wish it helps.


Have a great day,
Mike

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
299 Views
deniscollis
Contributor V

The application note's a little dated.  RAM functions in MCUXpresso are much easier. The linker script should automatically be set up correctly.  All that's needed:

#include <cr_section_macros.h>

__RAM_FUNC void myRamFunction(void)
{

}‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
299 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

MUCXpresso SDK for K8x also has this function to execute Flash command in RAM:

<fsl_ftfx_cache.c> has below code:

pastedImage_1.png

pastedImage_2.png

Wish it helps.


Have a great day,
Mike

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

298 Views
deniscollis
Contributor V

IDEA 1

Reserve area of QSPI XiP Flash that contains update manager application, say, "UpdateApp".

The default application "MainApp" is running and accepts file transfer from comms module.  The file, an update for MainApp, is stored at a predesignated area in QSPI Flash.  After the file transfer is complete, we change the BOOTSRC_SEL field (bits [7:6]) in the FOPT register to b10 "boot from ROM with QuadSPI configured".  (The bootFlags field in BCA should previously have been set to 0xFE "boot directly from QuadSPI".)  Now we execute a RESET.

K8x now boots UpdateApp from QSPI.  This erases internal flash, into which it then writes the updated MainApp FW from the predesignated area in QSPI flash. It resets the BOOTSRC_SET field in the FOPT register to boot from internal flash, and executes a RESET.

Question: Can MainApp change its own the Flash Configuration Field? Or do I need a RAM Function to do it?

0 Kudos
300 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Question: Can MainApp change its own the Flash Configuration Field? Or do I need a RAM Function to do it?

TS: Yes, MainApp can change its own Flash configuration field.

There is an application note AN4695 about how to avoid read while write error with Flash operation.

It just required RAM function to do Flash command operation.

Wish it helps.


Have a great day,
Mike

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos