On Mon, 25 Jul 2022 at 18:02, Liviu Ionescu <i...@livius.net> wrote: > > On 25 Jul 2022, at 19:02, Peter Maydell <peter.mayd...@linaro.org> wrote: > > The one where SYS_HEAPINFO produces the bogus result putting the > > heap at 0x04000000, that you mentioned in the original report with > > the command line > > > > .../qemu-system-arm "--machine" "virt" "--cpu" "cortex-a15" > > "--nographic" "-d" "unimp,guest_errors" "--semihosting-config" > > "enable=on,target=native,arg=sample-test,arg=one,arg=two" -s -S > > ah, the bogus one... that's a bit more complicated, since it happened in the > early tests, and I don't remember how I did it, it might be that I tried to > load my code in flash and my data in ram, but I'm not sure. > > try to check the logic and avoid the cases when flash addresses are returned > for heap, if possible.
Yeah, that's my plan. I think it'll be a one-line fix. But it'll be much easier to be sure it works if I have a test case that triggers the problem. I'll try a setup with code in flash and data in RAM, that sounds like it might be a way to cause the problem if there's not much code and a lot of data (because then the remaining space in the flash is larger than the remaining space in the RAM.) > btw, this might be a different topic, but on Cortex-M devices > I'm used to configure the linker scripts to allocate the text > in flash and the data+bss in ram; for qemu aarch32/64 devices > I could not make this work, and I had to allocate everything > in ram, which is functional, but probably not very accurate > for some tests, that might fail when running from flash. I'm not a linker/toolchain expert, I'm afraid. Certainly in theory it should be possible to have a split text/data setup on A-profile devices, the same as M-profile ones. thanks -- PMM