PR:
https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/638
Am 01.04.24 um 22:33 schrieb Michael Ring via fpc-devel:
I am using heapmgr but with trunk compiler the value of __heapsize is
plain wrong (and way too big)
When I compile my code with my old compiler for pico all is fine, when
I debug into heapmgr I see that __heapsize is set correctly to 16384
based on this setting:
program spi_st7789;
{$MODE OBJFPC}
{$H+}
{$MEMORY 16384,16384}
When I use current main compiler the value is 308528 which is more
than available memory, this is why I found the issue....
The reason for this is that a line from my original code for
linkerfile generation was not included:
Add(' *(.data .data.*)');
// Special Section for the Raspberry Pico, needed for linking to spi
* Add(' *(.time_critical*)');
* Add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
Add(' _edata = .;');
and for that reason the content of that section in loaded to start of
flash (and during startup to ram) instead of the correct data for
__heapsize
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel