Getting started in KEIL

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

meatball
Posts: 32
Joined: Thu May 19, 2016 4:39 pm
Has thanked: 9 times
Been thanked: 2 times

Getting started in KEIL

Postby meatball » Thu May 19, 2016 8:36 pm

Hey all,

I'm new to chibiOS. I've been looking for a way to escape the bare-metal super loop on the STM32 for awhile now, and I've long since decided to land on chibiOS. It's a really great looking project, and I look forward to learning from all the talented developers here.

I've been looking to setup with KEIL or Embitz- since I can't stand Eclipse for debugging. No problem, right?

I thought I would start with Embitz, since it's free and GCC based. But, the primary developer had given up on adding support for any new STM32 hardware. I think he assumes that all new chips are "locked" into ST's HAL.

This has resulted in failed integration of the F446, which does in-fact have SPL support. So Embitz is out, since it doesn't build for my target.

Keil is pretty great for debugging though, so in setting up for the first time, I noticed that the integration guides are simply out of date.

Maybe this is not such a huge deal on it's own, but it's causing my integration in Keil fail all the time. Here's what I mean.

https://www.youtube.com/watch?v=12TcH09OHmc

This youtube video some guy posted not only looks bad, but it seems like his chibiOS examples in his demo folder include Keil projects already built. But all I have are generic .project files in my 16.1.4 version. I don't even know what program works with such a generic .project filetype.

Fine, so I'll go straight to the integration guide.

http://wiki.chibios.org/dokuwiki/doku.p ... tion_guide

What can I say, it's no longer relevant to the way the project is setup now. ChibiOS is now under a different directory structure with different names and file paths. Now I keep adding tons of files without really knowing those are the actual headers that the guide is trying to describe to me.

So then, how about the guide on the wiki made for KEIL users?
http://wiki.chibios.org/dokuwiki/doku.p ... _rt_how-to

Looks great (at first). But there is no mention of WHY we edit the IRAM2 text field. (Because that's just what you do apparently). Also, the guide tells me to enter in a giant string into the C/C++ custom definitions field:

__heap_base__=Image$$RW_IRAM1$$ZI$$Limit__heap_end__=Image$$RW_IRAM2$$Base

What is this anyway? Again, there is no mention describing WHY we have to do this. But, it doesn't matter. My KEIL installation, (which is NOT 4 years old) claims this string to contain a syntax error. And how could I not agree with it? Who wants to enter in such a cryptic set of $$ signs and underscores just to get a basic build going?

Well, there is only one build option left then. I'll have to use an example build I found somewhere in the middle of github.

https://github.com/GunterO/Keil_ChibiOS_Template

So why does this project present me with 143 build errors? Don't know. I think that's just what you get for trying to use a project someone else built.

Is there anyway to update the integration guide that reflects the current directory structure of chibiOS 16.1.4?

Or does someone know of a KEIL + ChibiOS tutorial that doesn't rely on 4 year-old IDEs and older versions of the RTOS?

If you have a more general comment or suggestion for me at this point, I'm all ears - seriously. I've been trying to get the basic single-thread example up and running on a basic nucleo board for 3 weeks now, with no success.

What should I try next? Thanks guys!

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Getting started in KEIL

Postby Giovanni » Thu May 19, 2016 10:17 pm

Hi,

Have you tried the integration guides?

http://www.chibios.org/dokuwiki/doku.ph ... tion_guide
http://www.chibios.org/dokuwiki/doku.ph ... tion_guide

Note that there is a Keil project for the F303 in the distribution, you may use that one as base and just replace the F3-specific bits. Make sure to take configuration files from an F4 project.

About this:

Code: Select all

__heap_base__=Image$$RW_IRAM1$$ZI$$Limit__heap_end__=Image$$RW_IRAM2$$Base


It is done to mark all the unused RAM for heap allocator use, if you set a finite size for the heap in chconf.h it is not required. Note that recently Keil changed the syntax, where you read $ you must replace with $$, the provided F3 project is already updated.

We don't provide many Keil project because the XML project file is a PITA to maintain, you need to update all projects for every small change, our makefiles just include shared .mk files, you just need to update the .mk file and all projects are aligned without errors.

About Eclipse, it is just matter of getting used to it, it is not worse that Keil IMHO, better for some things. Give ChibiStudio a try, it is a zero-effort Eclipse toolchain.

I don't understand the part about STM32s being locked on ST's HAL, I don't think it is the case.

Giovanni

rbtripathi
Posts: 2
Joined: Sun Dec 10, 2017 6:07 am
Has thanked: 1 time

Re: Getting started in KEIL

Postby rbtripathi » Sun Dec 10, 2017 6:21 am

Is there any easy way to try Chibios under Keil IDE? Really want to use ChibiOS but don't want to give up Keil powerful debugging and tracing features.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Getting started in KEIL

Postby Giovanni » Sun Dec 10, 2017 6:59 am

Hi,

There is a demo with a Keil project under /demos/STM32/RT-STM32F303-DISCOVERY

Giovanni

rbtripathi
Posts: 2
Joined: Sun Dec 10, 2017 6:07 am
Has thanked: 1 time

Re: Getting started in KEIL

Postby rbtripathi » Sun Dec 10, 2017 10:00 pm

Thanks, that's what I was looking for and I'll get this board. Looks like this is the only board with Keil Project.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Getting started in KEIL

Postby Giovanni » Mon Dec 11, 2017 8:47 am

rbtripathi wrote:Thanks, that's what I was looking for and I'll get this board. Looks like this is the only board with Keil Project.


You can use any supported board with few changes to that project, we don't provide keil/iar/wathever projects in all demos because keeping those updated is a lot of work, makefiles are much easier to maintain thanks to the inclusion mechanism.

Giovanni


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 54 guests