Modified library for STM32F030K6 - problem with external interrupts

26 Oct 2016

I modified the mbed-src library to work with STM32F030K6 as discussed in this thread: https://developer.mbed.org/forum/electronics/topic/5184/ The Library: https://developer.mbed.org/users/emilj/code/mbed-src-STM32F030K6/

It mostly works. I can compile programs and they run as expected with one exception: Any program using external interrups will hang when an interrupt is triggered.

I suspect there is a difference in the way F030K6 handles interrupts compared to F030K8, but I have not been able to find out what it is.

Anyone know what the problem might be?

Example: This program using the QEI library will run as expected until PA_0 or PA_1 changes state, then it will hang.

#include "mbed.h"
#include "QEI.h"

DigitalOut GreenLED(PA_2);
DigitalOut RedLED(PA_9); 
DigitalOut StillAlivePin(PA_12);  
QEI encoder(PA_0, PA_1, NC, 600, QEI::X4_ENCODING);

int main() {
    int prev = 0;
    int now = 0;
    
    while(1) {
        StillAlivePin = !StillAlivePin;
        prev = now;
        now = encoder.getPulses();
        if (now > prev) {
            GreenLED = 1;
            RedLED = 0;
        } else if (now < prev) {
            GreenLED = 0;
            RedLED = 1;
        } else {
            GreenLED = 0;
            RedLED = 0;    
        }
    }
}