From 83d757f3e1abae2fec08bb0052544ab08b25bd42 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Tue, 17 Dec 2019 22:10:42 -0700
Subject: [PATCH 1/7] Adding qNimble Quark to supported device family
---
README.md | 1 +
src/Device.cpp | 8 ++++++++
src/EfcFlash.cpp | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 72b702fd..2eb1549e 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ Supported Device Families
* SAMS70\*
* SAMV70\*
* SAMV71\*
+ * qNimble Quark\*
\* Device families which are not tested for each release and could stop working.
diff --git a/src/Device.cpp b/src/Device.cpp
index 0c94ae44..08ce4986 100644
--- a/src/Device.cpp
+++ b/src/Device.cpp
@@ -418,6 +418,14 @@ Device::create()
_family = FAMILY_SAMV71;
flashPtr = new EefcFlash(_samba, "ATSAMV71x21", 0x400000, 4096, 512, 1, 128, 0x20401000, 0x20404000, 0x400e0c00, false);
break;
+ //
+ // qNimble BOSSA-compatible bootloader
+ //
+ case 0x714e3000:
+ _family = FAMILY_SAM7X;
+ flashPtr = new EfcFlash(_samba, "qNimble BOSSAv1", 0x300000, 16384, 256, 2, 32, 0x202000, 0x220000, true);
+
+ break;
//
// No CHIPID devices
//
diff --git a/src/EfcFlash.cpp b/src/EfcFlash.cpp
index 9b212385..f6db9bf6 100644
--- a/src/EfcFlash.cpp
+++ b/src/EfcFlash.cpp
@@ -65,7 +65,7 @@ EfcFlash::EfcFlash(Samba& samba,
_canBootFlash(canBootFlash)
{
assert(planes == 1 || planes == 2);
- assert(pages <= planes * 1024);
+ assert(pages <= planes * 16384);
assert(lockRegions <= 32);
eraseAuto(true);
From 3619050cab4ca5bf3ba5f02902116a572e7b7375 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Wed, 23 Dec 2020 14:09:33 -0500
Subject: [PATCH 2/7] Support full 8MB of flash in single page for qNimble
Quarto. Name change to Quarto.
---
README.md | 2 +-
src/Device.cpp | 2 +-
src/EfcFlash.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 2eb1549e..ecabde0e 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Supported Device Families
* SAMS70\*
* SAMV70\*
* SAMV71\*
- * qNimble Quark\*
+ * qNimble Quarto\*
\* Device families which are not tested for each release and could stop working.
diff --git a/src/Device.cpp b/src/Device.cpp
index 08ce4986..8e848c45 100644
--- a/src/Device.cpp
+++ b/src/Device.cpp
@@ -423,7 +423,7 @@ Device::create()
//
case 0x714e3000:
_family = FAMILY_SAM7X;
- flashPtr = new EfcFlash(_samba, "qNimble BOSSAv1", 0x300000, 16384, 256, 2, 32, 0x202000, 0x220000, true);
+ flashPtr = new EfcFlash(_samba, "qNimble BOSSAv1", 0x300000, 32768, 256, 1, 32, 0x202000, 0x220000, true);
break;
//
diff --git a/src/EfcFlash.cpp b/src/EfcFlash.cpp
index f6db9bf6..81b0c217 100644
--- a/src/EfcFlash.cpp
+++ b/src/EfcFlash.cpp
@@ -65,7 +65,7 @@ EfcFlash::EfcFlash(Samba& samba,
_canBootFlash(canBootFlash)
{
assert(planes == 1 || planes == 2);
- assert(pages <= planes * 16384);
+ assert(pages <= planes * 65536);
assert(lockRegions <= 32);
eraseAuto(true);
From dee80dfe0e18dae550e42cab072366a573438efe Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Sat, 26 Dec 2020 09:50:25 -0500
Subject: [PATCH 3/7] Detect both 32 and 64 bit windows versions.
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 63b2b017..cea9eeeb 100644
--- a/Makefile
+++ b/Makefile
@@ -29,11 +29,12 @@ INSTALLDIR=install
# Determine OS
#
OS:=$(shell uname -s | cut -c -7)
+OS_SHORT:=$(shell uname -s | cut -c -5)
#
# Windows rules
#
-ifeq ($(OS),MINGW32)
+ifeq ($(OS_SHORT),MINGW)
# Use wxWindows development branch to work around font scaling issues on Windows
WXVERSION=3.1
EXE=.exe
From 710d13f0089d305b896a4c6fdadce95063b2c767 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Sat, 26 Dec 2020 18:28:02 -0500
Subject: [PATCH 4/7] Remove -ltermcap from COMMMON_LIB as it is not needed for
build
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index cea9eeeb..72c59735 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ WXVERSION=3.1
EXE=.exe
COMMON_SRCS+=WinSerialPort.cpp WinPortFactory.cpp
COMMON_LDFLAGS=-Wl,--enable-auto-import -static -static-libstdc++ -static-libgcc
-COMMON_LIBS=-ltermcap -Wl,--as-needed -lsetupapi
+COMMON_LIBS=-Wl,--as-needed -lsetupapi
BOSSA_RC=BossaRes.rc
WIXDIR="C:\Program Files (x86)\WiX Toolset v3.11\bin"
CODE_SIGN=$(INSTALLDIR)\\code_sign.p12
From a9fc978378d6cfc5f89d10b17de82808ff122e70 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Sat, 26 Dec 2020 18:30:08 -0500
Subject: [PATCH 5/7] Rename bossa to qBossa is help instructions
---
src/BossaForm.cpp | 2 +-
src/BossaForm.fbp | 2 +-
src/bossac.cpp | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/BossaForm.cpp b/src/BossaForm.cpp
index ecda8792..bd713407 100644
--- a/src/BossaForm.cpp
+++ b/src/BossaForm.cpp
@@ -271,7 +271,7 @@ AboutDialog::AboutDialog( wxWindow* parent, wxWindowID id, const wxString& title
_bossaBitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
_topBoxSizer->Add( _bossaBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
- _titleStaticText = new wxStaticText( this, wxID_ANY, wxT("Basic Open Source SAM-BA Application"), wxDefaultPosition, wxDefaultSize, 0 );
+ _titleStaticText = new wxStaticText( this, wxID_ANY, wxT("qNimble's Basic Open Source SAM-BA Application"), wxDefaultPosition, wxDefaultSize, 0 );
_titleStaticText->Wrap( -1 );
_topBoxSizer->Add( _titleStaticText, 0, wxALL, 5 );
diff --git a/src/BossaForm.fbp b/src/BossaForm.fbp
index 8db460d2..9b6744a7 100644
--- a/src/BossaForm.fbp
+++ b/src/BossaForm.fbp
@@ -2678,7 +2678,7 @@
0
0
wxID_ANY
- Basic Open Source SAM-BA Application
+ qNimble's Basic Open Source SAM-BA Application
0
diff --git a/src/bossac.cpp b/src/bossac.cpp
index 11ebcade..c0f0f251 100644
--- a/src/bossac.cpp
+++ b/src/bossac.cpp
@@ -336,7 +336,7 @@ main(int argc, char* argv[])
{
if (config.help)
printf("Usage: %s [OPTION...] [FILE]\n", argv[0]);
- printf("Basic Open Source SAM-BA Application (BOSSA) Version " VERSION "\n"
+ printf("qNimble's Basic Open Source SAM-BA Application (qBOSSA) Version " VERSION "\n"
"Flash programmer for Atmel SAM devices.\n"
"Copyright (c) 2011-2018 ShumaTech (http://www.shumatech.com)\n"
);
@@ -344,9 +344,9 @@ main(int argc, char* argv[])
{
printf("\n"
"Examples:\n"
- " bossac -e -w -v -b image.bin # Erase flash, write flash with image.bin,\n"
+ " qbossac -e -w -v -b image.bin # Erase flash, write flash with image.bin,\n"
" # verify the write, and set boot from flash\n"
- " bossac -r0x10000 image.bin # Read 64KB from flash and store in image.bin\n"
+ " qbossac -r0x10000 image.bin # Read 64KB from flash and store in image.bin\n"
);
printf("\nOptions:\n");
cmd.usage(stdout);
From f1794b5bc6661915364ea799eddb3c71db7026f3 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Sat, 26 Dec 2020 18:31:13 -0500
Subject: [PATCH 6/7] Github workflow to build binaries / release on new tag
---
.github/workflows/c-cpp.yml | 42 +++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 .github/workflows/c-cpp.yml
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
new file mode 100644
index 00000000..9075172f
--- /dev/null
+++ b/.github/workflows/c-cpp.yml
@@ -0,0 +1,42 @@
+name: C/C++ CI
+
+on:
+ create:
+ tags:
+ - '*'
+jobs:
+ publish:
+ name: Publish for ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ include:
+ - os: ubuntu-latest
+ artifact_name: bin/bossac
+ asset_name: qbossa-linux-amd64
+ - os: windows-latest
+ artifact_name: bin/bossac.exe
+ asset_name: qbossa-windows-amd64.exe
+ - os: macos-latest
+ artifact_name: bin/bossac
+ asset_name: qbossa-macos-amd64
+ steps:
+ - uses: actions/checkout@v2
+ - name: Inject slug/short variables
+ uses: rlespinasse/github-slug-action@v3.x
+ - name: info
+ run: |
+ echo ${{matrix.artifact_name}}
+ echo ${{matrix.os}}
+ echo ${{matrix.asset_name}}
+ - name: make
+ run: make bossac
+ - name: Upload file
+ uses: svenstaro/upload-release-action@v2
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file: ${{matrix.artifact_name}}
+ asset_name: ${{matrix.asset_name}}
+ tag: ${{github.ref}}
+ overwrite: true
+ body: "Release ${{env.GITHUB_REF_SLUG}} of qNimble verion of BOSSA"
From cff784da3c499b663746f8cac14bc19912de7387 Mon Sep 17 00:00:00 2001
From: Ben <57039667+ben-qnimble@users.noreply.github.com>
Date: Wed, 6 Jan 2021 12:00:32 -0500
Subject: [PATCH 7/7] Build both 32bit and 64bit for windows
---
.github/workflows/c-cpp.yml | 45 +++++++++++++++++++++++++++----------
Makefile | 11 ++++++---
2 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
index 9075172f..7af47c08 100644
--- a/.github/workflows/c-cpp.yml
+++ b/.github/workflows/c-cpp.yml
@@ -6,37 +6,58 @@ on:
- '*'
jobs:
publish:
- name: Publish for ${{ matrix.os }}
+ name: Publish for ${{ matrix.os }}-${{matrix.arch}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: bin/bossac
- asset_name: qbossa-linux-amd64
+ asset_name: qbossa
+ arch: amd64
+ suffix: -linux-amd64
- os: windows-latest
artifact_name: bin/bossac.exe
- asset_name: qbossa-windows-amd64.exe
+ asset_name: qbossa
+ arch: i686
+ msystem: MINGW32
+ suffix: -win32.exe
+ - os: windows-latest
+ artifact_name: bin/bossac.exe
+ asset_name: qbossa
+ arch: x86_64
+ msystem: MINGW64
+ suffix: -win64.exe
- os: macos-latest
artifact_name: bin/bossac
- asset_name: qbossa-macos-amd64
+ asset_name: qbossa
+ arch: amd64
+ suffix: -mac
+
steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- - name: info
- run: |
- echo ${{matrix.artifact_name}}
- echo ${{matrix.os}}
- echo ${{matrix.asset_name}}
- - name: make
- run: make bossac
+ - name: get msys2
+ uses: msys2/setup-msys2@v2
+ if: ${{matrix.os == 'windows-latest'}}
+ with:
+ msystem: ${{ matrix.msystem }}
+ install: git base-devel binutils mingw-w64-${{ matrix.arch }}-toolchain
+ release: false
+ - name: make (win)
+ if: ${{matrix.os == 'windows-latest'}}
+ shell: msys2 {0}
+ run: make bossac
+ - name: make (not win)
+ if: ${{matrix.os != 'windows-latest'}}
+ run: make bossac
- name: Upload file
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{matrix.artifact_name}}
- asset_name: ${{matrix.asset_name}}
+ asset_name: ${{matrix.asset_name}}-${{env.GITHUB_REF_SLUG}}${{matrix.suffix}}
tag: ${{github.ref}}
overwrite: true
body: "Release ${{env.GITHUB_REF_SLUG}} of qNimble verion of BOSSA"
diff --git a/Makefile b/Makefile
index 72c59735..f613c979 100644
--- a/Makefile
+++ b/Makefile
@@ -29,12 +29,17 @@ INSTALLDIR=install
# Determine OS
#
OS:=$(shell uname -s | cut -c -7)
-OS_SHORT:=$(shell uname -s | cut -c -5)
-
+ifeq ($(OS),MSYS_NT)
+OS:=WIN
+else ifeq ($(OS),MINGW32)
+OS:=WIN
+else ifeq ($(OS),MINGW64)
+OS:=WIN
+endif
#
# Windows rules
#
-ifeq ($(OS_SHORT),MINGW)
+ifeq ($(OS),WIN)
# Use wxWindows development branch to work around font scaling issues on Windows
WXVERSION=3.1
EXE=.exe