embarc_osp icon indicating copy to clipboard operation
embarc_osp copied to clipboard

norflash erase last address calculation error

Open CosmicRoach opened this issue 1 year ago • 1 comments

https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp/blob/67ea926c6a62aa6e19efdc3b11cba3ea0b467e29/device/peripheral/flash/w25qxx/spi_flash_w25qxx.c#L267

Use the size to calculate the last address needs to subtract 1: last_address = (address + size -1) & (~(dev->sector_sz - 1));

CosmicRoach avatar Apr 24 '24 09:04 CosmicRoach

@CosmicRoach could you please submit a pull-request with the proposed fix?

abrodkin avatar Apr 24 '24 11:04 abrodkin