2361 views|5 replies

1942

Posts

2

Resources
The OP
 

[AT-START-F403A Review] Part 5: On-chip Flash routine test [Copy link]

 

1. Introduction

Flash is very important for chips. This article will first talk about the use of Flash. The official has already provided a Demo, so we can use it as long as we know how it works. The performance can also be tested, but this article will not talk about it first.

2. Testing

First open the Flash read and write routines, the routines used are shown in the figure.

After using Keil to open the routine, you can see that the address written to Flash is [0x80000000+1024*522]. The Flash read buffer and write buffer are created respectively. Finally, the Flash read and write processes are run in the main program.

In order to be able to see when the reading and writing are performed, the program in main is modified as shown below.

int main(void)
{

  Delay_init();
  UART_Print_Init(115200);	
  AT32_LEDn_Init(LED2);				
  AT32_LEDn_Init(LED3);			
	printf("Flash Demo Start!\r\n");

  //Fill BufferWrite data to test
  for(Index=0;Index<TEST_BUFEER_SIZE;Index++)
  {
    BufferWrite[Index]=Index;
  }
		
    FLASH_Write(TEST_FLASH_ADDRESS_START,BufferWrite,TEST_BUFEER_SIZE);		//Write data to flash
		printf("Write Success!\r\n");
    FLASH_Read(TEST_FLASH_ADDRESS_START,BufferRead,TEST_BUFEER_SIZE);   	//read data from flash
		printf("Read Success!\r\n");

  if(Buffercmp(BufferWrite,BufferRead,TEST_BUFEER_SIZE)==PASSED)        //Compare the buffer
  {
    AT32_LEDn_ON(LED2);
    AT32_LEDn_OFF(LED3);    
  }
  else
  {
    AT32_LEDn_OFF(LED2);
    AT32_LEDn_ON(LED3);  
  }

  while(1)
  {

  }
}

Then connect the serial port, the serial port on the board sends PA9, connect the RX of the serial port module to PA9 on the board, and finally run the program. The content printed on the serial port is as shown in the figure below. It seems that the reading speed is quite fast, and the serial port does not recognize that it is a new data.

Next, let's debug and check the storage status of Flash. First, run the program to while(1), and then check the content at the address [0x80000000+1024*522]. You can see that it is the same as the written content, and data is stored starting from 0.

Then check whether the content of the received Buffer is consistent. You can see that the content of the received Buffer is consistent with the content of the sent Buffer, which means that the reading is also normal.

3. Summary

The Flash reading and writing of AT-START-F403A is still very easy to use, but I don’t know how much data can be read and written at a time. We will test it in the next article.

This post is from Domestic Chip Exchange

Latest reply

Well organized   Details Published on 2021-2-25 18:48
 
 

1w

Posts

204

Resources
From 2
 

Yatli AT-START-F403A Review

Summary post: https://en.eeworld.com/bbs/thread-1143018-1-1.html

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

7422

Posts

2

Resources
3
 

The packaging is quite good. The flash operation and packaging of some factories are complicated.

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1942

Posts

2

Resources
4
 

Yes, but some are encapsulated to be used as storage management systems, and I have encountered one.

This post is from Domestic Chip Exchange
 
 
 

6062

Posts

4

Resources
5
 

Not bad, it can be used if the storage content is not very large and it is not used frequently. A board can save a few cents.

This post is from Domestic Chip Exchange
 
 
 

6547

Posts

0

Resources
6
 

Well organized

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list