Page 1 of 2

enviroment issue

Posted: Thu Oct 03, 2013 1:14 am
by nanos
Hi all,
I'm new to ChibiOS, actually I'm test the last release with Mentor arm-none-eabi toolchain.
After tried the demos I moved on and I create a mine directory in which put my project... A template project and then I've modified the Makefile to match the path of OS (ChibiOS dir).
I ve write some codes for learn the use of threads and other modules .. and all worked fine until now.
In this moment I'm tring to use of gpt from testhal example... but when I try to compile in my directory some errors occur.
Thus I try to built it in the original example path "ChibiOS-RT/testhal/STM32F4xx/GPT" but the errors are the same:

Code: Select all

/home/../rt_OSs/ChibiOS-RT/os/hal/platforms/STM32/TIMv1/gpt_lld.c: In function 'gpt_lld_start':
/home/../rt_OSs/ChibiOS-RT/os/hal/platforms/STM32/TIMv1/gpt_lld.c:536:24: error: 'TIM6_IRQn' undeclared (first use in this function)
/home/../rt_OSs/ChibiOS-RT/os/hal/platforms/STM32/TIMv1/gpt_lld.c:536:24: note: each undeclared identifier is reported only once for each function it appears in
/home/../rt_OSs/ChibiOS-RT/os/hal/platforms/STM32/TIMv1/gpt_lld.c: In function 'gpt_lld_stop':
/home/../rt_OSs/ChibiOS-RT/os/hal/platforms/STM32/TIMv1/gpt_lld.c:663:25: error: 'TIM6_IRQn' undeclared (first use in this function)
make: *** [build/obj/gpt_lld.o] Errore 1


I've tried to fix it ... the Makefile say that:

Code: Select all

include $(CHIBIOS)/boards/ST_STM32F4_DISCOVERY/board.mk
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/test/test.mk


Then I suppose that it point in the right paths... in particular particular platform, board. In the "ChibiOS-RT/os/hal/platforms/STM32F4xx/" directory there are the .h required (stm32f4xx.h and stm32_isr.h).. the problem is that in stm32_isr.h the definition of incriminated constant (#define STM32_TIM6_NUMBER TIM6_IRQn) is a litteral ... then not defined anywhere.

The question are:
I have to include manually the ST inclusions (definitions of IRQn) ?
Why when I build other projects (that use only tread and pal functions) the system has builded correctly and no with TMR usage?? (IRQn ???)

Thanks

Re: enviroment issue

Posted: Thu Oct 03, 2013 6:17 am
by Tectu
Please make sure that you enabled the GPT module in your halconf.h and that you also enabled the timers you want to use within the GPT in your mcuconf.h.


~ Tectu

Re: enviroment issue

Posted: Thu Oct 03, 2013 8:00 am
by Giovanni
Hi,

This is strange, the ST header is implicitly included, try compiling /testhal/STM32F4xx/IRQ_STORM or /testhal/STM32F4xx/PWM-ICU, those use timers too.

Giovanni

Re: enviroment issue

Posted: Thu Oct 03, 2013 5:13 pm
by nanos
Tectu wrote:Please make sure that you enabled the GPT module in your halconf.h and that you also enabled the timers you want to use within the GPT in your mcuconf.h.


~ Tectu


Thank you for your attention,
I checked halconf.h (that include also mcuconf.h) whithin there is the definition:
'#define HAL_USE_GPT TRUE'
I think that you intended this when you allude to enable GPT module.
Then I think that not depend by this.

Re: enviroment issue

Posted: Thu Oct 03, 2013 5:33 pm
by nanos
Giovanni wrote:Hi,

This is strange, the ST header is implicitly included, try compiling /testhal/STM32F4xx/IRQ_STORM or /testhal/STM32F4xx/PWM-ICU, those use timers too.

Giovanni


Hi Giovanni,
You're right, when I tryed to build the example in testhal/ the build process was done without error (only a warning in IRQ_STORM)...
Strange, last night I really thought to do it this test ... maybe was too late ... :) .
I'll check the examples again... the 'Volta's key' certly have to reside there!
Obviously if have idea of my mistake ... I'm staying here to hear you :) !
Thanks

Re: enviroment issue

Posted: Thu Oct 03, 2013 5:48 pm
by nanos
It's interesting notice that checking Makefile of my project respect the IRQ_STORM project's (with a DiffCompareSoftware ->Meld) the only difference between the two files is the CHIBIOS absolute path and a CSRC's line in wich it call lis302dl.c (the onboard MEMS).
Thus I suppose that is not a makefile problem.

Re: enviroment issue

Posted: Thu Oct 03, 2013 6:08 pm
by Giovanni
All demos follow the same patterns and use the same makefiles, so a problem in a single demo is unlikely.

Giovanni

Re: enviroment issue

Posted: Thu Oct 03, 2013 6:59 pm
by nanos
Giovanni wrote:All demos follow the same patterns and use the same makefiles, so a problem in a single demo is unlikely.

Giovanni


I tryed to copy GPT demo and work on this...
Then I become suspicious...
In ChibiOS_2.6.1 (last stable) in GPT/mcuconf.h at line 116 there is a definition that I don't understand.
Why repeat STM32_GPT_USE_TIM8 instead to list all TIMx ?
I tryed to change TIM8 with TIM6 ... and 'tac' the build process report the same error of last times!

Then the problem is this...

Trying to fix it:
I copied the files chconf.h (for to be sure) hal.conf and mcuconf.h from testhal/IRQ_STORM/ to /mine/GPTexample/
I tryed to build again...
All work properly !

The explanation... obviously I don't know... :)
maybe with copy and paste actions from and to mineprojects directories (or demos) of different versions of ChibiOS have produced unaspected mix of codes...
Thanks again

Re: enviroment issue

Posted: Thu Oct 03, 2013 7:41 pm
by Giovanni
Thanks for finding, that is actually an error. There was also another instance in IRQ_STORM for the F3.

Giovanni

Re: enviroment issue

Posted: Sat Oct 05, 2013 2:53 am
by nanos
Always talking about IRQ_STORM. The demo port the 'IRQ_handler inside the GPT_cb' right?
I say that because I note that inside GTP_cb there're the two statements for Lock & Release the system from interrupts.
Externally (for newbie) this (and other things) appear quite different from normal programming tecniques with st_periph_lib case in which to work with interrupt (for example) we have to set NVIC..
I think in ChibiOS the NVICs are configured by kernel for implement the RT/OS ... right?

It would be interesting to read something a little more in discourse form respect as topics are covered in the technical documentation... and more important thing ...probably I don't know enaugh about RT/OSs :) ... can anyone guide me to the literature?

Another question that I would ask is exist, also remotly in future release, the possibility to port in ada the programming language?

Thanks