stm32mon: fix unable to flash to nyan board problem

When comparing chip name of "STM32L15", use strncmp to compare the
first 8 characters.

BUG=chrome-os-partner:34558
BRANCH=none
TEST=flash_ec --board nyan

Change-Id: I3318385cee1d4e4c4d9688591f7a7bfd46c54dee
Signed-off-by: Yen Lin <yelin@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/235511
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
This commit is contained in:
Yen Lin
2014-12-12 17:17:51 -08:00
committed by chrome-internal-fetch
parent fb05f74223
commit 5898366382

View File

@@ -903,7 +903,7 @@ int main(int argc, char **argv)
command_write_unprotect(ser);
if (flags & FLAG_ERASE || output_filename) {
if (!strcmp("STM32L15", chip->name)) {
if (!strncmp("STM32L15", chip->name, 8)) {
/* Mass erase is not supported on STM32L15xx */
/* command_ext_erase(ser, ERASE_ALL, 0); */
int i, page_count = chip->flash_size / chip->page_size;