W806 interior FLASH Read problem

Publish in 2022-04-17 20: 31: 19

SDK inside wm_flash_demo. c build-in flash routine, Burn chip test error, Reading problem.
Do you have this problem, How to solve it

Here is the official code

int flash_demo (void) 
{
    u8 *write_buf = NULL; 
    u8 *read_buf = NULL; 
    u16 i; 

    tls_fls_init () ;                                     //initialize flash driver

    write_buf = tls_mem_alloc (TEST_FLASH_BUF_SIZE) ; 
    if  (NULL == write_buf) 
    {
        printf ("\nmalloc write buf error\n") ; 
        return WM_FAILED; 
    }

    for  (i = 0;  i  " TEST_FLASH_BUF_SIZE;  i ++) 
    {
        write_buf[i] = i + 1; 
    }

    tls_fls_write (0x1F0303,  write_buf,  1247) ;             /**verifying cross sector writing*/
    tls_fls_write (0x1F0303 + 1247,  write_buf + 1247,  2571) ; 
    tls_fls_write (0x1F0303 + 1247 + 2571,  write_buf + 1247 + 2571,  182) ; 

    read_buf = tls_mem_alloc (TEST_FLASH_BUF_SIZE) ; 
    if  (NULL == read_buf) 
    {
        printf ("\nmalloc read buf error\n") ; 
        tls_mem_free (write_buf) ; 
        return WM_FAILED; 
    }
    memset (read_buf,  0,  TEST_FLASH_BUF_SIZE) ; 
    tls_fls_read (0x1F0303,  read_buf,  TEST_FLASH_BUF_SIZE) ; 

    if  (0 == memcmp (write_buf,  read_buf,  TEST_FLASH_BUF_SIZE) ) 
    {
        printf ("\nsuccess\n") ; 
    }
    else
    {
        printf ("\nfail\n") ; 
    }

    tls_mem_free (write_buf) ; 
    tls_mem_free (read_buf) ; 

    return WM_SUCCESS; 
}

See more

follower
0
Be viewed
2. 5k
Dashin
Dashin Certified specialist 2022-04-18
Hardware development, Software development, System development, Engineering framework, Scheme design

tls_fls_write (0x1F0303, write_buf, 1247) ; The first parameter is relative 0x8000000 Offset of the base address, So you just put an address that's within the storage capacity, Be on bad terms ROM conflicting, For example 0x5000.

3 Multiple replies
Mrzhao
Mrzhao Certified specialist 2022-04-18
An embedded enthusiast. CSDN Home page: https: //blog. csdn. net/qq_37280428? spm=1011. 2415. 3001. 5343

Please describe your problem in detail, Emerging phenomenon, What have you tried, No, others don't quite understand what you are trying to say

zhihang9122
zhihang9122 2022-04-20
This guy is lazy, Nothing written!

Got it, What went wrong by reading and writing the return number

Write an answer

Please login to post your answer, Click to log in

publish
problem

Share
Friend

Cell phone
browse

Scan code mobile browsing