Page 1 of 2

Compiling Crazyflie firmware in keil - linker section

Posted: Wed Sep 21, 2016 2:10 pm
by justinleeyang
Hi, all:
About the following code:

extern const struct deck_driver * _deckDriver_start;
extern const struct deck_driver * _deckDriver_stop;

I have checked the all crazyflie firmware code, no find any declare the parameters, the commit as follow:
/* Symbols set by the linker script */

the declare is in link script ? whick directory?

Re: crazyflie firmware about address malloc

Posted: Wed Sep 21, 2016 2:14 pm
by arnaud
Hi,

This is implemented the same way as log an param in the linker script: https://github.com/bitcraze/crazyflie-f ... ld#L59-L62

Structures are added to the .deckDriver section by the macros that declare the deck drivers.

Re: crazyflie firmware about address malloc

Posted: Wed Sep 21, 2016 2:18 pm
by justinleeyang
Hi, arnaud:

I want to compile it in keil tool. how to transplant these code to keil compiler?

Re: crazyflie firmware about address malloc

Posted: Wed Sep 21, 2016 2:31 pm
by arnaud
I do not know. This is basic functionality so it has to be possible.

do you have the problem for log and param as well or are you starting from a project that already has log/param working?

Re: crazyflie firmware about address malloc

Posted: Wed Sep 21, 2016 2:34 pm
by justinleeyang
Hi,

No work. Now compiler report error. I will try it again with other method.
Thanks!

Re: Compiling Crazyflie firmware in keil - linker section

Posted: Wed Sep 21, 2016 2:49 pm
by arnaud
Hi, you did not answer my question: did you start from an empty project or one that already compiled correctly the log/param sections? I know other people have been experimenting with Keil.

I changed the title of this thread to hopefully attract more help since I have no experience with using Keil.

Re: Compiling Crazyflie firmware in keil - linker section

Posted: Wed Sep 21, 2016 2:56 pm
by justinleeyang
Hi,

sorry, I start from an empty project. maybe I need remalloc the address.
reference the code:
https://github.com/wwfiney/crazyflie_firmware_keil_gcc

Re: Compiling Crazyflie firmware in keil - linker section

Posted: Wed Sep 21, 2016 3:04 pm
by arnaud
This has nothing to do with Malloc, structures are put in a custom sections and these variable will indicate the start and end address of the section. You will have to look at the documentation of the keill linker to see how to implement similar functionality.

The reason I was suspecting that you are not starting from 0 is that log and param are implemented the same way and since you do not seem to have problems with log and param and they are implemented the same way so they should cause problem too.

What about this file, this looks like a linker script: https://github.com/wwfiney/crazyflie_fi ... xt#L19-L28 ?

Re: Compiling Crazyflie firmware in keil - linker section

Posted: Thu Sep 22, 2016 12:24 am
by justinleeyang
Hi,

I got your mean, I know that deckDriver is later than log and param,
I have no implement log and param feature, beacuse compile firstly report _deckDriver_start error, Actually, log and param part also exist similar problem.Thanks your reply.

Re: Compiling Crazyflie firmware in keil - linker section

Posted: Mon Sep 26, 2016 2:54 am
by justinleeyang
hi, arnaud:

Currently, I have already compile successfully in keil, but after crazyflie2 printf information, hang, Can I temporarily disable the log, param and deckdriver to map address? or how to debug the log, param and deckdriver?