Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ch32v003fun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Horn
ch32v003fun
Commits
e24fc6f0
Commit
e24fc6f0
authored
1 year ago
by
Alexander Mandera
Browse files
Options
Downloads
Patches
Plain Diff
Fix minichlink compilation
parent
45d5cca3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
minichlink/Makefile
+3
-3
3 additions, 3 deletions
minichlink/Makefile
minichlink/minichlink.exe
+0
-0
0 additions, 0 deletions
minichlink/minichlink.exe
minichlink/minichlink.h
+7
-7
7 additions, 7 deletions
minichlink/minichlink.h
minichlink/pgm-wch-linke.c
+17
-17
17 additions, 17 deletions
minichlink/pgm-wch-linke.c
with
27 additions
and
27 deletions
minichlink/Makefile
+
3
−
3
View file @
e24fc6f0
TOOLS
:=
minichlink minichlink.so
CFLAGS
:=
-O0
-g3
-Wall
-I
.
CFLAGS
:=
-O0
-g3
-Wall
-DCH32V003
-I
.
C_S
:=
minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c serial_dev.c pgm-b003fun.c minichgdb.c
# General Note: To use with GDB, gdb-multiarch
...
...
@@ -9,7 +9,7 @@ C_S:=minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c
ifeq
($(OS),Windows_NT)
LDFLAGS
:=
-L
.
-lpthread
-lusb-1
.0
-lsetupapi
-lws2_32
CFLAGS
:=
-Os
-s
-Wall
-D_WIN32_WINNT
=
0x0600
-I
.
CFLAGS
:=
-Os
-s
-Wall
-D_WIN32_WINNT
=
0x0600
-DCH32V003
-I
.
TOOLS
:=
minichlink.exe
else
OS_NAME
:=
$(
shell
uname
-s
|
tr
A-Z a-z
)
...
...
@@ -18,7 +18,7 @@ else
endif
ifeq
($(OS_NAME),darwin)
LDFLAGS
:=
-lpthread
-lusb-1
.0
-framework
CoreFoundation
-framework
IOKit
CFLAGS
:=
-O0
-Wall
-Wno-asm-operand-widths
-Wno-deprecated-declarations
-Wno-deprecated-non-prototype
-D__MACOSX__
-I
.
CFLAGS
:=
-O0
-Wall
-Wno-asm-operand-widths
-Wno-deprecated-declarations
-Wno-deprecated-non-prototype
-D__MACOSX__
-DCH32V003
-I
.
INCLUDES
:=
$(
shell pkg-config
--cflags-only-I
libusb-1.0
)
LIBINCLUDES
:=
$(
shell pkg-config
--libs-only-L
libusb-1.0
)
INCS
:=
$(
INCLUDES
)
$(
LIBINCLUDES
)
...
...
This diff is collapsed.
Click to expand it.
minichlink/minichlink.exe
+
0
−
0
View file @
e24fc6f0
No preview for this file type
This diff is collapsed.
Click to expand it.
minichlink/minichlink.h
+
7
−
7
View file @
e24fc6f0
...
...
@@ -105,13 +105,13 @@ struct ProgrammerStructBase
#define MAX_FLASH_SECTORS 262144
enum
RiscVChip
{
CH32V10x
=
0x01
,
CH57x
=
0x02
,
CH56x
=
0x03
,
CH32V20x
=
0x05
,
CH32V30x
=
0x06
,
CH58x
=
0x07
,
CH32V003
=
0x09
CHIP_
CH32V10x
=
0x01
,
CHIP_
CH57x
=
0x02
,
CHIP_
CH56x
=
0x03
,
CHIP_
CH32V20x
=
0x05
,
CHIP_
CH32V30x
=
0x06
,
CHIP_
CH58x
=
0x07
,
CHIP_
CH32V003
=
0x09
};
struct
InternalState
...
...
This diff is collapsed.
Click to expand it.
minichlink/pgm-wch-linke.c
+
17
−
17
View file @
e24fc6f0
...
...
@@ -18,25 +18,25 @@ struct LinkEProgrammerStruct
static
void
printChipInfo
(
enum
RiscVChip
chip
)
{
switch
(
chip
)
{
case
CH32V10x
:
case
CHIP_
CH32V10x
:
fprintf
(
stderr
,
"Detected: CH32V10x
\n
"
);
break
;
case
CH57x
:
case
CHIP_
CH57x
:
fprintf
(
stderr
,
"Detected: CH57x
\n
"
);
break
;
case
CH56x
:
case
CHIP_
CH56x
:
fprintf
(
stderr
,
"Detected: CH56x
\n
"
);
break
;
case
CH32V20x
:
case
CHIP_
CH32V20x
:
fprintf
(
stderr
,
"Detected: CH32V20x
\n
"
);
break
;
case
CH32V30x
:
case
CHIP_
CH32V30x
:
fprintf
(
stderr
,
"Detected: CH32V30x
\n
"
);
break
;
case
CH58x
:
case
CHIP_
CH58x
:
fprintf
(
stderr
,
"Detected: CH58x
\n
"
);
break
;
case
CH32V003
:
case
CHIP_
CH32V003
:
fprintf
(
stderr
,
"Detected: CH32V003
\n
"
);
break
;
}
...
...
@@ -44,15 +44,15 @@ static void printChipInfo(enum RiscVChip chip) {
static
int
checkChip
(
enum
RiscVChip
chip
)
{
switch
(
chip
)
{
case
CH32V003
:
case
CHIP_
CH32V003
:
return
0
;
// Use direct mode
case
CH32V10x
:
case
CH32V20x
:
case
CH32V30x
:
case
CHIP_
CH32V10x
:
case
CHIP_
CH32V20x
:
case
CHIP_
CH32V30x
:
return
1
;
// Use binary blob mode
case
CH56x
:
case
CH57x
:
case
CH58x
:
case
CHIP_
CH56x
:
case
CHIP_
CH57x
:
case
CHIP_
CH58x
:
default:
return
-
1
;
// Not supported yet
}
...
...
@@ -530,10 +530,10 @@ int bootloader_len = 512;
static
const
uint8_t
*
GetFlashLoader
(
enum
RiscVChip
chip
)
{
switch
(
chip
)
{
case
CH32V10x
:
case
CHIP_
CH32V10x
:
return
bootloader_v1
;
case
CH32V20x
:
case
CH32V30x
:
case
CHIP_
CH32V20x
:
case
CHIP_
CH32V30x
:
default:
return
bootloader_v2
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment