Compiling Crazyflie firmware in keil - linker section

Firmware/software/electronics/mechanics
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Compiling Crazyflie firmware in keil - linker section

Post 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?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: crazyflie firmware about address malloc

Post 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.
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Re: crazyflie firmware about address malloc

Post by justinleeyang »

Hi, arnaud:

I want to compile it in keil tool. how to transplant these code to keil compiler?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: crazyflie firmware about address malloc

Post 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?
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Re: crazyflie firmware about address malloc

Post by justinleeyang »

Hi,

No work. Now compiler report error. I will try it again with other method.
Thanks!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Compiling Crazyflie firmware in keil - linker section

Post 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.
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Re: Compiling Crazyflie firmware in keil - linker section

Post 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
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Compiling Crazyflie firmware in keil - linker section

Post 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 ?
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Re: Compiling Crazyflie firmware in keil - linker section

Post 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.
justinleeyang
Expert
Posts: 186
Joined: Mon Dec 28, 2015 5:07 am

Re: Compiling Crazyflie firmware in keil - linker section

Post 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?
Post Reply