Loading...
 
Skip to main content

System Workbench for STM32


Function Using at STM32

Well,I met some problems about STM32F030F4P6 and the datasheet of STM32F030F4P6 is given below.
It can operate when I use the following function:
void FSMC_SRAM_ReadBuffer(u8* pBuffer,u32 ReadAddr,u32 n)
{
        for(;n!=0;n--)  
        {                                                                                            
                *pBuffer++=*(vu8*)(Bank1_SRAM3_ADDR+ReadAddr);    
                ReadAddr++;
        }  
}
However,when I change this funtion to be:
void FSMC_SRAM_ReadBuffer(u8* pBuffer,u32 ReadAddr,u32 n)
{
        for(;n!=0;n--)  
        {                                                                                            
                *pBuffer=*(vu8*)(Bank1_SRAM3_ADDR+ReadAddr);   
                 pBuffer++; 
                ReadAddr++;
        }  
}
The problems occurred. What’s the difference between two funtions? Aren’t they same? The debugging way:
        for (val = 0; val < 256; val++)
        {
                bufval = val;
        }
        FSMC_SRAM_WriteBuffer(buf, 0 , 256);
        FSMC_SRAM_ReadBuffer(buf, 0 , 256);
com3_send_str(256, buf);



Why? I am so confusing!
Please give me some help ! Appreciate it a lot!