apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.89k stars 1.18k forks source link

May i ask the meaning of CONFIG_RAM_START and CONFIG_RAM_SIZE while building rv-virt:knsh64 ? #8812

Open GooTal opened 1 year ago

GooTal commented 1 year ago

Hi, i built rv-virt:knsh64 and notice that CONFIG_RAM_START and CONFIG_RAM_SIZE are defined here:

https://github.com/apache/nuttx/blob/776e2d774faac35c4583b6186e6c3e659fa4551f/boards/risc-v/qemu-rv/rv-virt/configs/knsh64/defconfig#L79-L80

May i ask why setting CONFIG_RAM_START=0x8010_0000 and setting CONFIG_RAM_SIZE=1048576 ? It seems that CONFIG_RAM_END = CONFIG_RAM_START + CONFIG_RAM_SIZE = 0x8020_0000 I`m confused and don`t know what effect these vars caused.

Besides, i also read the code in ld-kernel.script:

MEMORY
{
    kflash (rx) : ORIGIN = 0x80000000, LENGTH = 2048K   /* w/ cache */
    ksram (rwx) : ORIGIN = 0x80200000, LENGTH = 2048K   /* w/ cache */
    pgram (rwx) : ORIGIN = 0x80400000, LENGTH = 4096K   /* w/ cache */
}

And i got the value of g_idle_topstack = 0x80206c00 and KRAM = KSRAM_END = __ksram_end = 0x8040_0000 using gdb in function up_allocate_heap. So ... CONFIG_RAM_START & CONFIG_RAM_SIZE do not cause any effect here..

acassis commented 1 year ago

@masayuki2009 since you created this file, could you please help us?