Compile-time Linker Error

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

darrowj08
Posts: 6
Joined: Thu Nov 17, 2011 6:00 am

Compile-time Linker Error

Post by darrowj08 »

So, To explain, I am a computer science student, I have had very little actual experience with uC programming and etc.
But here's the situation I am in.
IDE: Keil uVision
ChibiOS version 2.2.7
Target: STM32 Value Line: Discovery
Using ST-Link and SWD
Problem: On build, I get this output

Code: Select all

 compiling etc etc
compiling main.c...
linking...
.\obj\ch.axf: Error: L6218E: Undefined symbol Image$$RW_IRAM2$$Base (referred from chmemcore.o).
Target not created


On attempted flash download (I cleared the flash memory first) I got an error about ch.axf not found.
And... I have no idea what to do.
I would really appreciate your help!
Thank you.
John Darrow
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile-time Linker Error

Post by Giovanni »

Hi John,

That error is related to a missing symbol, that symbol should be defined in the project options, there are several possible causes:
1) You are using an older uVision version (what version are you using ?).
2) Somehow you modified the project options and some settings changed (try to restore the demo from the distribution zip).
3) The project contains an error in 2.2.7 (I will verify this in the evening), you may try to confirm this by compiling some other Keil project in the meanwhile.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile-time Linker Error

Post by Giovanni »

Hi,

It worked here, please verify the above points.

Giovanni
darrowj08
Posts: 6
Joined: Thu Nov 17, 2011 6:00 am

Re: Compile-time Linker Error

Post by darrowj08 »

If it matters, I"m doing all this on a machine running Windows 7 Ult.
I have access to a mac running 10.6 as well as a second image on my pc with ubuntu on it.
IDE-Version:
µVision V4.22.22.0
Copyright (C) 2011 ARM Ltd and ARM Germany GmbH. All rights reserved.

Tool Version Numbers:
Toolchain: MDK-Lite Version: 4.22a
Toolchain Path: BIN40\
C Compiler: Armcc.Exe V4.1.0.791 [Evaluation]
Assembler: Armasm.Exe V4.1.0.791 [Evaluation]
Linker/Locator: ArmLink.Exe V4.1.0.791 [Evaluation]
Librarian: ArmAr.Exe V4.1.0.791 [Evaluation]
Hex Converter: FromElf.Exe V4.1.0.791 [Evaluation]
CPU DLL: SARMCM3.DLL V4.22a
Dialog DLL: DCM.DLL V1.3.0.0
Target DLL: STLink\ST-LINKIII-KEIL.dll V1.5.8
Dialog DLL: TCM.DLL V1.03

Above is the information from the About uVision... button

Also, this loaded as Preprocessor symbols>Define
__heap_base__=Image$$RW_IRAM1$$ZI$$Limit __heap_end__=Image$$RW_IRAM2$$Base

As far as 2:

I set the Debug program to use the ST-link debugger, and the subsequent setting to SWD
I redownloaded, and here's what happened when I tried to build.

Code: Select all

compiling testthd.c...
compiling main.c...
linking...
.\obj\ch.axf: Error: L6218E: Undefined symbol Image$$RW_IRAM2$$Base (referred from chmemcore.o).
Target not created

Again...
So, unless I'm missing something major here, it's not working.
Also, if it's relevant, when I just click Download, it tells me that ch.axf is not found.
Now I'm going to try compiling some random other thing with Keil to see if it works.
But please let me know if anything comes up based on the info I have above.
Thank you, by the way, for your quick response.
darrowj08
Posts: 6
Joined: Thu Nov 17, 2011 6:00 am

Re: Compile-time Linker Error

Post by darrowj08 »

I followed this set of instructions and I got a similar .axf undefined symbol error. I suspect there is either something wrong with my keil, or this sort of thing just doesn't work with the free version of Keil IDE.
I also noticed that my Dialog DLL was different from the one used in the tutorial I linked.
My Dialog DLL is TCM.DLL if that means anything.The Driver DLL is SARMCM3.DLL.

Please let me know if this provides any hints as to what I must do to make things work.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile-time Linker Error

Post by Giovanni »

Hi,

I use the free uVision 4.22.22, it should be your same version. That symbol is defined by defining a RAM area into the project options here:

keil_options.png
keil_options.png (13.92 KiB) Viewed 10489 times


Do you see the circled options?

Giovanni
darrowj08
Posts: 6
Joined: Thu Nov 17, 2011 6:00 am

Re: Compile-time Linker Error

Post by darrowj08 »

Okay, so, that appears to have worked, but... Well... I don't really know what to do next.
Keil when I click download says "Load (path)/ch.axf"
And it doesn't seem like it's programming the uC.
Or something like that. And... I have no idea what to do.
So basically, can you point me in the right direction?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile-time Linker Error

Post by Giovanni »

You have to configure the debug settings to use ST-Link as probe. Go in the options->debug then select ST-Link and click on "Settings", then select SWD.

Now it should upload the code on the board.

keil_stlink.png
keil_stlink.png (12.11 KiB) Viewed 10480 times


Giovanni
darrowj08
Posts: 6
Joined: Thu Nov 17, 2011 6:00 am

Re: Compile-time Linker Error

Post by darrowj08 »

Sooo... I had already been doing that. And I discovered today that it would seem that my System viewer path or whatever it is would seem to be different from the one you seem to have running in your depicted example.

Also, I'm sorry to be so much trouble.

I also noticed that my copy of Keil uVision does not seem to have terribly persistent preferences. Hmmm.

So I'm doing two things. I'm going to reinstall the Keil Arm IDE, and I'm going to install the ST-Toolset from STM. Because, well, either I'm not understanding some miniscule distinction, or something is very wrong with the way uVision is managing it's memory, and probably won't work unless it's fixed.
If you have any hints or magical advice that I can use, I am all ears.
I am not so much dependent on using Keil's IDE. What I am dependent on is getting to where I can program a rudimentary algorithm set into this darn microcontroller.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile-time Linker Error

Post by Giovanni »

I don't like uVision much, IAR is a bit easier to use, Anyway I prefer my custom Eclipse environment (harder to do but I love freedom).

Giovanni
Post Reply