cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103RB - Linker error when code cize exceed 64k

Avonac
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Avonac
Associate II

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.

View solution in original post

9 REPLIES 9
Pavel A.
Evangelist III

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

-- pa

Avonac
Associate II

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

>>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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Avonac
Associate II

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

>> 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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Avonac
Associate II

Hey Clive,

First thanks for trying to help me out.

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

Avonac
Associate II

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.

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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 Venmo
Up vote any posts that you find helpful, it shows what's working..