YosysHQ / picorv32

PicoRV32 - A Size-Optimized RISC-V CPU
ISC License
2.86k stars 715 forks source link

Dynamically Setting PROGADDR_RESET #232

Closed Archfx closed 1 year ago

Archfx commented 1 year ago

Hi,

I am involved in implementing a bootloader for the picoRV. Is there a way to dynamically reset the program address to a different section from the application itself at the beginning? I have my memory map as follows,

MEMORY
{
    BOOTROM (rx) : ORIGIN = 0x00100000, LENGTH = 0x004000
    APPROM (rx) : ORIGIN = 0x00104000, LENGTH = 0x3fc000
    RAM (xrw) : ORIGIN = 0x00000000, LENGTH = 0x20000
}

__bootrom_start__ = ORIGIN(BOOTROM);
__bootrom_size__ = LENGTH(BOOTROM);
__approm_start__ = ORIGIN(APPROM);
__approm_size__ = LENGTH(APPROM);

Currently, even though I set the stack pointer to the application and, jump to the application it still searches for that address on the BOOTROM area.

Any suggestion is appreciated.

Thanks in advance

Archfx commented 1 year ago

Never mind, Jump instruction did the trick.