Closed Irvise closed 1 year ago
I narrowed the problem down to this template:
@@MACRO(CREATE_RAM_SECTIONS)@@
@_BOOT_MEM_@
@@END_MACRO@@
@@IF@@ @_SIZE:RAM_REGION_@ > 0
@@TABLE@@
@_CREATE_RAM_SECTIONS()_@ @_RAM_REGION_@
@@END_TABLE@@
@@END_IF@@
which produces:
ROM CSR
SRAM
Instead of:
ROM CSR
ROM SRAM
@_BOOT_MEM_@
in empty in the second macro expansion.
I don't know if it's a bug in startup-gen or template-parser.
In the meantime @Irvise you can just change the line 195 from
} > SRAM AT>
to
} > SRAM AT> ROM
@Irvise This should fix the problem -> https://github.com/AdaCore/startup-gen/pull/37
Thank you for fixing it!
I have a RISC-V softcore that has the following memory map
It has one ROM and three RAM regions (SRAM, CSR, MAIN_RAM).
The following GPR project contains such definitions
However, I had to take SRAM out as can be seen. If I try to compile the project with all the regions defined I get the following error:
The thing is, this works if I leave SRAM and take out CSR. The position of the definitions does not seem to matter.
This leads me to believe that startup-gen can only deal with a maximum of 2 RAM regions. Could you look into this?
I am open to testing and feedback. Thank you for your time, Fer
EDIT: I took a look at the linker script. I did not see anything different between the different generated regions, which is strange... However, I am no linker-script expert.