I recommend to keep all mcuconf.h files aligned in all demos and test applications. This thing goes out of control easily.
Giovanni
[PATCH] AVR EXT Topic is solved
- 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:
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Giovanni wrote:
I recommend to keep all mcuconf.h files aligned in all demos and test applications.
Done, All mcuconf.h files are now align.
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi All,
I've been attempting to climb the Chibios learning curve, currently working on AVR examples learning to build and manage the configuration setting files.
I've been trying to run through HAL EXT example from testhal/AVR on Arduino Mega 2560 board without luck so far. I'm using ChibiOS_17.6.0.zip downloaded as a zip file from https://sourceforge.net/projects/chibio ... %2017.6.0/
I'm using the INT4 (PE4, Arduino D2) interrupt pin wired to a button with pull-up / ground connection attempting to trigger the interrupt.
Things build and load just fine, I get the serial term output showing I'm alive and running.
I am not able to get the interrupt to fire when toggling D2/INT4, no increment of isrCpt. I am monitoring Arduino D13 (LED, PB7) pin on my logic analyzer and it stays low no activity on D13 as D2 is toggled
Do the patches from this thread need to somehow be applied in order to get this example to work correctly. Any hints what I might be doing wrong?
Thanks,
George
I've been attempting to climb the Chibios learning curve, currently working on AVR examples learning to build and manage the configuration setting files.
I've been trying to run through HAL EXT example from testhal/AVR on Arduino Mega 2560 board without luck so far. I'm using ChibiOS_17.6.0.zip downloaded as a zip file from https://sourceforge.net/projects/chibio ... %2017.6.0/
I'm using the INT4 (PE4, Arduino D2) interrupt pin wired to a button with pull-up / ground connection attempting to trigger the interrupt.
Things build and load just fine, I get the serial term output showing I'm alive and running.
I am not able to get the interrupt to fire when toggling D2/INT4, no increment of isrCpt. I am monitoring Arduino D13 (LED, PB7) pin on my logic analyzer and it stays low no activity on D13 as D2 is toggled
Do the patches from this thread need to somehow be applied in order to get this example to work correctly. Any hints what I might be doing wrong?
Thanks,
George
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Hi MGeo,
I just saw you post, I going to take a look to ChibiOS_17.6.0.zip, normally, you do not need to patch that version with the patch I summit in this post before.
You can also use the trunk https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/ for sure it include the EXT driver, I'm using this with my robot.
I'm going to look the version you use and give you a feedback.
I just saw you post, I going to take a look to ChibiOS_17.6.0.zip, normally, you do not need to patch that version with the patch I summit in this post before.
You can also use the trunk https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/ for sure it include the EXT driver, I'm using this with my robot.
I'm going to look the version you use and give you a feedback.
regards,
Theo.
Theo.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
I just have the time to give a quick try. On both the trunk and ChibiOS_17.6.0, EXT driver is present. The code compile without error.
But effectively, It don't run as expected. The LED do not toggle and the counter is not incremented.
For the moment I did not understand what is happening.
I have to look carefully, because, the PCI support have been added to my work so I have to see if there is no conflict.
That will may be take several days but when I have the solution I will post to inform.
But effectively, It don't run as expected. The LED do not toggle and the counter is not incremented.
For the moment I did not understand what is happening.
I have to look carefully, because, the PCI support have been added to my work so I have to see if there is no conflict.
That will may be take several days but when I have the solution I will post to inform.
regards,
Theo.
Theo.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
I have the confirmation of what I expected:
The demo does not work because of the PCI support added next to the EXT driver.
To make a quick test, I have remove some code of the PCI Low Level Driver in hal_ext_lld.c
That helped me to see that the PCI driver force the user of EXT driver to use external interruption incrementally.
The user must start to use INT0, not from INT4 such as in the demo. This is not a good thing.
At that point, with the modification of the demo, I was then able to run the demo correctly.
But that is not the only problem, I'm still working on the to find why when all the PCI code is present there is a conflict with the EXT part.
It will mostly be resolve very soon .
The demo does not work because of the PCI support added next to the EXT driver.
To make a quick test, I have remove some code of the PCI Low Level Driver in hal_ext_lld.c
That helped me to see that the PCI driver force the user of EXT driver to use external interruption incrementally.
The user must start to use INT0, not from INT4 such as in the demo. This is not a good thing.
At that point, with the modification of the demo, I was then able to run the demo correctly.
But that is not the only problem, I'm still working on the to find why when all the PCI code is present there is a conflict with the EXT part.
It will mostly be resolve very soon .
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi Theo,
Thanks for the quick response. I will try moving over from INT4 to INT0 and report back
I did notice the warnings below when compiling main.c:
George
Compiling C: main.c
avr-gcc -c -mmcu=atmega2560 -I. -gdwarf-2 -DF_CPU=16000000UL -O2 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./main.lst -I../chibios/os/license -I../chibios/os/common/ports/AVR -I../chibios/os/common/ports/AVR/compilers/GCC -I../chibios/os/rt/include -I../chibios/os/common/oslib/include -I../chibios/os/hal/include -I../chibios/os/hal/osal/rt -I../chibios/os/hal/ports/AVR -I../chibios/os/hal/lib/streams -I../chibios/os/hal/boards/ARDUINO_MEGA -I../chibios/os/various -std=gnu11 -mrelax -fdata-sections -ffunction-sections -Wundef -MMD -MP -MF .dep/main.o.d main.c -o main.o
main.c:48:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT1 Config. */
^
main.c:48:5: warning: (near initialization for 'extcfg.channels')
main.c:49:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT2 Config. */
^
main.c:49:5: warning: (near initialization for 'extcfg.channels')
main.c:50:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT3 Config. */
^
main.c:50:5: warning: (near initialization for 'extcfg.channels')
main.c:51:5: warning: excess elements in array initializer
{EXT_CH_MODE_RISING_EDGE , extcb}, /* INT4 Config. */
^
main.c:51:5: warning: (near initialization for 'extcfg.channels')
main.c:52:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT5 Config. */
^
main.c:52:5: warning: (near initialization for 'extcfg.channels')
Thanks for the quick response. I will try moving over from INT4 to INT0 and report back
I did notice the warnings below when compiling main.c:
George
Compiling C: main.c
avr-gcc -c -mmcu=atmega2560 -I. -gdwarf-2 -DF_CPU=16000000UL -O2 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./main.lst -I../chibios/os/license -I../chibios/os/common/ports/AVR -I../chibios/os/common/ports/AVR/compilers/GCC -I../chibios/os/rt/include -I../chibios/os/common/oslib/include -I../chibios/os/hal/include -I../chibios/os/hal/osal/rt -I../chibios/os/hal/ports/AVR -I../chibios/os/hal/lib/streams -I../chibios/os/hal/boards/ARDUINO_MEGA -I../chibios/os/various -std=gnu11 -mrelax -fdata-sections -ffunction-sections -Wundef -MMD -MP -MF .dep/main.o.d main.c -o main.o
main.c:48:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT1 Config. */
^
main.c:48:5: warning: (near initialization for 'extcfg.channels')
main.c:49:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT2 Config. */
^
main.c:49:5: warning: (near initialization for 'extcfg.channels')
main.c:50:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT3 Config. */
^
main.c:50:5: warning: (near initialization for 'extcfg.channels')
main.c:51:5: warning: excess elements in array initializer
{EXT_CH_MODE_RISING_EDGE , extcb}, /* INT4 Config. */
^
main.c:51:5: warning: (near initialization for 'extcfg.channels')
main.c:52:5: warning: excess elements in array initializer
{EXT_CH_MODE_DISABLED , NULL}, /* INT5 Config. */
^
main.c:52:5: warning: (near initialization for 'extcfg.channels')
Last edited by MGeo on Thu Jul 27, 2017 10:23 am, edited 2 times in total.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Hi MGeo,
I have already did that, but it is not enough, there is still another problem that I didn't yet catch.
But try it if you want and report your observation.
I will work on it tonight and hope to find what cause the conflict.
I have already did that, but it is not enough, there is still another problem that I didn't yet catch.
But try it if you want and report your observation.
I will work on it tonight and hope to find what cause the conflict.
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi Theo,
As expected based on your posts, I move the INT pin from INT4 to INT0 and I get the Interrupt to fire.
Latency from my test is about 0.18 mSec.
Dropbox link: Screen cap
Dropbox link: Zoom in with time measurement
George
As expected based on your posts, I move the INT pin from INT4 to INT0 and I get the Interrupt to fire.
Latency from my test is about 0.18 mSec.
Dropbox link: Screen cap
Dropbox link: Zoom in with time measurement
George
Who is online
Users browsing this forum: No registered users and 27 guests