sdcard_fatfs#
Overview#
The SDCARD FATFS project is a demonstration program that uses the SDK software. Tt mounts a file system based on a SD card then does “creat directory/read directory/create file/write file/read file”operation. The file sdhc_config.h has default SDHC configuration which can be adjusted to let carddriver has different performance. The purpose of this example is to show how to use SDCARD driver based FATFS disk in SDK software.
Supported Boards#
EVKB-IMXRT1050
Hardware requirements
Mini/micro USB cable
EVKB-IMXRT1050 board
Personal Computer
SD card
Board settings
Please insert the SDCARD into card slot(J20) Note: If you want to use a SD3.0 card with SD3.0 protocol, just insert a SD3.0 card into the card slot will be ok.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
MIMXRT1060-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKB board
Personal Computer
SD card
Board settings
Make sure resistors R368/R347/R349/R365/R363 are removed.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
MIMXRT1170-EVKB
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1170 board
Personal Computer
SD card
Board settings
Please make sure R136 is weld for GPIO card detect.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
MIMXRT1060-EVKC
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKC board
Personal Computer
SD card
Board settings
No special settings are required.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
FRDM-IMXRT1152
Hardware requirements
Type-C USB cable
FRDM-IMXRT1152 board
Personal Computer
SD card
Board settings
Please make sure R23 is weld for GPIO card detect.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
EVK-MIMXRT1020
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1020 board
Personal Computer
SD card
Board settings
Please insert the SDCARD into card slot(J15), make sure C28 is welded. Note: If you want to use a SD3.0 card with SD3.0 protocol, just insert a SD3.0 card into the card slot will be ok.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1024-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1024-EVK board
Personal Computer
SD card
Board settings
Please insert the SDCARD into card slot(J15), make sure C28 is welded. Note: If you want to use a SD3.0 card with SD3.0 protocol, just insert a SD3.0 card into the card slot will be ok.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1040-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1040-EVK board
Personal Computer
SD card
Board settings
Please insert the SDCARD into card slot Note: If you want to use a SD3.0 card with SD3.0 protocol, just insert a SD3.0 card into the card slot will be ok. As the EVK board limitaion, there is eletronic mux added for switch between M.2 and sdcard which will affect the sdcard SDR104 timing. So the maximum sd card timing frequency been decreased to 100MHZ to improve the stability. User can remove the limitation by change the macro BOARD_SDMMC_SD_HOST_SUPPORT_SDR104_FREQ in sdmmc_config.h from (100000000U) to (200000000U).
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
EVK-MIMXRT1064
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1064 board
Personal Computer
SD card
Board settings
Please insert the SDCARD into card slot Note: If you want to use a SD3.0 card with SD3.0 protocol, just insert a SD3.0 card into the card slot will be ok.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1160 board
Personal Computer
SD card
Board settings
Please make sure R136 is weld for GPIO card detect.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
SD card
Board settings
1.Please make sure R257/R140 is weld for GPIO card detect. 2.Please make sure J76 1-2 and J57 2-3 are installed for sdcard socket. Note: As the EVK board limitaion, there is eletronic mux added for switch between M.2 and sdcard which will affect the sdcard SDR104 timing. So the maximum sd card timing frequency been decreased to 100MHZ to improve the stability. User can remove the limitation by change the macro BOARD_SDMMC_SD_HOST_SUPPORT_SDR104_FREQ in sdmmc_config.h from (200000000U / 2U) to (200000000U).
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Insert SD card to card slot
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 demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
EVK-MIMXRT595
Hardware requirements
Micro USB cable
EVK-MIMXRT595 board
Personal Computer
SD Card
Board settings
Make sure resistors R691~R697 are populated and resistors R611~R620,R660, R661 are removed.
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J40) on the 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.
Launch the debugger in your IDE to begin running the demo.
Please insert the SDCARD into card slot(J32)
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EVK-MIMXRT685
Hardware requirements
Micro USB cable
EVK-MIMXRT685 board
Personal Computer
Board settings
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FRDM-K32L3A6
Hardware requirements
Micro USB cable
FRDM-K32L3A6 board
Personal Computer
micro SD card
Board settings
1.Please insert the SDCARD into card slot(J9) 2.Make sure R153. R154, R156, R157 is switch to 1-2. Note: Due to FRDM board do not provide 1.8V IO voltage for SD part, so cannot switch to DDR50 mode. And the CARD detect PIN level is high when card is inserted.
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
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Detected SD card inserted.
Makes file system......This time may be long if the card capacity is big.
Creates directory......
Creates a file in that directory......
Lists the file in that directory......
Directory file : ..
Directory file : ...
General file : F_1.DAT.
Writes/reads file until encounters error......
Writes to above created file.
Reads from above created file.
Compares the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
FRDM-MCXN947
Hardware requirements
Type-C USB cable
FRDM-MCXN947 board
Personal Computer
Board settings
SD Card slot J12 need to manual weld
Prepare the Demo
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FRDM-MCXN947T
Hardware requirements
Type-C USB cable
FRDM-MCXN947T board
Personal Computer
Board settings
SD Card slot J12 need to manual weld
Prepare the Demo
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LPCXpresso54628
Hardware requirements
Mini USB cable
LPCXpresso54628 board
Personal Computer
Board settings
Insert the card into the card slot
Prepare the Example
Connect a mini USB cable between the PC host and the OpenSDA USB port (J2) on twrk64f120m board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
LPCXpresso54S018
Hardware requirements
Mini USB cable
LPCXpresso54S018 board
Personal Computer
Board settings
Insert the card into the card slot
Prepare the Example
Connect a mini USB cable between the PC host and the OpenSDA USB port (J2) on twrk64f120m board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
Running the demo
This demo is an external flash plain load demo, ROM will copy image in external flash to SRAMX to run:
Build the demo to generate a bin file. Note: If need to generate bin file using MCUXpresso IDE, below steps need to be followed: Set in example Properties->C/C++ Build->Settings->Build steps->Post-build steps->Edit enbable arm-none-eabi-objcopy -v -O binary “&{BuildArtifactFileName}” “&{BuildArtifactFileBaseName}.bin”
This plainload example linked the vector table to 0x00000000, but program to external flash 0x10000000.
Program the bin file to external on board flash via SEGGER J-FLASH Lite(V6.22 or higher):
a. Open SEGGER J-FLASH Lite, select device LPC54S018.
b. Click the ‘Erase Chip’ to erase the extrenal flash.(if can not success, press SW4 button and reset the board, and try to erase again)
c. Select the bin data file, set the ‘.bin/Erase Start’ address to 0x10000000, then click ‘Program Device’ Note: Please use above way to program the binary file built by armgcc tool chain to external flash. For IAR, KEIL, MCUXpresso IDE, you can use the IDE tool to program the external flash.
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
LPCXpresso54S018M
Hardware requirements
Mini USB cable
LPCXpresso54S018M board
Personal Computer
Board settings
Insert the card into the card slot
Prepare the Example
Connect a mini USB cable between the PC host and the OpenSDA USB port (J2) on twrk64f120m board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
Running the demo
This demo is an external flash plain load demo, ROM will copy image in external flash to SRAMX to run:
Build the demo to generate a bin file. Note: If need to generate bin file using MCUXpresso IDE, below steps need to be followed: Set in example Properties->C/C++ Build->Settings->Build steps->Post-build steps->Edit enbable arm-none-eabi-objcopy -v -O binary “&{BuildArtifactFileName}” “&{BuildArtifactFileBaseName}.bin”
This plainload example linked the vector table to 0x00000000, but program to external flash 0x10000000.
Program the bin file to external on board flash via SEGGER J-FLASH Lite(V6.22 or higher):
a. Open SEGGER J-FLASH Lite, select device LPC54S018M.
b. Click the ‘Erase Chip’ to erase the extrenal flash.(if can not success, press SW4 button and reset the board, and try to erase again)
c. Select the bin data file, set the ‘.bin/Erase Start’ address to 0x10000000, then click ‘Program Device’ Note: Please use above way to program the binary file built by armgcc tool chain to external flash. For IAR, KEIL, MCUXpresso IDE, you can use the IDE tool to program the external flash.
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
LPCXpresso55S28
Hardware requirements
Mini USB cable
LPCXpresso55S28 board
Personal Computer
Board settings
Insert the card into the card slot
Prepare the Example
Note: MCUXpresso IDE project default debug console is semihost
Connect a micro USB cable between the PC host and the LPC-Link USB port (P6) on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LPCXpresso55S69
Hardware requirements
Mini USB cable
LPCXpresso55S69 board
Personal Computer
Board settings
Insert the card into the card slot
Prepare the Example
Note: MCUXpresso IDE project default debug console is semihost
Connect a micro USB cable between the PC host and the LPC-Link USB port (P6) on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Reset the SoC and run the project.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MCX-N5XX-EVK
Hardware requirements
Micro USB cable
MCX-N5XX-EVK board
Personal Computer
Board settings
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MCX-N9XX-EVK
Hardware requirements
Micro USB cable
MCX-N9XX-EVK board
Personal Computer
Board settings
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MIMXRT685-AUD-EVK
Hardware requirements
Micro USB cable
MIMXRT685-AUD-EVK board
Personal Computer
Board settings
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the 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.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MIMXRT700-EVK
Hardware requirements
Micro USB cable
MIMXRT700-EVK board
Personal Computer
SD Card
Board settings
Make sure JP65 1-2 connected. Recommend SD Cards used to run the example
Brand |
Mode |
Size |
Speed Class |
Video Speed Class |
UHS |
A1 |
A2 |
|---|---|---|---|---|---|---|---|
SanDisk |
Ultra |
16GB |
10 |
- |
- |
YES |
- |
SanDisk |
Extreme |
64GB |
- |
V30 |
3 |
- |
YES |
SanDisk |
Ultra Plus |
32GB |
10 |
V10 |
- |
YES |
- |
SanDisk |
ImageMate PRO |
32GB |
- |
V30 |
3 |
YES |
- |
Kingston |
- |
16GB |
10 |
- |
1 |
- |
- |
Prepare the Demo
Connect a micro USB cable between the PC host and the Debug port on the 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.
Launch the debugger in your IDE to begin running the demo.
Please insert the SDCARD into card slot(J47)
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FRDM-IMXRT700
Hardware requirements
Type-C USB cable
FRDM-IMXRT700 board
Personal Computer
SD Card
Board settings
Recommend SD Cards used to run the example
Brand |
Mode |
Size |
Speed Class |
Video Speed Class |
UHS |
A1 |
A2 |
|---|---|---|---|---|---|---|---|
SanDisk |
Ultra |
16GB |
10 |
- |
- |
YES |
- |
SanDisk |
Extreme |
64GB |
- |
V30 |
3 |
- |
YES |
SanDisk |
Ultra Plus |
32GB |
10 |
V10 |
- |
YES |
- |
SanDisk |
ImageMate PRO |
32GB |
- |
V30 |
3 |
YES |
- |
Kingston |
- |
16GB |
10 |
- |
1 |
- |
- |
Prepare the Demo
Connect a USB cable between the PC host and the Debug port on the 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.
Launch the debugger in your IDE to begin running the demo.
Please insert the SDCARD into card slot(J47)
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
FATFS example to demonstrate how to use FATFS with SD card.
Please insert a card into board.
Card inserted.
Make file system......The time may be long if the card capacity is big.
Create directory......
Create a file in that directory......
Create a directory in that directory......
List the file in that directory......
General file : F_1.DAT.
Directory file : DIR_2.
Write/read file until encounters error......
Write to above created file.
Read from above created file.
Compare the read/write content......
The read/write content is consistent.
Input 'q' to quit read/write.
Input other char to read/write file again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~