Merge pull request #14050 from evva-sfw/fix_qspif_erase

fix QSPI-API for NRF52
pull/14067/head
Martin Kojtal 2020-12-17 12:52:32 +00:00 committed by GitHub
commit f5ef511c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ TODO
// NRF SFDP defines
#define DWORD_LEN 4
#define SFDP_CMD_LEN DWORD_LEN
#define SFDP_DATA_LEN 128 // SFPD data buffer length in bytes, may need to be increased for other flash parts
#define SFDP_DATA_LEN QSPIF_SFDP_DATA_LEN // SFPD data buffer length in bytes, may need to be increased for other flash parts
#define SFDP_READ_LEN 8 // 8 SFDP bytes can be read at a time
#define SFDP_READ_MAX (SFDP_DATA_LEN / SFDP_READ_LEN)
@ -559,14 +559,9 @@ qspi_status_t sfdp_read(qspi_t *obj, const qspi_command_t *command, void *data,
return QSPI_STATUS_ERROR;
}
// calculate the SFDP data length based on the parameter table offset
// provided at index 12, plus the table length in DWORDS at index 11
uint32_t sfdp_length = sfdp_rx[12] + (sfdp_rx[11] * DWORD_LEN);
// check if the data request is within the SFDP data array
// increase SFDP_DATA_LEN to match sfdp_length, if necessary
if ( sfdp_length <= SFDP_DATA_LEN &&
sfdp_length >= (command->address.value + *length) ) {
if ( SFDP_DATA_LEN >= (command->address.value + *length) ) {
memcpy(data, (sfdp_rx + command->address.value), *length);
return QSPI_STATUS_OK;
} else {

View File

@ -5568,6 +5568,11 @@
"uart_1_fifo_size": {
"help": "UART1 FIFO buffer. FIFO buffer is filled from DMA buffer.",
"value": 32
},
"qspif_sfdp_data_len": {
"help": "length of Flash SFDP DATA",
"value": 128,
"macro_name": "QSPIF_SFDP_DATA_LEN"
}
},
"overrides": {