Re: Problems with erasing flash on nordic devices

2017-05-26 Thread Jacob Rosenthal
Just trying to cargo cult what chris said. whats appropriate? uint32_t? Could be related, but what Im seeing is data after flash_area_read before erase (gdb) p data $1 = {3735928559 , 126616, 46299, 1, 45733, 1, 145408, 112640, 112640, 128076, 103483, 1, 127960, 536872908, 43465, 4294967295,

Re: Problems with erasing flash on nordic devices

2017-05-26 Thread Simon Ratner
At a glance, you are confusing bytes with ints (data is declared as unsigned int), so for the most part you are comparing uninitialised stack memory. Hth, simon On Thu, May 25, 2017 at 11:04 PM, Jacob Rosenthal wrote: > Pushed something like you described, new

Re: Problems with erasing flash on nordic devices

2017-05-26 Thread Jacob Rosenthal
Pushed something like you described, new flash_area_is_empty function in flash_map https://github.com/apache/incubator-mynewt-core/pull/281 Currently doesnt actually work.. either my code sucks or the erase doesnt actually ever succeed on nrf51 is is leaving behind non 0xff bytes.. not sure which

Re: Problems with erasing flash on nordic devices

2017-05-16 Thread Christopher Collins
On Tue, May 16, 2017 at 05:11:36PM -0700, Jacob Rosenthal wrote: > Seems like it could go in flash_map? > > Its also been requested to also have a function that detects if an area > should be erased, based on it having any non 0xff bytes within. > > Should that go there as well. That is the

Re: Problems with erasing flash on nordic devices

2017-05-16 Thread marko kiiskila
> On May 15, 2017, at 3:46 PM, Christopher Collins wrote: > > Hi Jacob, > > On Mon, May 15, 2017 at 02:51:35PM -0700, Jacob Rosenthal wrote: >> So Ill duplicate the upload command to an erase command. >> >> Is there a bit of metadata I could check to see if a slot was filled

Re: Problems with erasing flash on nordic devices

2017-05-15 Thread Christopher Collins
Hi Jacob, On Mon, May 15, 2017 at 02:51:35PM -0700, Jacob Rosenthal wrote: > So Ill duplicate the upload command to an erase command. > > Is there a bit of metadata I could check to see if a slot was filled and > erase was necessary? If so I could conditionally erase in the upload > command

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread Christopher Collins
On Fri, May 05, 2017 at 05:58:52PM -0700, Jacob Rosenthal wrote: > Thats basically what Im saying. Though if you just do #2 I wont need a > separate erase command. It'll erase and disconnect the first time, but not > the second time. Ill get an erase command for free. I don't think that will

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread Jacob Rosenthal
Thats basically what Im saying. Though if you just do #2 I wont need a separate erase command. It'll erase and disconnect the first time, but not the second time. Ill get an erase command for free. On Fri, May 5, 2017 at 5:41 PM, will sanfilippo wrote: > 1) Add a command to

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread will sanfilippo
Jacob: I think we might be talking past each other here. I do understand that the code is auto-erasing on upload. Let’s face it: if you want to upload a new image you are gonna have to erase the one that is there. Sure, there may be a case where it is not there or is already the one you want,

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread Jacob Rosenthal
Im not erasing. It is auto erasing on upload. So I cant upload. On Fri, May 5, 2017 at 5:32 PM, will sanfilippo wrote: > BTW: there is an image list command that will tell you if there is an > image that you need to erase. >

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread will sanfilippo
So I left something out of my proposed work-around. The code would have to be modified such that if the page/sector was already erased the image upload would not blindly erase it. BTW: there is an image list command that will tell you if there is an image that you need to erase. > On May 5,

Re: Problems with erasing flash on nordic devices

2017-05-05 Thread Jacob Rosenthal
Any thoughts on this? Also, Theres a simple solution while a more complex one is discussed. The current code erases every time no matter what, theres even a code comment there about it.