CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

sst25vf.c Bug fixes

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

sst25vf.c Bug fixes
PostPosted: Wed Aug 06, 2014 1:51 pm     Reply with quote

File: sst25vf.c
Location: C:\Program Files (x86)\PICC\Drivers
Compiler Version: v5.015

BUG #1
The following line
Code:
#define FLASH_ADDR_INVALID(addr) (addr > FLASH_SIZE)

needs to be changed to:
Code:
#define FLASH_ADDR_INVALID(addr) (addr >= FLASH_SIZE)

because addresses starts at zero, and the last byte is stored at FLASH_SIZE-1


BUG #2
At the start of the function void ext_flash_protect(FLASH_PROTECT_RANGE range), the following line should be added:
Code:
range=range<<2;

because BP0 is second bit of the Status Register.


BUG #3
In the function void ext_flash_protect(FLASH_PROTECT_RANGE range) this line
Code:
_ext_flash_send(SST25VF_WRITE_STATUS, TRUE);

needs to be changed into:
Code:
_ext_flash_send(SST25VF_WRITE_STATUS, FALSE);


BUG #4
Search for the following line:
Code:
static uint8_t _ext_flash_block_sizes[3] = {4096, 32768, 65536};

and change the uint8_t to uint32_t


Possible Compiler Bug
In function void ext_flash_protect(FLASH_PROTECT_RANGE range)
FLASH_XFER(range|FLASH_PROTECT_LOCK); was giving unpredictible results, following worked for me:
Code:

uint8_t reg2send = range|FLASH_PROTECT_LOCK;
FLASH_XFER(reg2send);


More bugs incoming ...[/b]
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group