pflash#
Overview#
The pflash example shows how to use flash driver to operate program flash:
Running the demo#
When the example runs successfully, you can see the similar information from the terminal as below.
PFLASH example Start PFlash Information: Total Program Flash Size: xx KB, Hex: (xx) Program Flash Sector Size: xx KB, hex: (xx) Flash is UNSECURE! Erase a sector of flash Successfully Erased Sector xx -> xx Program a buffer to a sector of flash Successfully Programmed and Verified Location xx -> xx
End of PFLASH example
Supported Boards#
FRDM-K22F
Hardware requirements
Mini/micro USB cable
FRDM-K22F board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
FRDM-K32L2A4S
Hardware requirements
Mini/micro USB cable
FRDM-K32L2A4S board
Personal Computer
Board settings
This Example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
PFlash Example Start
PFlash Information:
Total Program Flash Size: 512 KB, Hex: (0x80000)
Program Flash Sector Size: 2 KB, Hex: (0x800)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x7f800 -> 0x80000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x7f800 -> 0x7f810
End of PFlash Example
FRDM-K32L2B
Hardware requirements
Mini/micro USB cable
FRDM-K32L2B board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
FRDM-K32L3A6
Hardware requirements
Mini/micro USB cable
FRDM-K32L3A6 board
Personal Computer
Board settings
This Example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
PFlash Example Start
PFlash Information:
Total Program Flash Size: 1024 KB, Hex: (0x100000)
Program Flash Sector Size: 4 KB, Hex: (0x1000)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0xfe000 -> 0xff000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0xfe000 -> 0xfe010
End of PFlash Example
FRDM-KE15Z
Hardware requirements
Micro USB cable
FRDM-KE15Z board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the example runs successfully, the following message is displayed in the terminal
PFlash Example Start
PFlash Information:
Total Program Flash Size: 256 KB, Hex: (0x40000)
Program Flash Sector Size: 2 KB, Hex: (0x800)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x3f800 -> 0x40000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x3f800 -> 0x3f810
End of PFlash Example
FRDM-KE16Z
Hardware requirements
Micro USB cable
FRDM-KE16Z board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the example runs successfully, the following message is displayed in the terminal
PFlash Example Start
PFlash Information:
Total Program Flash Size: 64 KB, Hex: (0x10000)
Program Flash Sector Size: 1 KB, Hex: (0x400)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0xfc00 -> 0x10000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0xfc00 -> 0xfc10
End of PFlash Example
FRDM-KE17Z
Hardware requirements
Micro USB cable
FRDM-KE17Z board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the example runs successfully, the following message is displayed in the terminal
PFlash Example Start
PFlash Information:
Total Program Flash Size: 256 KB, Hex: (0x40000)
Program Flash Sector Size: 2 KB, Hex: (0x800)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x3f800 -> 0x40000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x3f800 -> 0x3f810
End of PFlash Example
FRDM-KE17Z512
Hardware requirements
Micro USB cable
FRDM-KE17Z512 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the example runs successfully, the following message is displayed in the terminal
PFlash Example Start
PFlash Information:
Total Program Flash Size: 256 KB, Hex: (0x40000)
Program Flash Sector Size: 2 KB, Hex: (0x800)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x3f800 -> 0x40000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x3f800 -> 0x3f810
End of PFlash Example
FRDM-MCXC041
Hardware requirements
Type-C USB cable
FRDM-MCXC041 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
FRDM-MCXC242
Hardware requirements
USB-C cable
FRDM-MCXC242 board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
FRDM-MCXC444
Hardware requirements
Type-C USB cable
FRDM-MCXC444 board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
TWR-KM34Z50MV3
Hardware requirements
Mini USB cable
TWR-KM34Z50MV3 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the following message is displayed in the terminal:
PFlash example Start
PFlash Information:
Total Program PFlash Size: xx KB, Hex: (xx)
Program PFlash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
TWR-KM34Z75M
Hardware requirements
Mini USB cable
TWR-KM34Z75M board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the following message is displayed in the terminal:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
TWR-KM35Z75M
Hardware requirements
Micro USB cable
TWR-KM35Z75M board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the demo runs successfully, the following message is displayed in the terminal:
FLASH example Start
Flash Information:
Total Program Flash Size: xx KB, Hex: (xx)
Program Flash Sector Size: xx KB, hex: (xx)
...
Flash is xx
Erase a sector of flash
Successfully Erased Sector xx -> xx
Program a buffer to a sector of flash
Successfully Programmed and Verified Location xx -> xx
End of FLASH example
FRDM-MCXE247
Hardware requirements
Micro USB cable
FRDM-MCXE247 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and USB port on the target board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
When the example runs successfully, the following message is displayed in the terminal
PFlash Example Start
PFlash Information:
Total Program Flash Size: 256 KB, Hex: (0x40000)
Program Flash Sector Size: 2 KB, Hex: (0x800)
Flash is UNSECURE!
Erase a sector of flash
Successfully Erased Sector 0x3f800 -> 0x40000
Program a buffer to a sector of flash
Successfully Programmed and Verified Location 0x3f800 -> 0x3f810
End of PFlash Example