This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to link executable to discontinuous flash area

I am using uVision4.74 with STM32F407, I want to link my program to two sections, one section is 0x8000000 length 0x4000, and the other section is 0x8008000 length 0x38000. I did the setup in the options form Taget 'whatsoever', but the linked file used 0x8000000~0x80006AC and 0x8008000~0x08017C00

Is it a bug in the linker? It wasted so many space in section 1.

Parents
  • No the linker's pretty stupid, and does a lazy allocation. For optimum usage the linker would have to do multiple passes to get a "best fit", and that's complicated and time consuming.

    You'd really need to manager the scatter file, and balance what is placed in each section. You could presumably do this with a script if it really bugs you. Or you're forced to think about when you run out of space.

    I've used other linkers where you can prioritize the function ordering of the working set, so it can deal with cache line proximity, and faster memories (internal vs external flash for example), this again typically uses scripts and trace/performance data.

Reply
  • No the linker's pretty stupid, and does a lazy allocation. For optimum usage the linker would have to do multiple passes to get a "best fit", and that's complicated and time consuming.

    You'd really need to manager the scatter file, and balance what is placed in each section. You could presumably do this with a script if it really bugs you. Or you're forced to think about when you run out of space.

    I've used other linkers where you can prioritize the function ordering of the working set, so it can deal with cache line proximity, and faster memories (internal vs external flash for example), this again typically uses scripts and trace/performance data.

Children