I believe the 128K excludes variables and non-code resources such as images in the FW. However, I am not the expert here. Perhaps John can shed some light on this.
- Xander
NXC command FreeMemory()
Re: NXC command FreeMemory()
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC command FreeMemory()
Ok, well I am just curious, I don't need to know specifically. I think your explanation makes sense.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC command FreeMemory()
The enhanced NBC/NXC firmware uses more flash memory than the standard NXT firmware does. This is because of all the additional opcodes and system calls that I have added. It uses 151,316 bytes of flash memory. 256k = 262144 bytes. Flash memory for user files is allocated in 256 byte chunks so every file will actually use a multiple of 256 bytes. 262144 - 151316 = 110828. If you delete all the files from the NXT and ask how much free memory there is using BricxCC's Diagnostic tool you should see a number similar to this.mattallen37 wrote:So, why does it return numbers no more than 106.644 kB? Does the firmware REALLY take up over half the flash? The AT91SAM7S256 has 256 kB of flash, so if I am only seeing less than half that, what is using up all the rest? I know that I have the program to read that number on it, but that only exists of the following.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC command FreeMemory()
Well, that makes a lot of sense. Thanks for explaining that.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC command FreeMemory()
Ok, I must have missed that. Anyhow, would "GetCommModuleBytes(CommOffsetBrickDataBdAddr, 7,BID);" do exactly the same thing (with no void)? It seems to work, but I don't know if it is the same.
The help box(es) looks like the second picture "Win32 help".
The help box(es) looks like the second picture "Win32 help".
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC command FreeMemory()
I've been told that if it looks like a duck and quacks like a duck then it's a duck. The inline wrapper function could be replaced by directly calling GetCommModuleBytes. That's how the NXCDefs.h header file defines GetBrickDataAddress.
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Who is online
Users browsing this forum: Semrush [Bot] and 0 guests