Hi,

when porting the SM1000 code to the UHSDR firmware for the mcHF QRP
receiver (STM32F407V CPU), I ran into problems (read crashes) due to the
large amount of memory the fdmv_create() mallocs (AFAIR, in the area of
40kb now) in comparison to the available memory. With the typical linker
script, you only have 128k RAM available.

Although advertised as 192k RAM the STM3240x MCUs only have 128 k
"normal" RAM typically used in the linker scripts. There is additionally
64 kByte CCM RAM on a different address space with restricted usability
(no DMA for instance). Unless you make extra provision both in code and
in the linker script, these are not used by the GCC linker. So a little
more memory used may bring the system out of balance easily.

Danilo





On 04.01.2018 09:16, David Rowe wrote:
> Very Very common problem to get the "ring of death" due to running out
> of memory somewhere.  At that point I start commenting things out.
>
> - David
>
> On 04/01/18 16:53, Steve wrote:
>> Bruce, I thought about valgrind, I use it on local code. I'm not aware
>> of anything that would work for the stlink remote device. It would be
>> neat to have an sm1000 simulator :-) I've decided to just bite the
>> bullet and go through the code with a look at memory management. I
>> don't think I'm out of memory, or a heap/stack crash, as it's too
>> early in the code. I may run into memory problems, as I'm hoping to
>> fit FDM, 4FSK, Analog, and Tone into the selection. If push comes to
>> shove, I'll toss the FDM, as that mode is already available.
>>
>> On Wed, Jan 3, 2018 at 4:10 PM, Bruce Perens <br...@perens.com> wrote:
>>> Use Valgrind or Electric Fence to find your memory overrun. It's not
>>> where
>>> that malloc is, but it is overwriting the malloc memory, thus GDB
>>> blows up
>>> in malloc().
>>>
>>> On Wed, Jan 3, 2018 at 1:52 PM, Steve <coupaydevi...@gmail.com> wrote:
>>>>
>>>> If anyone clicked the link, it took you to a movie that showed my
>>>> Discovery board with the ring of death. Just some new years humour...
>>>>
>>>> Mysteriously, when I step through the code with GDB it blows up on a
>>>> malloc() in fdmdv_create().
>>>>
>>>> This is strange, as the exact same code exists on the standard sm1000
>>>> code, and after stepping through the malloc() it does fine.
>>>>
>>>> Obviously, my code must not be (really) the same, and I gimped the
>>>> initialization somewhere.
>>>>
>>>> Happy New Year
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Freetel-codec2 mailing list
>>>> Freetel-codec2@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Freetel-codec2 mailing list
>>> Freetel-codec2@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>>>
>>
>> ------------------------------------------------------------------------------
>>
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Freetel-codec2 mailing list
>> Freetel-codec2@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>>
>
> ------------------------------------------------------------------------------
>
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Freetel-codec2 mailing list
> Freetel-codec2@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freetel-codec2


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freetel-codec2 mailing list
Freetel-codec2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to