Open anwfeb opened 6 months ago
You open the bootloader directory in your terminal and you execute make
. On Windows you can execute make_win.bat
. Whenever you change a header file, execute make clean
.
This should compile and upload the bootloader to a chip via minichlink.
You get any errors?
please check this, I can't do that.
Microsoft Windows [Version 10.0.19045.4046] (c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>cd C:\rv003usb\bootloader
C:\rv003usb\bootloader>make_win.bat
C:\rv003usb\bootloader>REM Bad USB Operation on pgm-wch-linke.c ? Zadig!
C:\rv003usb\bootloader>del bootloader.bin Could Not Find C:\rv003usb\bootloader\bootloader.bin
C:\rv003usb\bootloader>del bootloader.elf Could Not Find C:\rv003usb\bootloader\bootloader.elf
C:\rv003usb\bootloader>del bootloader.hex Could Not Find C:\rv003usb\bootloader\bootloader.hex
C:\rv003usb\bootloader>del bootloader.lst Could Not Find C:\rv003usb\bootloader\bootloader.lst
C:\rv003usb\bootloader>del bootloader.map Could Not Find C:\rv003usb\bootloader\bootloader.map
C:\rv003usb\bootloader>make build riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -march=rv32ec -mabi=ilp32e -DCH32V003=1 -static-libgcc -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -L../ch32v003fun/ch32v003fun/../misc -lgcc -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections process_begin: CreateProcess(NULL, riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -march=rv32ec -mabi=ilp32e -DCH32V003=1 -static-libgcc -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -L../ch32v003fun/ch32v003fun/../misc -lgcc -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections, ...) failed. make (e=2): The system cannot find the file specified. make: *** [bootloader.elf] Error 2
C:\rv003usb\bootloader>..\ch32v003fun\minichlink\minichlink.exe -a -w bootloader.bin bootloader -B Error: couldn't open wch link device (libusb_open() = -5) Error: Could not initialize any supported programmers Error: Could not initialize any supported programmers
C:\rv003usb\bootloader>
Did you follow the installation of GCC10 from https://github.com/cnlohr/ch32v003fun/wiki/Installation#windows ?
I guess make can't execute riscv64-unknown-elf-gcc
.
Can you just execute riscv64-unknown-elf-gcc
from the teminal?
If it's not found and you installed GCC10, make sure your %path% environmen variable contains the GCC10 folder.
i have installed GCC10, but I don't understand what the %path% step you mean is. now I see an error like this.
`Microsoft Windows [Version 10.0.19045.4046] (c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>cd C:\rv003usb\bootloader
C:\rv003usb\bootloader>make_win.bat
C:\rv003usb\bootloader>REM Bad USB Operation on pgm-wch-linke.c ? Zadig!
C:\rv003usb\bootloader>del bootloader.bin Could Not Find C:\rv003usb\bootloader\bootloader.bin
C:\rv003usb\bootloader>del bootloader.elf Could Not Find C:\rv003usb\bootloader\bootloader.elf
C:\rv003usb\bootloader>del bootloader.hex Could Not Find C:\rv003usb\bootloader\bootloader.hex
C:\rv003usb\bootloader>del bootloader.lst Could Not Find C:\rv003usb\bootloader\bootloader.lst
C:\rv003usb\bootloader>del bootloader.map Could Not Find C:\rv003usb\bootloader\bootloader.map
C:\rv003usb\bootloader>make build
riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -march=rv32ec -mabi=ilp32e -DCH32V003=1 -static-libgcc -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -L../ch32v003fun/ch32v003fun/../misc -lgcc -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections
../ch32v003fun/ch32v003fun/ch32v003fun.h: Assembler messages:
../ch32v003fun/ch32v003fun/ch32v003fun.h:636: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:637: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:638: Error: unrecognized opcode __io uint32_t CFGR0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:639: Error: unrecognized opcode
io uint32_t CFGR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:640: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:643: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:644: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:645: Error: unrecognized opcode
__io uint32_t CFGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:646: Error: unrecognized opcode `io uint32_t CNTR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:647: Error: unrecognized opcode __io uint32_t PADDR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:648: Error: unrecognized opcode
io uint32_t MADDR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:649: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:651: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:652: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:653: Error: unrecognized opcode
__io uint32_t INTFR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:654: Error: unrecognized opcode `io uint32_t INTFCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:655: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:658: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:659: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:660: Error: unrecognized opcode
io uint32_t INTENR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:661: Error: unrecognized opcode __io uint32_t EVENR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:662: Error: unrecognized opcode
io uint32_t RTENR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:663: Error: unrecognized opcode __io uint32_t FTENR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:664: Error: unrecognized opcode
io uint32_t SWIEVR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:665: Error: unrecognized opcode __io uint32_t INTFR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:666: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:669: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:670: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:671: Error: unrecognized opcode `io uint32_t ACTLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:672: Error: unrecognized opcode __io uint32_t KEYR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:673: Error: unrecognized opcode
io uint32_t OBKEYR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:674: Error: unrecognized opcode __io uint32_t STATR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:675: Error: unrecognized opcode
io uint32_t CTLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:676: Error: unrecognized opcode __io uint32_t ADDR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:677: Error: unrecognized opcode
io uint32_t RESERVED'
../ch32v003fun/ch32v003fun/ch32v003fun.h:678: Error: unrecognized opcode __io uint32_t OBR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:679: Error: unrecognized opcode
io uint32_t WPR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:680: Error: unrecognized opcode __io uint32_t MODEKEYR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:682: Error: unrecognized opcode
io uint32_t BOOT_MODEKEYR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:684: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:687: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:688: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:689: Error: unrecognized opcode
io uint16_t RDPR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:690: Error: unrecognized opcode __io uint16_t USER' ../ch32v003fun/ch32v003fun/ch32v003fun.h:691: Error: unrecognized opcode
io uint16_t Data0'
../ch32v003fun/ch32v003fun/ch32v003fun.h:692: Error: unrecognized opcode __io uint16_t Data1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:693: Error: unrecognized opcode
io uint16_t WRPR0'
../ch32v003fun/ch32v003fun/ch32v003fun.h:694: Error: unrecognized opcode __io uint16_t WRPR1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:699: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:701: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:702: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:703: Error: unrecognized opcode __io uint16_t CAP' ../ch32v003fun/ch32v003fun/ch32v003fun.h:704: Error: unrecognized opcode
io uint16_t RES1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:705: Error: unrecognized opcode __io uint32_t RES2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:706: Error: unrecognized opcode
io uint32_t UID0'
../ch32v003fun/ch32v003fun/ch32v003fun.h:707: Error: unrecognized opcode __io uint32_t UID1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:708: Error: unrecognized opcode
io uint32_t UID2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:709: Error: unrecognized opcode __io uint32_t RES3' ../ch32v003fun/ch32v003fun/ch32v003fun.h:710: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:738: Error: unrecognized opcode typedef enum' ../ch32v003fun/ch32v003fun/ch32v003fun.h:739: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:740: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:741: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:742: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:743: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:744: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:745: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:746: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:747: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:748: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:749: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:750: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:751: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:752: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:753: Error: junk at end of line, first unrecognized character is
,'
../ch32v003fun/ch32v003fun/ch32v003fun.h:754: Error: junk at end of line, first unrecognized character is ,' ../ch32v003fun/ch32v003fun/ch32v003fun.h:755: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:757: Error: unrecognized opcode typedef union{' ../ch32v003fun/ch32v003fun/ch32v003fun.h:758: Error: unrecognized opcode
uint32_t __FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:759: Error: unrecognized opcode struct {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:760: Error: unrecognized opcode
gpio_cfglr_pin_mode_typedef PIN0:4'
../ch32v003fun/ch32v003fun/ch32v003fun.h:761: Error: unrecognized opcode gpio_cfglr_pin_mode_typedef PIN1:4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:762: Error: unrecognized opcode
gpio_cfglr_pin_mode_typedef PIN2:4'
../ch32v003fun/ch32v003fun/ch32v003fun.h:763: Error: unrecognized opcode gpio_cfglr_pin_mode_typedef PIN3:4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:764: Error: unrecognized opcode
gpio_cfglr_pin_mode_typedef PIN4:4'
../ch32v003fun/ch32v003fun/ch32v003fun.h:765: Error: unrecognized opcode gpio_cfglr_pin_mode_typedef PIN5:4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:766: Error: unrecognized opcode
gpio_cfglr_pin_mode_typedef PIN6:4'
../ch32v003fun/ch32v003fun/ch32v003fun.h:767: Error: unrecognized opcode gpio_cfglr_pin_mode_typedef PIN7:4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:768: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:769: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:770: Error: unrecognized opcode
typedef union{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:771: Error: unrecognized opcode `uint32_t FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:772: Error: unrecognized opcode const struct{' ../ch32v003fun/ch32v003fun/ch32v003fun.h:773: Error: unrecognized opcode
uint32_t IDR0:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:774: Error: unrecognized opcode uint32_t IDR1:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:775: Error: unrecognized opcode
uint32_t IDR2:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:776: Error: unrecognized opcode uint32_t IDR3:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:777: Error: unrecognized opcode
uint32_t IDR4:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:778: Error: unrecognized opcode uint32_t IDR5:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:779: Error: unrecognized opcode
uint32_t IDR6:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:780: Error: unrecognized opcode uint32_t IDR7:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:781: Error: junk at end of line, first unrecognized character is
2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:782: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:783: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:784: Error: unrecognized opcode typedef union{' ../ch32v003fun/ch32v003fun/ch32v003fun.h:785: Error: unrecognized opcode
uint32_t FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:786: Error: unrecognized opcode struct {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:787: Error: unrecognized opcode
uint32_t ODR0:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:788: Error: unrecognized opcode uint32_t ODR1:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:789: Error: unrecognized opcode
uint32_t ODR2:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:790: Error: unrecognized opcode uint32_t ODR3:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:791: Error: unrecognized opcode
uint32_t ODR4:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:792: Error: unrecognized opcode uint32_t ODR5:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:793: Error: unrecognized opcode
uint32_t ODR6:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:794: Error: unrecognized opcode uint32_t ODR7:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:795: Error: junk at end of line, first unrecognized character is
2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:796: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:797: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:798: Error: unrecognized opcode typedef union{' ../ch32v003fun/ch32v003fun/ch32v003fun.h:799: Error: unrecognized opcode
uint32_t __FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:800: Error: unrecognized opcode struct {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:801: Error: unrecognized opcode
uint32_t BS0:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:802: Error: unrecognized opcode uint32_t BS1:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:803: Error: unrecognized opcode
uint32_t BS2:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:804: Error: unrecognized opcode uint32_t BS3:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:805: Error: unrecognized opcode
uint32_t BS4:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:806: Error: unrecognized opcode uint32_t BS5:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:807: Error: unrecognized opcode
uint32_t BS6:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:808: Error: unrecognized opcode uint32_t BS7:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:809: Error: junk at end of line, first unrecognized character is
8'
../ch32v003fun/ch32v003fun/ch32v003fun.h:810: Error: unrecognized opcode uint32_t BR0:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:811: Error: unrecognized opcode
uint32_t BR1:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:812: Error: unrecognized opcode uint32_t BR2:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:813: Error: unrecognized opcode
uint32_t BR3:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:814: Error: unrecognized opcode uint32_t BR4:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:815: Error: unrecognized opcode
uint32_t BR5:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:816: Error: unrecognized opcode uint32_t BR6:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:817: Error: unrecognized opcode
uint32_t BR7:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:818: Error: junk at end of line, first unrecognized character is 8' ../ch32v003fun/ch32v003fun/ch32v003fun.h:819: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:820: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:821: Error: unrecognized opcode
typedef union{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:822: Error: unrecognized opcode `uint32_t FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:823: Error: unrecognized opcode struct {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:824: Error: unrecognized opcode
uint32_t BR0:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:825: Error: unrecognized opcode uint32_t BR1:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:826: Error: unrecognized opcode
uint32_t BR2:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:827: Error: unrecognized opcode uint32_t BR3:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:828: Error: unrecognized opcode
uint32_t BR4:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:829: Error: unrecognized opcode uint32_t BR5:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:830: Error: unrecognized opcode
uint32_t BR6:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:831: Error: unrecognized opcode uint32_t BR7:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:832: Error: junk at end of line, first unrecognized character is
2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:833: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:834: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:835: Error: unrecognized opcode typedef union{' ../ch32v003fun/ch32v003fun/ch32v003fun.h:836: Error: unrecognized opcode
uint32_t FULL'
../ch32v003fun/ch32v003fun/ch32v003fun.h:837: Error: unrecognized opcode struct {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:838: Error: unrecognized opcode
uint32_t LCK0:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:839: Error: unrecognized opcode uint32_t LCK1:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:840: Error: unrecognized opcode
uint32_t LCK2:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:841: Error: unrecognized opcode uint32_t LCK3:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:842: Error: unrecognized opcode
uint32_t LCK4:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:843: Error: unrecognized opcode uint32_t LCK5:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:844: Error: unrecognized opcode
uint32_t LCK6:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:845: Error: unrecognized opcode uint32_t LCK7:1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:846: Error: unrecognized opcode
uint32_t LCKK:1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:847: Error: junk at end of line, first unrecognized character is 2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:848: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:849: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:850: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:851: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:852: Error: unrecognized opcode
__io uint32_t CFGLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:853: Error: unrecognized opcode `io uint32_t CFGHR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:854: Error: unrecognized opcode __i uint32_t INDR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:855: Error: unrecognized opcode
io uint32_t OUTDR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:856: Error: unrecognized opcode __io uint32_t BSHR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:857: Error: unrecognized opcode
io uint32_t BCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:858: Error: unrecognized opcode __io uint32_t LCKR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:859: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:866: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:867: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:869: Error: unrecognized opcode uint32_t RESERVED0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:870: Error: unrecognized opcode
io uint32_t PCFR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:871: Error: unrecognized opcode __io uint32_t EXTICR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:879: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:882: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:883: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:884: Error: unrecognized opcode `io uint16_t CTLR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:885: Error: unrecognized opcode uint16_t RESERVED0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:886: Error: unrecognized opcode
io uint16_t CTLR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:887: Error: unrecognized opcode uint16_t RESERVED1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:888: Error: unrecognized opcode
io uint16_t OADDR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:889: Error: unrecognized opcode uint16_t RESERVED2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:890: Error: unrecognized opcode
io uint16_t OADDR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:891: Error: unrecognized opcode uint16_t RESERVED3' ../ch32v003fun/ch32v003fun/ch32v003fun.h:892: Error: unrecognized opcode
io uint16_t DATAR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:893: Error: unrecognized opcode uint16_t RESERVED4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:894: Error: unrecognized opcode
io uint16_t STAR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:895: Error: unrecognized opcode uint16_t RESERVED5' ../ch32v003fun/ch32v003fun/ch32v003fun.h:896: Error: unrecognized opcode
io uint16_t STAR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:897: Error: unrecognized opcode uint16_t RESERVED6' ../ch32v003fun/ch32v003fun/ch32v003fun.h:898: Error: unrecognized opcode
io uint16_t CKCFGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:899: Error: unrecognized opcode uint16_t RESERVED7' ../ch32v003fun/ch32v003fun/ch32v003fun.h:904: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:907: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:908: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:909: Error: unrecognized opcode `io uint32_t CTLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:910: Error: unrecognized opcode __io uint32_t PSCR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:911: Error: unrecognized opcode
io uint32_t RLDR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:912: Error: unrecognized opcode __io uint32_t STATR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:913: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:916: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:917: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:918: Error: unrecognized opcode `io uint32_t CTLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:919: Error: unrecognized opcode __io uint32_t CSR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:921: Error: unrecognized opcode
io uint32_t AWUCSR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:922: Error: unrecognized opcode __io uint32_t AWUWR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:923: Error: unrecognized opcode
io uint32_t AWUPSC'
../ch32v003fun/ch32v003fun/ch32v003fun.h:925: Error: junk at end of line, first unrecognized character is }' ../ch32v003fun/ch32v003fun/ch32v003fun.h:928: Error: unrecognized opcode
typedef struct'
../ch32v003fun/ch32v003fun/ch32v003fun.h:929: Error: junk at end of line, first unrecognized character is {' ../ch32v003fun/ch32v003fun/ch32v003fun.h:930: Error: unrecognized opcode
io uint32_t CTLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:931: Error: unrecognized opcode __io uint32_t CFGR0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:932: Error: unrecognized opcode
io uint32_t INTR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:933: Error: unrecognized opcode __io uint32_t APB2PRSTR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:934: Error: unrecognized opcode
io uint32_t APB1PRSTR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:935: Error: unrecognized opcode __io uint32_t AHBPCENR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:936: Error: unrecognized opcode
io uint32_t APB2PCENR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:937: Error: unrecognized opcode __io uint32_t APB1PCENR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:939: Error: unrecognized opcode
io uint32_t RESERVED0'
../ch32v003fun/ch32v003fun/ch32v003fun.h:940: Error: unrecognized opcode __io uint32_t RSTSCKR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:949: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1006: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1007: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1008: Error: unrecognized opcode `io uint16_t CTLR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1009: Error: unrecognized opcode uint16_t RESERVED0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1010: Error: unrecognized opcode
io uint16_t CTLR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1011: Error: unrecognized opcode uint16_t RESERVED1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1012: Error: unrecognized opcode
io uint16_t STATR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1013: Error: unrecognized opcode uint16_t RESERVED2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1014: Error: unrecognized opcode
io uint16_t DATAR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1015: Error: unrecognized opcode uint16_t RESERVED3' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1016: Error: unrecognized opcode
io uint16_t CRCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1017: Error: unrecognized opcode uint16_t RESERVED4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1018: Error: unrecognized opcode
io uint16_t RCRCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1019: Error: unrecognized opcode uint16_t RESERVED5' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1020: Error: unrecognized opcode
io uint16_t TCRCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1021: Error: unrecognized opcode uint16_t RESERVED6' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1023: Error: unrecognized opcode
uint32_t RESERVED7'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1024: Error: unrecognized opcode uint32_t RESERVED8' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1032: Error: unrecognized opcode
io uint16_t HSCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1033: Error: unrecognized opcode uint16_t RESERVED9' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1035: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1038: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1039: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1040: Error: unrecognized opcode `io uint16_t CTLR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1041: Error: unrecognized opcode uint16_t RESERVED0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1042: Error: unrecognized opcode
io uint16_t CTLR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1043: Error: unrecognized opcode uint16_t RESERVED1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1044: Error: unrecognized opcode
io uint16_t SMCFGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1045: Error: unrecognized opcode uint16_t RESERVED2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1046: Error: unrecognized opcode
io uint16_t DMAINTENR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1047: Error: unrecognized opcode uint16_t RESERVED3' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1048: Error: unrecognized opcode
io uint16_t INTFR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1049: Error: unrecognized opcode uint16_t RESERVED4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1050: Error: unrecognized opcode
io uint16_t SWEVGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1051: Error: unrecognized opcode uint16_t RESERVED5' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1052: Error: unrecognized opcode
io uint16_t CHCTLR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1053: Error: unrecognized opcode uint16_t RESERVED6' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1054: Error: unrecognized opcode
io uint16_t CHCTLR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1055: Error: unrecognized opcode uint16_t RESERVED7' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1056: Error: unrecognized opcode
io uint16_t CCER'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1057: Error: unrecognized opcode uint16_t RESERVED8' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1058: Error: unrecognized opcode
io uint16_t CNT'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1059: Error: unrecognized opcode uint16_t RESERVED9' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1060: Error: unrecognized opcode
io uint16_t PSC'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1061: Error: unrecognized opcode uint16_t RESERVED10' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1062: Error: unrecognized opcode
io uint16_t ATRLR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1063: Error: unrecognized opcode uint16_t RESERVED11' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1064: Error: unrecognized opcode
io uint16_t RPTCR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1065: Error: unrecognized opcode uint16_t RESERVED12' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1067: Error: unrecognized opcode
io uint32_t CH1CVR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1068: Error: unrecognized opcode __io uint32_t CH2CVR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1069: Error: unrecognized opcode
io uint32_t CH3CVR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1070: Error: unrecognized opcode __io uint32_t CH4CVR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1071: Error: unrecognized opcode
io uint16_t BDTR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1072: Error: unrecognized opcode uint16_t RESERVED13' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1073: Error: unrecognized opcode
io uint16_t DMACFGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1074: Error: unrecognized opcode uint16_t RESERVED14' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1075: Error: unrecognized opcode
io uint16_t DMAADR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1076: Error: unrecognized opcode uint16_t RESERVED15' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1093: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1096: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1097: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1098: Error: unrecognized opcode `io uint16_t STATR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1099: Error: unrecognized opcode uint16_t RESERVED0' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1100: Error: unrecognized opcode
io uint16_t DATAR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1101: Error: unrecognized opcode uint16_t RESERVED1' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1102: Error: unrecognized opcode
io uint16_t BRR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1103: Error: unrecognized opcode uint16_t RESERVED2' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1104: Error: unrecognized opcode
io uint16_t CTLR1'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1105: Error: unrecognized opcode uint16_t RESERVED3' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1106: Error: unrecognized opcode
io uint16_t CTLR2'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1107: Error: unrecognized opcode uint16_t RESERVED4' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1108: Error: unrecognized opcode
io uint16_t CTLR3'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1109: Error: unrecognized opcode uint16_t RESERVED5' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1110: Error: unrecognized opcode
io uint16_t GPR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1111: Error: unrecognized opcode uint16_t RESERVED6' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1112: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1115: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1116: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1117: Error: unrecognized opcode __io uint32_t CTLR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1118: Error: unrecognized opcode
io uint32_t CFGR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1119: Error: unrecognized opcode __io uint32_t STATR' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1120: Error: junk at end of line, first unrecognized character is
}'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1123: Error: unrecognized opcode typedef struct' ../ch32v003fun/ch32v003fun/ch32v003fun.h:1124: Error: junk at end of line, first unrecognized character is
{'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1125: Error: unrecognized opcode `io uint32_t EXTEN_CTR'
../ch32v003fun/ch32v003fun/ch32v003fun.h:1126: Error: junk at end of line, first unrecognized character is `}'
make: *** [bootloader.elf] Error 1
C:\rv003usb\bootloader>..\ch32v003fun\minichlink\minichlink.exe -a -w bootloader.bin bootloader -B Error: Could not initialize any supported programmers Error: Could not initialize any supported programmers
C:\rv003usb\bootloader>`
@anwfeb I am not sure how you got an unpinned ch32v003fun version, but I just fixed the upstream ch32v003fun.
@xsrf I am not in a position to test the USB stuff for the next day or so can you sync to ch32v003fun master and see if everything's still kosher?
@anwfeb Saya tidak yakin bagaimana Anda mendapatkan versi ch32v003fun yang tidak dipasangi pin, tetapi saya baru saja memperbaiki ch32v003fun upstream.
i used ch32v003fun from your source code https://github.com/cnlohr/ch32v003fun/tree/f1820f2995e146ce8be0e3a94cb34a53d8238061 but maybe there are some steps missed, i don't understand. i'm just trying to follow the instructions here.
So, Windows Build works for me
C:\test>git clone "https://github.com/cnlohr/rv003usb"
Cloning into 'rv003usb'...
C:\test>cd rv003usb
C:\test\rv003usb>git submodule update --init
Submodule 'ch32v003fun' (https://github.com/cnlohr/ch32v003fun) registered for path 'ch32v003fun'
Cloning into 'C:/test/rv003usb/ch32v003fun'...
Submodule path 'ch32v003fun': checked out 'f1820f2995e146ce8be0e3a94cb34a53d8238061'
C:\test\rv003usb>cd bootloader
C:\test\rv003usb\bootloader>make_win.bat
C:\test\rv003usb\bootloader>REM Bad USB Operation on pgm-wch-linke.c ? Zadig!
C:\test\rv003usb\bootloader>del bootloader.bin
C:\test\rv003usb\bootloader\bootloader.bin konnte nicht gefunden werden
C:\test\rv003usb\bootloader>del bootloader.elf
C:\test\rv003usb\bootloader\bootloader.elf konnte nicht gefunden werden
C:\test\rv003usb\bootloader>del bootloader.hex
C:\test\rv003usb\bootloader\bootloader.hex konnte nicht gefunden werden
C:\test\rv003usb\bootloader>del bootloader.lst
C:\test\rv003usb\bootloader\bootloader.lst konnte nicht gefunden werden
C:\test\rv003usb\bootloader>del bootloader.map
C:\test\rv003usb\bootloader\bootloader.map konnte nicht gefunden werden
C:\test\rv003usb\bootloader>make build
riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -static-libgcc -march=rv32ec -mabi=ilp32e -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections -L../ch32v003fun/ch32v003fun/../misc -lgcc
riscv64-unknown-elf-size bootloader.elf
text data bss dec hex filename
1876 0 92 1968 7b0 bootloader.elf
riscv64-unknown-elf-objdump -S bootloader.elf > bootloader.lst
riscv64-unknown-elf-objdump -t bootloader.elf > bootloader.map
riscv64-unknown-elf-objcopy -O binary bootloader.elf bootloader.bin
riscv64-unknown-elf-objcopy -O ihex bootloader.elf bootloader.hex
C:\test\rv003usb\bootloader>..\ch32v003fun\minichlink\minichlink.exe -a -w bootloader.bin bootloader -B
Error: Could not initialize any supported programmers
Error: Could not initialize any supported programmers
Edit: Also works if I update ch32v003fun to the most recent commit fb6f62ead39c0755491479478b063f8f6655a57f
Will try linux shortly
Also compiles on Linux. But it's actually 8 bytes bigger on linux 🤔
andreas@debian:~/Projects/tmp$ git clone "https://github.com/cnlohr/rv003usb"
Klone nach 'rv003usb'...
andreas@debian:~/Projects/tmp$ cd rv003usb/
andreas@debian:~/Projects/tmp/rv003usb$ git submodule update --init
Submodul 'ch32v003fun' (https://github.com/cnlohr/ch32v003fun) für Pfad 'ch32v003fun' in die Konfiguration eingetragen.
Klone nach '/home/andreas/Projects/tmp/rv003usb/ch32v003fun'...
Submodul-Pfad 'ch32v003fun': 'f1820f2995e146ce8be0e3a94cb34a53d8238061' ausgecheckt
andreas@debian:~/Projects/tmp/rv003usb$ cd bootloader/
andreas@debian:~/Projects/tmp/rv003usb/bootloader$ make clean
rm -rf bootloader.elf bootloader.bin bootloader.hex bootloader.lst bootloader.map bootloader.hex || true
andreas@debian:~/Projects/tmp/rv003usb/bootloader$ make
riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -static-libgcc -march=rv32ec -mabi=ilp32e -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections -L../ch32v003fun/ch32v003fun/../misc -lgcc
riscv64-unknown-elf-size bootloader.elf
text data bss dec hex filename
1884 0 92 1976 7b8 bootloader.elf
riscv64-unknown-elf-objdump -S bootloader.elf > bootloader.lst
riscv64-unknown-elf-objdump -t bootloader.elf > bootloader.map
riscv64-unknown-elf-objcopy -O binary bootloader.elf bootloader.bin
riscv64-unknown-elf-objcopy -O ihex bootloader.elf bootloader.hex
make -C ../ch32v003fun/minichlink all
make[1]: Verzeichnis „/home/andreas/Projects/tmp/rv003usb/ch32v003fun/minichlink“ wird betreten
gcc -o minichlink minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c serial_dev.c pgm-b003fun.c minichgdb.c -lpthread -lusb-1.0 -ludev -O0 -g3 -Wall -I.
gcc -o minichlink.so minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c serial_dev.c pgm-b003fun.c minichgdb.c -lpthread -lusb-1.0 -ludev -O0 -g3 -Wall -I. -shared -fPIC
make[1]: Verzeichnis „/home/andreas/Projects/tmp/rv003usb/ch32v003fun/minichlink“ wird verlassen
../ch32v003fun/ch32v003fun/../minichlink/minichlink -a -w bootloader.bin bootloader -B
Error: Could not initialize any supported programmers
Error: Could not initialize any supported programmers
make: *** [../ch32v003fun/ch32v003fun/ch32v003fun.mk:66: cv_flash] Fehler 224
andreas@debian:~/Projects/tmp/rv003usb/bootloader$ cd ..
andreas@debian:~/Projects/tmp/rv003usb$ cd ch32v003fun/
andreas@debian:~/Projects/tmp/rv003usb/ch32v003fun$ git checkout master
Vorherige Position von HEAD war f1820f2 Merge pull request #153 from alexhorner/spi_max7219
Zu Branch 'master' gewechselt
Ihr Branch ist auf demselben Stand wie 'origin/master'.
andreas@debian:~/Projects/tmp/rv003usb/ch32v003fun$ cd ..
andreas@debian:~/Projects/tmp/rv003usb$ git status
Auf Branch master
Ihr Branch ist auf demselben Stand wie 'origin/master'.
Änderungen, die nicht zum Commit vorgemerkt sind:
(benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
(benutzen Sie "git restore <Datei>...", um die Änderungen im Arbeitsverzeichnis zu verwerfen)
geändert: ch32v003fun (neue Commits)
Unversionierte Dateien:
(benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
bootloader/bootloader.bin
bootloader/bootloader.elf
bootloader/bootloader.hex
bootloader/bootloader.lst
bootloader/bootloader.map
keine Änderungen zum Commit vorgemerkt (benutzen Sie "git add" und/oder "git commit -a")
andreas@debian:~/Projects/tmp/rv003usb$ cd bootloader/
andreas@debian:~/Projects/tmp/rv003usb/bootloader$ make clean
rm -rf bootloader.elf bootloader.bin bootloader.hex bootloader.lst bootloader.map bootloader.hex || true
andreas@debian:~/Projects/tmp/rv003usb/bootloader$ make
riscv64-unknown-elf-gcc -o bootloader.elf bootloader.c ../rv003usb/rv003usb.S -g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -march=rv32ec -mabi=ilp32e -DCH32V003=1 -static-libgcc -I/usr/include/newlib -I../ch32v003fun/ch32v003fun/../extralibs -I../ch32v003fun/ch32v003fun -nostdlib -I. -Wall -I. -I../lib -DUSE_TINY_BOOT -I../rv003usb -L../ch32v003fun/ch32v003fun/../misc -lgcc -T ch32v003fun-usb-bootloader.ld -Wl,--gc-sections
riscv64-unknown-elf-size bootloader.elf
text data bss dec hex filename
1884 0 92 1976 7b8 bootloader.elf
riscv64-unknown-elf-objdump -S bootloader.elf > bootloader.lst
riscv64-unknown-elf-objdump -t bootloader.elf > bootloader.map
riscv64-unknown-elf-objcopy -O binary bootloader.elf bootloader.bin
riscv64-unknown-elf-objcopy -O ihex bootloader.elf bootloader.hex
make -C ../ch32v003fun/minichlink all
make[1]: Verzeichnis „/home/andreas/Projects/tmp/rv003usb/ch32v003fun/minichlink“ wird betreten
gcc -o minichlink minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c serial_dev.c pgm-b003fun.c minichgdb.c -lpthread -lusb-1.0 -ludev -O0 -g3 -Wall -DCH32V003 -I.
gcc -o minichlink.so minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c ardulink.c serial_dev.c pgm-b003fun.c minichgdb.c -lpthread -lusb-1.0 -ludev -O0 -g3 -Wall -DCH32V003 -I. -shared -fPIC
make[1]: Verzeichnis „/home/andreas/Projects/tmp/rv003usb/ch32v003fun/minichlink“ wird verlassen
../ch32v003fun/ch32v003fun/../minichlink/minichlink -a -w bootloader.bin bootloader -B
Error: Could not initialize any supported programmers
Error: Could not initialize any supported programmers
make: *** [../ch32v003fun/ch32v003fun/ch32v003fun.mk:185: cv_flash] Fehler 224
andreas@debian:~/Projects/tmp/rv003usb/bootloader$
i have installed GCC10, but I don't understand what the %path% step you mean is. now I see an error like this.
run echo %path%
in your terminal to see all directories your system is looking for executables in. For me it contains C:\SysGCC\risc-v\bin
.
run where riscv64-unknown-elf-gcc
to see the full path of the executable found. For me it is C:\SysGCC\risc-v\bin\riscv64-unknown-elf-gcc.exe
@xsrf do you have time to investigate? I can believe something in the massive upheval broke when we added support for all the other chips.
i have installed GCC10, but I don't understand what the %path% step you mean is. now I see an error like this.
run
echo %path%
in your terminal to see all directories your system is looking for executables in. For me it containsC:\SysGCC\risc-v\bin
. runwhere riscv64-unknown-elf-gcc
to see the full path of the executable found. For me it isC:\SysGCC\risc-v\bin\riscv64-unknown-elf-gcc.exe
Thank you for giving me the steps, and i was successful in doing that.
Later I will also try for Mac.
then i tried to run flashing, but it showed error make: *** [busbflash] Error 2
then i tried to run flashing, but it showed error make: *** [busbflash] Error 2
Don't use the testblink. I don't know what it is and I don't know what busbflash is.
Please try demo_composite_hid
. It is tested on Windows, Linux and Mac and should work.
Btw: You need Zadig to change the driver of the Link-E flasher to be able to flash using minichlink via Link-E. You do NOT need Zadig to flash software via the USB bootloader. The USB Bootloader enumerates as HID Input Device and that's fine. Minichlink can work with that. Do not change the driver for the bootloader.
@xsrf do you have time to investigate? I can believe something in the massive upheval broke when we added support for all the other chips.
Not sure what I should investigate. For me it works on Linux and Windows with the old pinned ch32v003fun and with the latest one. I'm also not confident at all with all the headers and make files in different places.
I believe busbflash was a test to put code into the scratchpad and execute it. It makes me wonder if the USB device is not identified. It would have to be flashed with the bootloader.
@anwfeb did you flash the bootloader?
Got it compiled on Windows... but it took me a half hour to figure out that I needed to copy the contents of ch32v003fun into the ch32v003fun folder in rv003usb, how was I supposed to know to do this?
Got it compiled on Windows... but it took me a half hour to figure out that I needed to copy the contents of ch32v003fun into the ch32v003fun folder in rv003usb, how was I supposed to know to do this?
No, no. You should be using git submodules.
When checking out github repos, use --recursive
If you didn't use --recursive, you can,
git submodule update --init --recursive
how to create bin file for bootloader? please make the steps, or you can add the compiled bin bootloader file. I use CH32V003 by adding hardware components as shown in the instructions. https://github.com/cnlohr/rv003usb?tab=readme-ov-file#it-requires-very-little-hardware