[AT-START-F403A Evaluation] 4. FreeRTOS system based on IAR environment external flash (SPIM) operation evaluation
[Copy link]
The last evaluation achieved a rough test of the performance of the external SPIM QSPI Flash. This evaluation will divide the external flash into two parts:
- 0x08400000-0x0840FFFF is used as the data area,
- 0x08410000-0x093FFFFF is used as the code running area. The three LED lighting tasks (threads) previously evaluated are run in this area.
- Customize project link configuration:
- Customize the link configuration file, copy the AT32F403AxG.icf file from the IAR installation directory\arm\config\linker\ArteryTek directory to the project directory and rename it to AT32F403AxG_extFlash.icf. Add it to the project for easy modification, as shown in the figure below.
-
- Modify the link configuration file and add ROM space symbol definitions:
- define symbol __ICFEDIT_region_ROM_BANK3_start__ = 0x08410000;
- define symbol __ICFEDIT_region_ROM_BANK3_end__ = 0x093FFFFF;
- define region ROM_BANK3_CODE_region =mem:[from __ICFEDIT_region_ROM_BANK3_start__ to __ICFEDIT_region_ROM_BANK3_end__];
- place in ROM_BANK3_CODE_region {readonly section .text object led_task.o};
-
- Specify the project link configuration file:
- Enter the menu project->option, and in the pop-up dialog box, select Linker->config
- Select the Override Default option and select the modified link profile
- Custom download bootloader:
- Copy the two files in the IAR installation directory\arm\config\flashloader\ArteryTek\AT32F403A\AT32F403ACGT7 directory to the project.
- FlashAT32F403ACGT7.flash
- FlashAT32F403ACGT7.board
- Rename the two files to AT32F403ACGT7_extFlash.board and AT32F403ACGT7_extFlash.flash, and modify the content in AT32F403ACGT7_extFlash.flash as shown below
-
- Specify the project bootloader configuration.
- Enter the menu project->option,
- In the pop-up dialog box, select Debugger>Download.
- Check Override default .board file
- The changes are shown in the figure below.
- Click the Edit… button and change as shown below
- Specify the debug device description file (DDF):
- Copy AT32F403AxG.ddf from the IAR installation directory \ \arm\config\debugger\ArteryTek to this directory and rename it to AT32F403AxG_extFlash.ddf.
- In order to facilitate IAR debugging and observation of the downloaded code, it is necessary to customize the device description file for IAR debugging and add external flash custom space definition. As shown below
-
- Specifying a DDF File
- SPIM related source code (omitted):
See the previous SPIM initialization instructions.
- Compile verification:
- After the compilation is successful, open the compiled memory mapping file at32403a_eval.map, search for the led_task keyword, as shown in the figure below, and place it in the overview, which is already in the predetermined area.
-
- These two areas are described in detail
- Run location validation
- Set the corresponding breakpoints in each task and run until the breakpoint is encountered. Observe that the assembly address is indeed in the area where 0x08410000 is located.
- Operation Results
-
- The running speed of external flash has not been tested and cannot be determined. It will be supplemented later.
- When downloading, an error message is displayed. Observe the debug log information Verification error at 0x08410000: mem = 0xFF, file = 0x38. It should be that the debugger does not read the external flash data correctly. However, the actual observation is correct, as shown in the figure below, and no problems have been found during debugging and running. If problems are found later, they will be corrected or supplemented.
|