Just a reminder, Chris, that if you are using the OS heap (as gets used for stacks) reducing what you request will not reduce the memory that the linker sees being used.  You have to also reduce the heap size.

73,

Burns Fisher, WB1FJ
AMSAT(R) Engineering -- Flight Software


On Tue, Jan 16, 2024 at 11:38 AM Chris Thompson via pacsat-dev <pacsat-dev@amsat.org> wrote:
I expect the code could be drastically optimized to reduce memory usage.  It's fairly complex and I opted for simple static memory allocation.  But there is plenty of duplication.  Each task makes a copy of the received packet in an RTOS queue and likely in a temp buffer as well.  In theory we could collapse all of that into one shared queue/buffer.

In the short term you can reduce the heap size as Burns said.  You could also remove some of the tasks temporarily as they each have a stack.  The stack sizes can also probably be trimmed back in some cases as no optimization has been done.

Most of the Globals are in MRAM but get mirrored in RAM.  We could stop doing that but I doubt it is a lot of space.

Finally we keep an index of the directory in the heap which does increase its size.  We could remove that and only iterate over MRAM but that requires some redesign as it needs to be sorted by upload time.

73
Chris the 


On Mon, Jan 15, 2024, 16:01 Bob Stricklin via pacsat-dev <pacsat-dev@amsat.org> wrote:

Looks like we have an issue with memory usage in RAM.

 

If you load up CCS with the current project PacSatSW and build it then you can select VIEW -> Memory Allocation  and look at the tab. You will see the package needs 154K or RAM and the Launpad has 191K.  In the case of the TMS570LS0914 we have 128K max.

You can expand RAM and the subfolders and see where the memory is being used.

 

I worked for the last few days getting a HalCoGen setup for the LS0914 and then murging this HCG file with the code of the Launcpad project. After working through some issues it built but when it ran the linker it errored out with not enough memory. So faked it out and told the linker I had more memory. Then it would build and generate a .out file and the Memory Allocation info. It matches the launch pad build.

 

Probably need to look for ways to reduce RAM needed. Reduce buffer sizes, move buffers to external memory, or take out code.

 

I will be looking for things here to try and complete a basic build of the code for the LS0914. Please look for ideas and post any that you come up with. We probably should target RAM usage at about 80% of the max or about 100KB.  We could change processors later but that would need some study.

 

Bob

 


-----------------------------------------------------------

pacsat-dev mailing list -- pacsat-dev@amsat.org
View archives of this mailing list at https://mailman.amsat.org/hyperkitty/list/pacsat-dev@amsat.org
To unsubscribe send an email to pacsat-dev-leave@amsat.org
Manage all of your AMSAT-NA mailing list preferences at https://mailman.amsat.org

-----------------------------------------------------------

pacsat-dev mailing list -- pacsat-dev@amsat.org
View archives of this mailing list at https://mailman.amsat.org/hyperkitty/list/pacsat-dev@amsat.org
To unsubscribe send an email to pacsat-dev-leave@amsat.org
Manage all of your AMSAT-NA mailing list preferences at https://mailman.amsat.org