Beginner questions about STM32 and System Workbench
I’ve just started working with the STM32 Cortex-M0+ MCUs and I want to understand a few things I’m seeing in the programming process. Any insight would be appreciated.
I have an STM32L051K8T6 connected with a genuine ST-LINK/V2 using SWD with nSRST connected. I’m running the simple LED blink program shown below to blink an LED connected a a transistor on pin 20 (i.e., GPIO PORTA10):
It seems to be working, other than occasionally having to try to program the device twice (the first time the programming fails). This is the .cfg file I’m using:
My main concern is that I’m seeing a number of errors during the programming process and I suspect that some of them could be related to the odd issues I’ve been seeing. Here are some examples:
In particular, I’m wondering:
1. Why is it warning that it can’t use the loader? Does that mean the boot loader? Would it even make sense to use the boot loader over SWD? I just don’t understand this message.
2. If I’m using SWD, why is it giving me a JTAG failure and how can I find out which register it is trying to set?
3. Is it normal for it to experience a HardFault during the programming process? I guess that is more of an ARM question than a System Workbench question, but it seems like a strange message to experience during device programming.
I’m coming from a background of AVR and PIC where the tools are mostly closed-source but well documented, and I really like having the fully open source System Workbench for STM32, but I know there can be some learning curve with open source systems. Any answers to these questions or general information about how to make development and testing run smoothly with this system would be appreciated.