КАТЕГОРИИ:
АстрономияБиологияГеографияДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРиторикаСоциологияСпортСтроительствоТехнологияФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника
|
Using SPI Flash Devices
Using SPI Flash Device explains the steps to create applications for embedded Flash devices that use the SPI bus.
Include into the project and configure the following source files:
- The library that matches the device core:
FS_CM3.lib for Cortex-M devices. FS_ARM_L.lib for ARM7 or ARM9 devices. - The description files:
FS_SPI_FlashDev.h containing the sector layout. FS_SPI_FlashPrg.c containing the Flash programming algorithm. - The configuration files:
File_Config.c for configuring the device. Retarget.c for configuring the output. - The main file for initializing and connecting the Flash device.
5. #include <RTL.h>
6.
7. int main (void) {
8. ...
9. init_comm (); // initialize communication port
10. init_file (); // initialize and format device
11.
12. while (1) {
13. ... // add the code
14. }
15. }
Applications can be created using existing µVision projects as templates.
- Copy all files from any folder \ARM\Boards\vendor\board\RL\FlashFS\EM_File to a new folder and open the project *.uvproj with µVision. RTX projects are using the RTX-RTOS. However, the configuration does not differ.
- Open the file File_Config.c and configure the Flash device using the Configuration Wizard.
- Enable SPI Flash Drive and set the device characteristics.
- Adapt the code in the files FS_SPI_FlashDev.h and FS_SPI_FlashPrg.c that contain the sector layout and Flash programming algorithms.
- Modify the code to the application needs.
Note
- Configuration options are described in SPI Flash Drive.
|