Hi Andrzej,
Thanks for reporting this. It should be easy to fix, I just wanted to check - a
code page size of zero is because of a bad SWD connection, yes? It's still a
fatal error, but openocd should just print an error and fail cleanly instead of
crashing?
Thanks,
Angus
---
** [tickets:#103] Division by 0 in flash/nor/nrf51.c**
**Status:** new
**Milestone:** 0.9.0
**Created:** Thu Jul 30, 2015 03:19 PM UTC by Andrzej Telszewski
**Last Updated:** Thu Jul 30, 2015 03:19 PM UTC
**Owner:** nobody
Hi,
It's possible to get division by 0 and crash the application in
flash/nor/nrf51.c.
On line 630 you read:
res = target_read_u32(chip->target, NRF51_FICR_CODEPAGESIZE,
&chip->code_page_size);
And then on line 650 you divide:
bank->num_sectors = bank->size / chip->code_page_size;
It's possible for chip->code_page_size to be 0 and crash the application.
It happened to me.
--
Best regards,
Andrzej Telszewski
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/openocd/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel