How to use Flashx in MQX4.1

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

How to use Flashx in MQX4.1

Jump to solution
605 Views
小勇邹
Contributor II

How to use Flashx in MQX4.1?

I do not know how to use the API in the Flashx. Is there any source code example?

0 Kudos
1 Solution
358 Views
daweiyou
NXP Employee
NXP Employee

Hi:

The sample code is located in:

Freescale_MQX_4_1\mqx\examples\flashx

Dawei You(尤大为)

Field Application Engineer

Freescale Semiconductor (China) Ltd - Nanjing Branch.

View solution in original post

0 Kudos
6 Replies
359 Views
daweiyou
NXP Employee
NXP Employee

Hi:

The sample code is located in:

Freescale_MQX_4_1\mqx\examples\flashx

Dawei You(尤大为)

Field Application Engineer

Freescale Semiconductor (China) Ltd - Nanjing Branch.

0 Kudos
358 Views
小勇邹
Contributor II

Hello,

Is it necessary to erase the flash before writing data to the flash?

I do not find the erasing command before writing data to the flash in the examples(Freescale_MQX_4_1\mqx\examples\flashx).

0 Kudos
358 Views
daweiyou
NXP Employee
NXP Employee

Hello Robin:

Yes, it need erase before write;

But BSP driver have done these works.

Dawei You(尤大为)

0 Kudos
358 Views
小勇邹
Contributor II

Hello Dawei,

The <K64 Sub-Family Reference Manual> describes that "the smallest portion of the program flash memory that can be erased is 4KB".If I only

write 32 Bytes data,it will affects the data in the 4KB memory.Is it right?

0 Kudos
358 Views
daweiyou
NXP Employee
NXP Employee

Yes, The flashhx driver copy old data and merge new data, erase whole sector and re-write the sector;

Dawei You(尤大为)

0 Kudos
358 Views
小勇邹
Contributor II

I get it.Thank you.

0 Kudos