Skip to content

Commit

Permalink
ports/psoc6: Fixed flash erase issue.
Browse files Browse the repository at this point in the history
Signed-off-by: NikhitaR-IFX <[email protected]>
  • Loading branch information
NikhitaR-IFX committed Jan 17, 2024
1 parent 3e005e1 commit 7dd2cfe
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ports/psoc6/modules/psoc6/psoc6_qspi_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,12 @@ STATIC mp_obj_t psoc6_qspi_flash_ioctl(mp_obj_t self_in, mp_obj_t cmd_in, mp_obj
return MP_OBJ_NEW_SMALL_INT(EXT_FLASH_BLOCK_SIZE_BYTES);
case MP_BLOCKDEV_IOCTL_BLOCK_ERASE: {
uint32_t offset = mp_obj_get_int(arg_in) * EXT_FLASH_BLOCK_SIZE_BYTES;
mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
cy_rslt_t result = cy_serial_flash_qspi_erase(self->flash_base + offset, cy_serial_flash_qspi_get_erase_size(self->flash_base + offset));

if (CY_RSLT_SUCCESS != result) {
mplogger_print("psoc6_qspi_flash_ioctl() failed while erasing block with error code: %u\n", CY_RSLT_GET_CODE(result));
mp_raise_ValueError(MP_ERROR_TEXT("psoc6_qspi_flash_ioctl() - QSPI Flash erase failed !"));
}
MICROPY_END_ATOMIC_SECTION(atomic_state);
return MP_OBJ_NEW_SMALL_INT(0);
}
default:
Expand Down

0 comments on commit 7dd2cfe

Please sign in to comment.