This seems to fix the short term issue…

 

I changed FreeRTOSConfig.h  like this:

//#define configTOTAL_HEAP_SIZE                             ( ( size_t ) 32768 ) //Default

//#define configTOTAL_HEAP_SIZE                   ( ( size_t ) (2*65536 )) /*BF Changed*/

#define configTOTAL_HEAP_SIZE                   ( ( size_t ) (65536 + 20000)) /*N5BRG Changed 240116*/

 

With the code this way we are using 85% of available space.

 

This will be fine for me to continue testing chips.

 

I will get back to test the board.

 

Thanks for help.

 

Bob

 

 

From: Burns Fisher (AMSAT) via pacsat-dev <pacsat-dev@amsat.org>
Sent: Tuesday, January 16, 2024 2:21 PM
To: Bob Stricklin <bstrick@n5brg.com>
Cc: Pacsat Dev <pacsat-dev@amsat.org>
Subject: [pacsat-dev] Re: Memory Problem on PacSatSW

 

Thanks.  I have a few comments (all numbers are hex)

 

* (this is true of Golf too--I never noticed) the psect named STACKS is unused.  That is wasting 1500 bytes of RAM.

 

* The actual stacks are allocated out of the module named os_heap.  That is using 20000 bytes.  See if you have the command "heap free" .  That will tell you how much you can reduce that heap size by (but of course you want to leave some!)  You can change the size in FreeRTOSConfig.h.  Change "configTOTAL_HEAP_SIZE"  Right now it is double what I had it at (it is 128K, was 64K)

 

* I don't see a problem with flash or RAM memory.  It says you have 10c112 bytes unused in flash and 932b unused in RAM.  If we need to find some available memory, we can probably do it, but I don't see a problem here right now.  Your "out of memory" must be a runtime message?  Exactly what does that error look like?  Is it in the file system (i.e. MRAM)?  That is a totally different story.  You might try "get mram size" to see if it matches the amount you think you have.  The MRAM code (if I remember correctly) fixes itself up based on the size and number of MRAM chips, so if one or more are not working it might just quietly compensate.


73,

 

Burns Fisher, WB1FJ

AMSAT(R) Engineering -- Flight Software

 

 

On Tue, Jan 16, 2024 at 2:30 PM Bob Stricklin via pacsat-dev <pacsat-dev@amsat.org> wrote:

Here is the map file you were looking for.

 

Bob

 

From: Burns Fisher (AMSAT) via pacsat-dev <pacsat-dev@amsat.org>
Sent: Tuesday, January 16, 2024 12:04 PM
To: Bob Stricklin <bstrick@n5brg.com>
Cc: Pacsat Dev <pacsat-dev@amsat.org>
Subject: [pacsat-dev] Re: Memory Problem on PacSatSW

 

The MRAMmap that you sent has nothing to do with the linker complaining.  MRAM is totally external and the linker knows nothing about it.

 

I did not know about View/Memory that Jim pointed out.  To me the most useful thing, and what I mean by the Link Map or Memory Map is under the Debug folder (or Release folder depending on which way you are building) and is called programname.map, for example PacSat.map.  It shows how much each module is using in both code (flash memory) and RAM.  Here is a section showing how much code (.text in Unix terms) is being used.

 

SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
.intvecs   0    00000000    00000020    
                  00000000    00000020     sys_intvecs.obj (.intvecs)

.text      0    00000020    00048338    
                  00000020    000046f4     Ax25Task.obj (.text)
                  00004714    00003d54     UplinkTask.obj (.text)
                  00008468    00003b14     PbTask.obj (.text)
                  0000bf7c    000033f0     ConsoleTask.obj (.text)
                  0000f36c    0000314c     pacsat_header.obj (.text)
                  000124b8    00002b7c     sys_selftest.obj (.text)
                  00015034    00002860     os_tasks.obj (.text)
                  00017894    000026b8     inodedata.obj (.text)
                  00019f4c    000020d0     nonvolManagement.obj (.text)
                  0001c01c    00002008     posix.obj (.text)

 

=========================

And here is how much RAM is getting used.

 

.bss       0    08001500    00024752     UNINITIALIZED
                  08001500    00020000     os_heap.obj (.bss:ucHeap)
                  08021500    00000acc     Ax25Task.obj (.bss:data_link_state_machine)
                  08021fcc    00000a00     PbTask.obj (.bss:pb_list)
                  080229cc    0000067c     buffer.obj (.bss:gBufCtx)
                  08023048    00000360     CommandTask.obj (.bss:UplinkCommandBuffer)
                  080233a8    00000320     posix.obj (.bss:gaHandle)
                  080236c8    00000200     UplinkTask.obj (.bss:ftl0_pfh_byte_buffer$2)
                  080238c8    00000200     pacsat_dir.obj (.bss:pfh_byte_buffer)
                  08023ac8    000001d4     UplinkTask.obj (.bss:ftl0_pfh_buffer$1)
                  08023c9c    000001d4     pacsat_dir.obj (.bss:pfh_buffer)
                  08023e70    00000128     (.common:gaRedCoreVol)
                  08023f98    00000120     rtsv7R4_T_be_v3D16_eabi.lib : trgmsg.c.obj (.bss:_CIOBUF_)
                  080240b8    00000118     UplinkTask.obj (.bss:ax25_event)
                  080241d0    00000118     Ax25Task.obj (.bss:ax25_received_event)
                  080242e8    00000118     Ax25Task.obj (.bss:lm_event)
                  08024400    00000118     Ax25Task.obj (.bss:send_event_buffer)
                  08024518    00000118     UplinkTask.obj (.bss:send_event_buffer)
                  08024630    00000118     Ax25Task.obj (.bss:timer_event)

 

 

=========================

 

Notice that you can tell which is in flash and which is in memory by the address (080xxxxx is ram, 0004xxxx is flash).

 

This is totally an output file.  What you changed was the link command file sys_lnk.cmd which is input to the linker.  You essentially "lied" to the linker so it would not complain, I think.  Clever way to find out how much it really wanted!  But if you can send the PacSat.map (or whatever it is called), that will tell exactly who is using the memory.

 

73,

 

Burns Fisher, WB1FJ

AMSAT(R) Engineering -- Flight Software

 

 

On Tue, Jan 16, 2024 at 12:30 PM Bob Stricklin via pacsat-dev <pacsat-dev@amsat.org> wrote:

Jim,

 

Make sure you are looking at:

 

View -> Memory Allocation

 

And not Memory Browser

 

Memory Allocation should open in a TAB in a window within CCS. My TAB is at the bottom of CCS along with a bunch more TABs.

 

Bob

 

 

From: Jim McCullers via pacsat-dev <pacsat-dev@amsat.org>
Sent: Monday, January 15, 2024 6:31 PM
To: 'Pacsat Dev' <pacsat-dev@amsat.org>
Subject: [pacsat-dev] Re: Memory Problem on PacSatSW

 

My version of CSS is either different or how did you turn on the green lines with summary data?

I get a popup status message with similar info but not as stable or detailed as yours.

 

On my system, I’m showing 80% utilization.

The majority is in ucHeap (about 131k).

I’ll bet on a function somewhere allocating a chunk of memory or repeatedly doing so and never using or releasing it.

Should be ‘fun’ to find.

 

Jim McCullers

WA4CWI

 

 

 

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