Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit a637a4c

Browse files
author
mean
committed
remove warnings
1 parent 77ae1df commit a637a4c

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/command.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static bool cmd_jtag_scan(target_s *target, int argc, const char **argv);
6363
static bool cmd_swd_scan(target_s *target, int argc, const char **argv);
6464
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
6565
static bool cmd_rvswd_scan(target_s *target, int argc, const char **argv);
66+
#if CONFIG_BMDA == 0
67+
bool bmp_rvswd_scan(void);
68+
#endif
6669
#endif
6770
static bool cmd_onboard_flash_scan(target_s *target, int argc, const char **argv);
6871
static bool cmd_auto_scan(target_s *target, int argc, const char **argv);
@@ -423,6 +426,9 @@ bool cmd_auto_scan(target_s *target, int argc, const char **argv)
423426
{
424427
{jtag_scan, "JTAG"},
425428
{adiv5_swd_scan, "SWD"},
429+
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
430+
{bmp_rvswd_scan, "RVSWD"},
431+
#endif
426432
};
427433
/* clang-format on */
428434
#endif

src/platforms/common/rvswdptap.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ static bool rv_start_frame(uint32_t adr, bool wr)
112112
return true;
113113
}
114114

115-
/**
116-
* @brief read 4 status bit then send a stop bit
117-
*
118-
* @return uint32_t
119-
*/
120115
static bool rv_end_frame(uint32_t *status)
121116
{
122117
uint32_t out = 0;
@@ -133,8 +128,6 @@ static bool rv_end_frame(uint32_t *status)
133128
return out;
134129
}
135130

136-
/**
137-
*/
138131
bool rv_dm_write(uint32_t adr, uint32_t val)
139132
{
140133
rv_start_frame(adr, true);
@@ -155,14 +148,6 @@ bool rv_dm_write(uint32_t adr, uint32_t val)
155148
return true;
156149
}
157150

158-
/**
159-
* @brief
160-
*
161-
* @param adr
162-
* @param output
163-
* @return true
164-
* @return false
165-
*/
166151
bool rv_dm_read(uint32_t adr, uint32_t *output)
167152
{
168153
rv_start_frame(adr, false);
@@ -182,8 +167,8 @@ static bool rv_dm_probe(uint32_t *chip_id)
182167
{
183168
*chip_id = 0;
184169
uint32_t out = 0; // scratch
185-
//
186-
rv_dm_write(0x10, 0x80000001UL); // write DM CTROL =1
170+
// This follows exactly what the wchlink does
171+
rv_dm_write(0x10, 0x80000001UL); // write DM CTRL = 0x800000001
187172
platform_delay(1);
188173
rv_dm_write(0x10, 0x80000001UL); // write DM CTRL = 0x800000001
189174
platform_delay(1);

0 commit comments

Comments
 (0)