ΣSigmaStudio Ask AI Русский Log in

Disable block protect at startup

Processors & DSP SVarghaei385 Feb 4, 2020 00:00 1 replies Original on forum ↗
Subscribe
SVarghaei385 Question
Feb 4, 2020 00:00

Hi,

Inside the following function, it is commented that /* make sure to disable block protection at startup, otherwise we cannot write to flash */. How can I do it?

static int w25q32bv_open(struct flash_info *fi)
{
fi->size = 0x400000;
fi->number_of_regions = 1;
fi->erase_block_regions = malloc(fi->number_of_regions * sizeof (struct erase_block_region));

if (fi->erase_block_regions == NULL)
return -1;

fi->erase_block_regions[0].block_size = BLOCK_SIZE;
fi->erase_block_regions[0].number_of_blocks = NUM_SECTORS;

/* make sure to disable block protection at startup, otherwise we cannot write to flash */
w25q32bv_write_status(fi, 0, 0);

return 0;
}

Is it correct setting?, because I can't still write into the flash.

The function is taken from the example code Power_On_Self_Test BF706

Thank you

Best Regards

flash

spi

power_on_self_test

bf706

blackfin

pastedimage1580812741917v1.png
pastedimage1580812741917v1.png
ADIApproved Reply
Feb 14, 2020 00:00

Hi SVA,

This issue is already handled through private support. To avoid duplication of efforts, you can continue the discussions through private support and we will post the final resolution here if appropriate.

Regards,
Anand Selvaraj.