Flash Usage dropped considerably, Can't explain Why?

Discussion to talk about software related topics only.
Post Reply
User avatar
terry_opie
Posts: 27
Joined: Tue Jul 30, 2013 8:33 am

Flash Usage dropped considerably, Can't explain Why?

Post by terry_opie »

Yesterday I put my entire project in a git repository... I changed nothing else. This morning I tried building and I see that I'm only using 17.21% of the flash. Yesterday prior to moving things into git, I was using ~39.8%

Code: Select all

******************************Build summary ******************************
Used 355349 bytes of 2064384 available flash (17.21%)
Used 1371168 bytes of 8388608 available ram (16.35%)
NNDK release tag version:2.6.2
Build complete for project Reflex
Time consumed: 7923  ms.  
And now, when I try to program a device (CB34EX), I get an "Error checksum fail" \ "No Valid app" error... I've tried programming via Ethernet as well as via MTTY, but no dice.

Any ideas?? I'm at a loss as to what happened, or how to proceed. I don't particularly want to start from scratch.
User avatar
terry_opie
Posts: 27
Joined: Tue Jul 30, 2013 8:33 am

Re: Flash Usage dropped considerably, Can't explain Why?

Post by terry_opie »

I'm also finding now that I can't even program in any other built applications... I tried the tic tac toe and webserver test applications. Via MTTY the file is sent, but when it reboots, I see:

Code: Select all

Waiting 2sec to Start 'A' to abort

Error checksum fail

No Valid app


Netburner CB34-EX Monitor V1.09 Feb 28 2011 08:16:16

HELP for help

nb>
User avatar
terry_opie
Posts: 27
Joined: Tue Jul 30, 2013 8:33 am

Re: Flash Usage dropped considerably, Can't explain Why?

Post by terry_opie »

I think I have this figured out...

I finally after about 10 tries got one of the factory examples loaded on the board via MTTY. I did this with a variety of combinations of stopping the boot, resetting the board, and loading via FLA. Once I did that, my normal application loaded fine.

I'm guessing something that I did when adding everything to git, caused a large size difference with all of the files/image, etc. Is there something from within Eclipse or the Netburner images that doesn't update a checksum if the same project programmed multiple times?

Also, is there some sort of cache built up within Eclipse? I can't explain a ~22% decrease in flash usage from one day to the next. I'm not complaining, I like that I now have an extra 22% to play with, but if I'm doing something that is needlessly filling up flash, I'd like to know what it is.
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Flash Usage dropped considerably, Can't explain Why?

Post by tod »

First the recommended approach when you have a boot problem is to power down, power up and boot into the monitor at the earliest possible time. That is don't let your app trap, or let the checksum error appear. Hit that SHIFT-A on the initial cold boot. That's probably what you eventually did but I just wanted to point this out explicitly in case you have the problem in the future.

Regarding your git strangeness. Did you just create a new repo on your existing project or did you create a repo and then clone it and start a new project. If the latter then I can easily see how you might not have committed some no longer used files (maybe from the HTML directory?) and your flash usage dropped as a result. If you just created the repo on an existing project,all you are doing is creating an ignore file (optional) and a hidden directory (probably named .git) at the root of your project with all your commits. I don't see how under this scenario git could affect your flash usage.

Eclipse does have caches. The local history it maintains is a good example. The index it builds is another. If your local history expired this might cause you to save room on your hard drive but wouldn't affect the Flash usage. Everything I can think of that Eclipse caches is kept in the workspace's .metadata folder not in any of your project folders and certainly not in anything that the NB toolchain is going to use to create your image.

There is no problem with reprogramming the same project multiple times (until you exceed the number of times flash can be reprogrammed).

I can think of many things that might change your flash usage but none of them happen automatically. Loading a release build instead of a debug build would be one. Changing the optimization level would be another. Your drop seems rather dramatic for either of these to be the case.
User avatar
terry_opie
Posts: 27
Joined: Tue Jul 30, 2013 8:33 am

Re: Flash Usage dropped considerably, Can't explain Why?

Post by terry_opie »

I had done the Shift-A thing several times, tried loading multiple applications via MTTY, but only after several tries did it finally take. Once it took, then I was able to program and run any valid application. I'm not sure what finally made it go.

I created a remote git repository, init'd my local project directory as a git repo, then added the remote repository (git remote add origin <repo>) to the local, which created the .git dir. I then created a .gitignore file. I added/committed it all and pushed it to the remote. That was the end of my day, and when I came back the next morning and tried to build the flash usage was way off from "normal", but was compiling/building just fine.

Now that the board is taking a program, my application, even with the reduced flash usage, seems to be loading fine. I'm guessing maybe that during the git commit, I may have left something out that was normally being built into the application, but not actually used. But I don't remember deleting anything.

The only reason that I asked about caches was because, besides adding to git, and the huge difference in flash usage, nothing in the actual logic of the code changed. Thus, once I tried to program the lower flash usage application, I got stuck with what seemed to be a bricked board.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: Flash Usage dropped considerably, Can't explain Why?

Post by pbreed »

Do you have an html subdirectory?

Did it collect a bunch of random stuff that did not get put in the git directory?

This is the most likely cause of a reduction in size....

ANYTHING in the html directory is included in the app, so if you use html tools that leave stuff,
in that directory it will eat up your flash....
User avatar
terry_opie
Posts: 27
Joined: Tue Jul 30, 2013 8:33 am

Re: Flash Usage dropped considerably, Can't explain Why?

Post by terry_opie »

Yes, I have an html directory. And I code it all by hand (well, vim). :D So, nothing left over by any other software. And I do still have images that I'm not using that I could remove, but I don't remember deleting anything when setting up git.

I'm happy that I gained 20+% in flash space, just not sure how I did it...
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: Flash Usage dropped considerably, Can't explain Why?

Post by pbreed »

Possible backup files in the directory?
Post Reply