flash operations

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

flash operations

1,112件の閲覧回数
RajPadmani
Contributor II

Why does the PFlash SDK example take more time to write to flash compared to the bootloader, even though both use the same functions for writing to flash?

0 件の賞賛
返信
6 返答(返信)

1,091件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @RajPadmani ,

Thanks for your post. To better support you, could you please provide me with more details? Specifically, I'd like to know the model of the MCU you are using, the IDE you've chosen, the version of the SDK, and the type of the bootloader.

Have a good day,

Celeste

0 件の賞賛
返信

1,075件の閲覧回数
RajPadmani
Contributor II
I am using KM34 MCU and use the pflash SDK example and SDK bootloader example. I am using latest SDK and Mcuxpresso ide
0 件の賞賛
返信

1,027件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @RajPadmani ,

I couldn't find the bootloader example in the KM34 SDK.

Celeste_Liu_0-1739763611042.png

 

Could you describe the problem in more detail? Also, how did you conduct the tests? Based on the current information you've provided, we're unable to pinpoint the problem.

BRs,

Celeste

0 件の賞賛
返信

1,015件の閲覧回数
RajPadmani
Contributor II

There is no SDK example for the MKM34Z256VLQ7 bootloader, so I customized the MKM35 bootloader to run on the MKM34, and it worked perfectly.

In the bootloader, I read the application and write it using the "mem_write" function, which writes one sector significantly faster compared to the "flash_program" function from the "PFlash" SDK example for the MKM34Z256VLQ7.

Even after matching the clock speed with the bootloader code, the "PFlash" SDK example still takes longer for writing and erasing.

What could be the reason for this difference in performance?

0 件の賞賛
返信

985件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

To clarify the differences between the "mem_write" function and the "flash_program" function, I need to understand their specific implementation methods. Given that you are using a customized bootloader, I'm not sure how "mem_write" is implemented, and I haven't been able to find relevant content in the API Reference Manual either.

Celeste_Liu_0-1739874198721.png


I wonder if you could send me this part of the code. If you have referred to any existing SDK projects or ANs, please let me know as well.

0 件の賞賛
返信

982件の閲覧回数
RajPadmani
Contributor II

RajPadmani_0-1739877157357.png

I am using this bootloader in the KM34 microcontroller. In the bootloader code, I only changed the memory addresses to make it compatible with the KM34.

The mem_write function is a wrapper that uses the flash_program function to write to flash. However, it executes faster than the flash_program function, which I used directly in my application.

You can find this function in "bl_context.c" 

RajPadmani_1-1739877456440.png


In this file, there is a structure named g_bootloaderContext, which contains a structure variable called memoryInterface. The value of g_memoryInterface is assigned to it, and within g_memoryInterface, you will find the mem_write function.

RajPadmani_2-1739877495177.png

I have attached the bootloader SDK example that I'm using.

0 件の賞賛
返信