EXT Driver Crashing on STM32F4 Discovery

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

EXT Driver Crashing on STM32F4 Discovery

Post by Graeme »

Hi,

I am trying to get the EXT driver working on STM32F4 Discovery. When in debug mode I can see that the interrupt from the push buuton is being "seen" by the ext_lld_isr interrupt routine for EXT_Line0.
However, afer a few times of receiving this interrupt I notice the system has crashed and the program counter is sitting at _unhandles_exception.

I am using stock standard chibios 2.6.1 with the example out of the testhal directory for EXT.

Any help with this would be appreciated.

Kind regards

Graeme
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Giovanni »

Hi,

Probably it depends on what you have in the EXT callback, hard to tell without code. Also, are you running with debug options enabled?

Giovanni
Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Graeme »

HI Giovanni,

Callback is as in the testhal example(part of Chibios). However, my ST32F407 is getting really warm. Am starting to suspect a board fault. I have sanother one to test wit

Thanks

Graeme
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Giovanni »

Uhm, yes, it is likely.

Giovanni
Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Graeme »

Hi Giovanni,

Have tested the it again with a new working STM32F4 discovery board. Still the same problem.

System setup: Standard latest Chibios. Replaced the demo main.c for Discovery board with the main.c in testhal\EXT\
All optimisations turned off. Debugging turned on. Compiled with no warnings,no errors. Still hangs after around 4 interrupts.

Tried baremetal code for EXT. Works fine.

any further ideas?

Kind regards
Graeme
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Giovanni »

What toolchain are you using?

Giovanni
Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Graeme »

Am using the code 32k limited version of Keil
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Giovanni »

Hi,

It is likely a project setup problem, see at the existing Keil demos, there are settings to do, especially about the linker and memory areas.

Do existing Keil demos work for you?

Giovanni
Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Graeme »

If you mean existing keil demos for Chibios then yes. The only one I have really tried is the STM32F4 Discovery demo . Flashes a few LEDS etc.
That one works perfectly and runs indefintely.

Graeme
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: EXT Driver Crashing on STM32F4 Discovery

Post by Giovanni »

Hi, you should start from that project and add the drivers you need, there are several settings to be done in the various option tabs. You should compare your project with the demo tab by tab.

Giovanni
Post Reply