Skip to content

Commit

Permalink
Working RVSWD interface for vxxx xxxx chips.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlohr committed Nov 10, 2024
1 parent f7cf83f commit 10b06b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions examples_v30x/debugprintfdemo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ TARGET_MCU_PACKAGE:=CH32V305RBT6

include ../../ch32v003fun/ch32v003fun.mk

monitor :
$(MINICHLINK)/minichlink -aT

flash : cv_flash
clean : cv_clean

10 changes: 5 additions & 5 deletions minichlink/minichlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ int DefaultDetermineChipType( void * dev )
{
// Only known processor with this signature is a CH32V003.
iss->target_chip_type = CHIP_CH32V003;
fprintf( stderr, "Autodetected an ch32x003\n" );
fprintf( stderr, "Autodetected a ch32x003\n" );
}
else if( data0offset == 0xe0000380 )
{
Expand All @@ -958,19 +958,19 @@ int DefaultDetermineChipType( void * dev )
switch( chip_type )
{
case 0x103:
fprintf( stderr, "Autodetected an ch32v10x\n" );
fprintf( stderr, "Autodetected a ch32v10x\n" );
iss->target_chip_type = CHIP_CH32V10x;
break;
case 0x035: case 0x033:
fprintf( stderr, "Autodetected an ch32x03x\n" );
fprintf( stderr, "Autodetected a ch32x03x\n" );
iss->target_chip_type = CHIP_CH32X03x;
break;
case 0x203: case 0x205: case 0x208:
fprintf( stderr, "Autodetected an ch32v20x\n" );
fprintf( stderr, "Autodetected a ch32v20x\n" );
iss->target_chip_type = CHIP_CH32V20x;
break;
case 0x303: case 0x305: case 0x307:
fprintf( stderr, "Autodetected an ch32v30x\n" );
fprintf( stderr, "Autodetected a ch32v30x\n" );
iss->target_chip_type = CHIP_CH32V30x;
break;
}
Expand Down
3 changes: 1 addition & 2 deletions minichlink/pgm-esp32s2-ch32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ int ESPReadWord( void * dev, uint32_t address_to_read, uint32_t * data )
}
int tail = eps->replylen-5;
memcpy( data, eps->reply + tail + 1, 4 );

return eps->reply[tail];
return (int8_t)eps->reply[tail];
}

int ESPWriteWord( void * dev, uint32_t address_to_write, uint32_t data )
Expand Down

0 comments on commit 10b06b9

Please sign in to comment.