微處理器 - STMicroelectronics STM32F103 - 解決Cannot insert breakpoint 1. Cannot access memory at address問題



修改前

SECTIONS {
    . = 0x0;
    .text : {
        *(.text)
    }

    .data : {
        *(.data)
        *(.rom)
    }
    . = 0x20000000;
    .ram : { *(.ram) }

    .bss : {
        *(.bss)
        *(.ram)
    }
}

修改後

MEMORY {
    RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
    FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
}

SECTIONS {
    .text : {
        *(.text)
    } > FLASH
  
    .bss : {
        *(.bss)
    } > RAM

    .data : {
        *(.data)
    } > RAM
}