Keil Linker question for STM32F4 discovery board

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

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
eribla
Posts: 20
Joined: Fri Nov 29, 2013 1:10 am

Keil Linker question for STM32F4 discovery board

Post by eribla »

Hi all

New to the forum, new to ChibiOS.

First off I am still at the "My first blinking LED level" so please be kind.
(I noticed there are some rough guys on the Keil forum.)
I have done a lot of high level C# programming, though, and wanted to go down to the functional LED level.

I thought using the ChbiOS would be a good way to start with some good init code and functions that are already available.

I looked through both of the ChibiOS and Keil forums and did not find an answer to my problem.
Here it is:

I followed the
"How-To: Cortex-M4 (STM32F4xx) + ChibiOS/RT + Keil uVision" instructions by Dmitri Gorokh
(thank you very much) and after fixing a few missing files I am down to one error message that I don't get:

".\Template.axf: Error: L6218E: Undefined symbol Image$$RW_IRAM2$$Base (referred from chmemcore.o)."

I realize that is has to do with the second part Linker pre-processor line:

__heap_base__=Image$$RW_IRAM1$$ZI$$Limit __heap_end__=Image$$RW_IRAM2$$Base

Two funny things I noticed, but can't explain:

First I thought there might be a typo with the Ram and I changed the second part to "IRAM1", that does compile and LINK, but what does it do?

Second: The ChibiOS examples have the statement above (with IRAM2) and work.... so it's not a typo.

Not sure what I am missing.

Thanks a lot for your help!!!!!


While I am at it: I am planning to use the STM32F4 discovery board.
I am also unsure if I need to buy an ST-LINK/V2, since some of the specs say "built in STLINK"...
Then I find other articles that say that this is only to program other chips, so the Discovery board
becomes the ST Link for those.
Last not least I cannot find one article that clearly shows how to connect the STM32F4 discovery board to the ST-Link/V2.
Odd..
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Keil Linker question for STM32F4 discovery board

Post by Giovanni »

Hi,

IRAM2 is a special memory section defined in the linker options, look into an existing project and you will find it. It is used as end-of-RAM marker.

The STM32F4-Discovery includes an ST-Link2 so you don't need to buy it.

Giovanni
eribla
Posts: 20
Joined: Fri Nov 29, 2013 1:10 am

Re: Keil Linker question for STM32F4 discovery board

Post by eribla »

Thank you Giovanni for the tip with the ST-LINK.

I see how the endo-of-Ram marker is used in the demos and that it works there.

But why does my project return the error then (I copied the line, so there is no typo)?
Unfortunately I can't find the file that contains the definition.

".\Template.axf: Error: L6218E: Undefined symbol Image$$RW_IRAM2$$Base (referred from chmemcore.o)."

When I search the current (demo) project for "RW_IRAM2" there is no match.

Thanks

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

Re: Keil Linker question for STM32F4 discovery board

Post by Giovanni »

You need this:

iram2.jpg
iram2.jpg (62.16 KiB) Viewed 4966 times


Giovanni
eribla
Posts: 20
Joined: Fri Nov 29, 2013 1:10 am

Re: Keil Linker question for STM32F4 discovery board

Post by eribla »

Hi Giovanni

I really appreciate your help, but that is not it.

I found several curious facts:

YES, the Demos are all using STM32F4xx.sfr and they link fine.

But: this file does not even exist on my computer (but rather STM32F40x.sfr) -> Looks it's not needed at this step.

I change the file name nevertheless to STM32F4xx.sfr, but still get the same error.

(Other projects use STM32F40x.sfr, too).

Well, I guess I just have to gut a demo project and then add my code.... Thought there was an easy answer.

Thanks again Giovanni, looking forward to use ChibiOS
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Keil Linker question for STM32F4 discovery board

Post by Giovanni »

Hi, it is possible that file name changed in latest Keil versions.

Giovanni
Post Reply