On Friday 18 September 2009, Alain Mouette wrote: > This is a bit old, but better then never... > > David Brownell escreveu: > > On Friday 04 September 2009, Alain Mouette wrote: > >> Error: failed erasing sectors 0 to 255 (-901) > > > > flash.h:#define ERROR_FLASH_SECTOR_INVALID (-901) > > > > If you > > > > flash probe 0 > > flash erase_check 0 > > flash protect_check 0 > > flash info 0 > > > > before you try writing the code, what does it show? > > Problem solved, thanks. I was just erasing too many sectors :( > > I followed that error in stelaris.c and I want to *suggest* a change > (tested): in stelaris.c line 584
In the current code, line 584 looks nothing like this ... that's part of why we ask folk to (a) submit patches not just describe changes, and (b) submit patches against *CURRENT* code. That said, Johnny Halfmoon recently posted a generic patch providing a special "to end of flash" value for the erase and protect commands, and I think that would be a better solution than a Stellaris-specific patch. Agree? > ----------from: > if ((first < 0) || (last < first) || (last >= > (int)stellaris_info->num_pages)) > { > return ERROR_FLASH_SECTOR_INVALID; > } > > ----------to: > if (last >= (int)stellaris_info->num_pages) > { > LOG_WARNING("Too many sectors, reducing do max=%d", > (int)stellaris_info->num_pages - 1); > last = (int)stellaris_info->num_pages - 1; > } > if ((first < 0) || (last < first)) > { > return ERROR_FLASH_SECTOR_INVALID; > } > > ---------- > Tha main advantage is that fewer scrips can be used for a bigger number > of chips. And it also reduce user errors :) > > Alain > _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development