From 01b43bd8b83463e841098d5595645b72791f7973 Mon Sep 17 00:00:00 2001 From: Fabien Poussin Date: Fri, 11 Dec 2015 18:03:50 +0100 Subject: [PATCH] Fix for STM32L0 --- QStlink2.pro | 2 +- README.md | 1 - inc/stlinkv2.h | 1 + src/stlinkv2.cpp | 6 +++++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/QStlink2.pro b/QStlink2.pro index cbdaf69..1434422 100644 --- a/QStlink2.pro +++ b/QStlink2.pro @@ -26,7 +26,7 @@ win32:CONFIG += winusb TEMPLATE = app TARGET = qstlink2 -VERSION = 1.2.1 +VERSION = 1.2.2 message(Building version $$VERSION for Qt $$QT_VERSION) diff --git a/README.md b/README.md index 1eefb42..1412095 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ It can perform the following actions: **Downloads** Windows binaries: - - https://drive.google.com/folderview?id=0BzWyTGWIwcYQS0JRQkw2Q3J6R1U&usp=sharing - https://github.com/fpoussin/QStlink2/releases Ubuntu PPA: diff --git a/inc/stlinkv2.h b/inc/stlinkv2.h index 42e6396..f6c747d 100644 --- a/inc/stlinkv2.h +++ b/inc/stlinkv2.h @@ -143,6 +143,7 @@ namespace STM32 { namespace Cortex { namespace CoreID { const quint32 M0_R0 = 0x0BB11477; /**< TODO: describe */ + const quint32 M0_R1 = 0x0BC11477; /**< TODO: describe */ const quint32 M3_R1 = 0x1BA00477; /**< TODO: describe */ const quint32 M3_R2 = 0x4BA00477; /**< TODO: describe */ const quint32 M4_R0 = 0x2BA01477; /**< TODO: describe */ diff --git a/src/stlinkv2.cpp b/src/stlinkv2.cpp index b79779f..735b2f2 100644 --- a/src/stlinkv2.cpp +++ b/src/stlinkv2.cpp @@ -164,7 +164,7 @@ quint32 stlinkv2::getCoreID() QByteArray buf; this->debugCommand(&buf, STLink::Cmd::Dbg::ReadCoreID, 0, 4); mCoreId = qFromLittleEndian((uchar*)buf.constData()); - qInfo() << "CoreID:" << QString::number(mCoreId, 16); + qInfo("CoreID: %03X", mCoreId); return mCoreId; } @@ -180,6 +180,10 @@ quint32 stlinkv2::getChipID() this->readMem32(&buf, Cortex::Reg::CM0_CHIPID); qInfo("CM0 Searching at %08X", Cortex::Reg::CM0_CHIPID); } + else if (mCoreId == Cortex::CoreID::M0_R1) { + this->readMem32(&buf, Cortex::Reg::CM0_CHIPID); + qInfo("CM0+ Searching at %08X", Cortex::Reg::CM0_CHIPID); + } else { this->readMem32(&buf, Cortex::Reg::CM3_CHIPID); qInfo("CM3/4 Searching at %08X", Cortex::Reg::CM3_CHIPID);