2018-12-09 10:05 PM
Hi there. I'm having a lot of trouble.
I've managed to get UART (just direct calls, not interrupt based), PWM, and ADC working on a Nucleo board (namely, the STM32F070RB board). However, I'm having serious trouble getting a simple push-button to fire an interrupt.
I'm using the on-board user button, tied to C13. I know this works and is not a hardware/solder bridge problem, because I've probed the exposed pin and it certainly changes between 3.3V/0V when released/pressed.
I watched this tutorial video and it seemed simple enough (like most things, thanks to STM32Cube): https://www.youtube.com/watch?v=UtkszckecV8
Sadly, I've had no luck. Here's a look at some of my code.
gpio.c generated from STM32Cube:
Callback function, as shown in the video, present in main.c:
Using the boolean the interrupt *should* set. The CommandLine() function is not blocking (even if it was, it shouldn't matter anyway, if this is an interrupt) and the PrintLn function I have made works perfectly fine (just based on normal HAL_UART_Transmit(), with an added \r\n).
If anyone has any ideas on what might be missing, not set, or configured incorrectly I would really appreciate it. This is the most simple part of the project, but is taking me the longest :face_without_mouth:
Cheers!
Solved! Go to Solution.
2018-12-10 02:13 PM
Hi there.
Sorry. It was actually a problem with my programmer/ELF file. It turned out for some reason the new compiled hex/bin (which had the interrupt implemented) wasn't getting flashed, and so things weren't working before. The code I have posted does in fact work.
I tried deleting the post about 5 minutes after posting it here, but it says "Administrator has disabled deleting posts and comments" so I can't. So please ignore this issue.
Thanks.
2018-12-09 11:02 PM
How do you set the EXTI registers?
JW
2018-12-10 02:13 PM
Hi there.
Sorry. It was actually a problem with my programmer/ELF file. It turned out for some reason the new compiled hex/bin (which had the interrupt implemented) wasn't getting flashed, and so things weren't working before. The code I have posted does in fact work.
I tried deleting the post about 5 minutes after posting it here, but it says "Administrator has disabled deleting posts and comments" so I can't. So please ignore this issue.
Thanks.
2018-12-10 10:03 PM
Thank you for coming back with the solution. Even if you might think that it was an irrelevant and trivial error, it's far from being so, and these lessons are very important to be told about.
Please mark your answer "Best" so that the thread will be tagged as solved.
JW
2018-12-13 01:51 AM
Hi Jan,
Thanks for guidelines you provided. I totally agree with what you suggested.
I marked the answer as best.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.