Skip to main content
Avonac
Associate II
April 1, 2019
Solved

STM32F103RB - Linker error when code cize exceed 64k

  • April 1, 2019
  • 6 replies
  • 2378 views

Hey,

According to the datasheet, the stm32f103RB has 128K of Flash memory. If my code exceed 64k I am getting a linker error “L6406E: No space in execution regions with .ANY selector matching …�?

Did I have overlooked something ?

I'm working wth the Keil IDE.

IDE-Version: µVision V5.10.0.2

Best regards

Goran

This topic has been closed for replies.
Best answer by Avonac

Finally, I've figured it out.

I'ts an RAM not an ROM issue.

It was hard to see this, because I didn’t

get any Information about the required memory until the Project has been compiled

successfully.

Anyway, thank you guys for the support.

6 replies

Pavel A.
Super User
April 1, 2019

Do you use the "Lite" Keil version? Unfortunately, it is size limited.

-- pa

Avonac
AvonacAuthor
Associate II
April 1, 2019

No, I have a full licensed Version of Keil. The size limitation of the lite version is 32KB.

Tesla DeLorean
Guru
April 1, 2019

>>Did I have overlooked something ?

Perhaps look specifically at what is set for the ROM size on the Target tab in the options for the project, or if some alternate settings are in a scatter file (linker script).

The initialized statics will also consume flash resources, as the start up code copies these to RAM.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Avonac
AvonacAuthor
Associate II
April 1, 2019

The Data (ROM/RAM size) in the Target tab corresponds to the values in the scatter file. I didn't do any changes.

Tesla DeLorean
Guru
April 1, 2019

>> I didn't do any changes.

Ok, but if says 64KB it is not going to accommodate sizes beyond that.

Going to be really hard to diagnose with the level of detail you're providing.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Avonac
AvonacAuthor
Associate II
April 2, 2019

Hey Clive,

First thanks for trying to help me out.

What Details would be helpfull to get a better picture of the issue?

Tesla DeLorean
Guru
April 2, 2019

Generally complete error messages and logs. Compiler/linker output. Screen shots of settings, failure, etc.

Ideally a compilable project, but obviously sensitivities there.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Avonac
AvonacAuthorAnswer
Associate II
April 2, 2019

Finally, I've figured it out.

I'ts an RAM not an ROM issue.

It was hard to see this, because I didn’t

get any Information about the required memory until the Project has been compiled

successfully.

Anyway, thank you guys for the support.

Tesla DeLorean
Guru
April 2, 2019

Yes, well there is definitely less of that available.

Review the .MAP file to see where the resources are going. If you have tables of constants, try to keep them in FLASH. If values will fit in 8 or 16-bit rather than 32-bit use more compact data structures.

If you need to get closure with the linker, you can increase the memory sizes until it completes, and then review the output, including .MAP file. Now obviously the code won't work in the actual device, but you can make determinations about what pin compatible device you'd need to move too.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..