You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/09 22:33:44 UTC

[GitHub] [incubator-nuttx] zouboan edited a comment on pull request #5451: drivers/mtd/sst39vf.c: patch adress map issue

zouboan edited a comment on pull request #5451:
URL: https://github.com/apache/incubator-nuttx/pull/5451#issuecomment-1034267101


   @xiaoxiang781216  >>1 is also need, because the origin code have issue,for example, the start address sector 1 of sst39vf, the address pin A0~A11 is 0x800, because the sst39vf is 16bit nor flash, each sector is 2K word , the hardware will connect A0 to CPU's A1 ,and A11 to CPU's A12, so the start address sector 1 of sst39vf in CPU's address should be CONFIG_SST39VF_BASE_ADDRESS + 0x1000
   take sst39vf_bread function for example :
   startblock = 1 and priv->chip->sectorsize = 4 * 1024 = 0x1000
   source = (FAR const uint8_t *)SST39VF_ADDR(startblock * priv->chip->sectorsize);
   = CONFIG_SST39VF_BASE_ADDRESS + 0x2000 which is address of sector 2! that's wrong!
   we should correct it as:
   source = (FAR const uint8_t *)SST39VF_ADDR(startblock * priv->chip->sectorsize >> 1);


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org