Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MiscDrivers): Allow valid param address + txlen <= W25_DEVICE_SIZE when calling Ext_Flash_Program_Page() #748

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libraries/MiscDrivers/ExtMemory/Ext_Flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ int Ext_Flash_Write_SR(uint8_t value, Ext_Flash_StatusReg_t reg_num);
* @retval 0 Success
* @retval Non-zero Error condition
*/
int Ext_Flash_Flash_Block_WP(uint32_t addr, uint32_t begin);
int Ext_Flash_Block_WP(uint32_t addr, uint32_t begin);

/**
* @brief Returns the start and end address of the available flash memory based on the current write protection scheme
Expand Down
2 changes: 1 addition & 1 deletion Libraries/MiscDrivers/ExtMemory/w25.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int Ext_Flash_Program_Page(uint32_t address, uint8_t *tx_buf, uint32_t tx_len,
}

// if flash address is out-of-range
if ((address >= W25_DEVICE_SIZE) || ((address + tx_len) >= W25_DEVICE_SIZE)) {
if ((address >= W25_DEVICE_SIZE) || ((address + tx_len) > W25_DEVICE_SIZE)) {
return EF_E_BAD_PARAM; // attempt to write outside flash memory size
}

Expand Down