Skip to content

Commit 72b46c0

Browse files
committed
更新资源
1 parent f7da0a0 commit 72b46c0

File tree

218 files changed

+32582
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+32582
-411
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
[CH583](https://www.wch.cn/products/CH583.html) 集成BLE无线通讯的32位RISC微控制器。片上集成2Mbps低功耗蓝牙BLE 通讯模块、2个全速USB主机和设备控制器及收发器、2个SPI、4个串口、ADC、触摸按键检测模块、RTC等丰富的外设资源。
1111

12+
**PIO编译生成BIN而非HEX,目前无法通过WCHISPTool进行烧录**
13+
1214
### 关键特性
1315

1416
* 20/80 MHz RISC-V4A (RV32IMAC)
@@ -44,4 +46,3 @@ CH581 则相对 CH582 再去掉了一组USB、触摸按键、I2C模块和两个
4446
* [PlatformIO](https://github.com/OS-Q/platform-ch32v)
4547
* [DAPLink](https://github.com/SoCXin/DAPLink-CH582)
4648

47-
PIO编译的固件为BIN而非HEX,目前无法通过WCHISPTool进行烧录

docs/CH583DS1.PDF

447 Bytes
Binary file not shown.

index.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"keywords": [
3737
"RISC-V",
3838
"WCH",
39-
"DAC","SDIO","CAN","I2C","RTC","SPI",
39+
"DAC","ADC","CAN","I2C","RTC","SPI",
4040
"3.6V","1.8V"
4141
]
4242
}

src/EVT/CH583_List.txt

+89-89
Large diffs are not rendered by default.

src/EVT/CH583_List_EN.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ http://wch-ic.com
77
Directory
88
|
99
|-- CH583: Bluetooth Low Energy - 32-bit RISC-V MCU
10-
| |-- CH583 Android OTA Update Tool V1.1: APP update tool and source of CH583 OTA related software routines
1110
| |-- EVT: CH583 related software routines
1211
| | |-- EXAM:
1312
| | | |-- SRC
@@ -18,6 +17,7 @@ Directory
1817
| | | |-- ADC: ADC sampling routines, including temperature detection, single channel detection, differential channel detection, TouchKey detection and interrupt sampling
1918
| | | |-- FLASH: on-chip flash routines: erase/read/write Code area and DataFlash area
2019
| | | |-- FreeRTOS: FreeRTOS porting routine
20+
| | | |-- HarmonyOS: HarmonyOS porting routine
2121
| | | |-- I2C: I2C routines, master/slave mode, data transceiver
2222
| | | |-- IAP
2323
| | | | |-- APP: APP program routine used with IAP

src/EVT/EXAM/BLE/BLE_UART/APP/peripheral.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ void Peripheral_Init()
207207
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16), &desired_max_interval);
208208
}
209209

210-
// Set the GAP Characteristics
211-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
212-
213210
// Set advertising interval
214211
{
215212
uint16 advInt = DEFAULT_ADVERTISING_INTERVAL;
@@ -238,6 +235,9 @@ void Peripheral_Init()
238235
DevInfo_AddService(); // Device Information Service
239236
ble_uart_add_service(on_bleuartServiceEvt);
240237

238+
// Set the GAP Characteristics
239+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
240+
241241
// Init Connection Item
242242
peripheralInitConnItem(&peripheralConnList);
243243

src/EVT/EXAM/BLE/BLE_USB/APP/app_usb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void app_usb_init()
105105
*/
106106
uint8_t USBSendData(void)
107107
{
108-
if(R8_UEP2_CTRL & UEP_T_RES_NAK == UEP_T_RES_NAK)
108+
if((R8_UEP2_CTRL & MASK_UEP_T_RES) == UEP_T_RES_ACK)
109109
{
110110
return FAILURE;
111111
}

src/EVT/EXAM/BLE/BLE_USB/APP/peripheral.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ void Peripheral_Init()
213213
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desired_max_interval);
214214
}
215215

216-
// Set the GAP Characteristics
217-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
218-
219216
{
220217
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
221218

@@ -248,6 +245,9 @@ void Peripheral_Init()
248245
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
249246
ble_usb_add_service(ble_usb_ServiceEvt);
250247

248+
// Set the GAP Characteristics
249+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
250+
251251
// Setup the SimpleProfile Characteristic Values
252252
{
253253
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};

src/EVT/EXAM/BLE/BackupUpgrade_IAP/Ld/Link.ld

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ENTRY( _start )
22

3+
__stack_size = 512;
4+
5+
PROVIDE( _stack_size = __stack_size );
6+
37
MEMORY
48
{
59
FLASH (rx) : ORIGIN = 0x0006D000, LENGTH = 12K
@@ -121,7 +125,7 @@ SECTIONS
121125

122126
.dalign :
123127
{
124-
. = ORIGIN(RAM) + MAX(0x800 , SIZEOF(.highcode));
128+
. = ORIGIN(RAM) + SIZEOF(.highcode);
125129
} >RAM AT>FLASH
126130

127131
.dlalign :
@@ -167,11 +171,14 @@ SECTIONS
167171
PROVIDE( _end = _ebss);
168172
PROVIDE( end = . );
169173

170-
.stack ORIGIN(RAM)+LENGTH(RAM) :
171-
{
172-
. = ALIGN(4);
173-
PROVIDE(_eusrstack = . );
174-
} >RAM
174+
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
175+
{
176+
PROVIDE( _heap_end = . );
177+
. = ALIGN(4);
178+
PROVIDE(_susrstack = . );
179+
. = . + __stack_size;
180+
PROVIDE( _eusrstack = .);
181+
} >RAM
175182
}
176183

177184

src/EVT/EXAM/BLE/BackupUpgrade_IAP/Startup/startup_CH583.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ handle_reset:
168168
csrw 0x804, t0
169169

170170
li t0, 0x1888
171-
csrs mstatus, t0
171+
csrw mstatus, t0
172172
la t0, _vector_base
173173

174174
/* 配置向量表模式为绝对地址模式 */

src/EVT/EXAM/BLE/BackupUpgrade_OTA/APP/peripheral.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ void Peripheral_Init()
234234
//GAPRole_PeripheralRegisterAppCBs( (gapRolesParamUpdateCB_t *)&PeripheralParamUpdate );
235235
}
236236

237-
// Set the GAP Characteristics
238-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
239-
240237
// Set advertising interval
241238
{
242239
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
@@ -266,6 +263,9 @@ void Peripheral_Init()
266263
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
267264
OTAProfile_AddService(GATT_ALL_SERVICES);
268265

266+
// Set the GAP Characteristics
267+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
268+
269269
// Setup the SimpleProfile Characteristic Values
270270
{
271271
uint8_t charValue1 = 1;

src/EVT/EXAM/BLE/BackupUpgrade_OTA/Ld/Link.ld

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ENTRY( _start )
22

3+
__stack_size = 512;
4+
5+
PROVIDE( _stack_size = __stack_size );
6+
37
MEMORY
48
{
59
FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 216K
@@ -122,7 +126,7 @@ SECTIONS
122126

123127
.dalign :
124128
{
125-
. = ORIGIN(RAM) + MAX(0x800 , SIZEOF(.highcode));
129+
. = ORIGIN(RAM) + SIZEOF(.highcode);
126130
} >RAM AT>FLASH
127131

128132
.dlalign :
@@ -168,11 +172,14 @@ SECTIONS
168172
PROVIDE( _end = _ebss);
169173
PROVIDE( end = . );
170174

171-
.stack ORIGIN(RAM)+LENGTH(RAM) :
172-
{
173-
. = ALIGN(4);
174-
PROVIDE(_eusrstack = . );
175-
} >RAM
175+
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
176+
{
177+
PROVIDE( _heap_end = . );
178+
. = ALIGN(4);
179+
PROVIDE(_susrstack = . );
180+
. = . + __stack_size;
181+
PROVIDE( _eusrstack = .);
182+
} >RAM
176183
}
177184

178185

src/EVT/EXAM/BLE/BackupUpgrade_OTA/Startup/startup_CH583.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ handle_reset:
168168
csrw 0x804, t0
169169

170170
li t0, 0x1888
171-
csrs mstatus, t0
171+
csrw mstatus, t0
172172
la t0, _vector_base
173173

174174
/* 配置向量表模式为绝对地址模式 */

src/EVT/EXAM/BLE/CentPeri/APP/central.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ void Central_Init()
242242
GAP_SetParamValue(TGAP_CONN_EST_INT_MAX, DEFAULT_MAX_CONNECTION_INTERVAL);
243243
GAP_SetParamValue(TGAP_CONN_EST_SUPERV_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT);
244244

245-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(centralDeviceName), (uint8_t *)centralDeviceName);
246-
247245
// Setup the GAP Bond Manager
248246
{
249247
uint32_t passkey = DEFAULT_PASSCODE;
@@ -267,6 +265,8 @@ void Central_Init()
267265
GGS_AddService(GATT_ALL_SERVICES); // GAP
268266
GATTServApp_AddService(GATT_ALL_SERVICES); // GATT attributes
269267

268+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(centralDeviceName), (uint8_t *)centralDeviceName);
269+
270270
// Setup a delayed profile startup
271271
tmos_set_event(centralTaskId, START_DEVICE_EVT);
272272
}

src/EVT/EXAM/BLE/CentPeri/APP/peripheral.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ void Peripheral_Init()
208208
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desired_max_interval);
209209
}
210210

211-
// Set the GAP Characteristics
212-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
213-
214211
// Set advertising interval
215212
{
216213
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
@@ -239,6 +236,9 @@ void Peripheral_Init()
239236
DevInfo_AddService(); // Device Information Service
240237
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
241238

239+
// Set the GAP Characteristics
240+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
241+
242242
// Setup the SimpleProfile Characteristic Values
243243
{
244244
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};

src/EVT/EXAM/BLE/CyclingSensor/APP/cyclingsensor.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,6 @@ void CyclingSensor_Init()
235235
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
236236
}
237237

238-
// Set the GAP Characteristics
239-
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
240-
241238
// Setup the GAP Bond Manager
242239
{
243240
uint32_t passkey = 0; // passkey "000000"
@@ -261,6 +258,9 @@ void CyclingSensor_Init()
261258
Cycling_AddService(GATT_ALL_SERVICES);
262259
DevInfo_AddService();
263260

261+
// Set the GAP Characteristics
262+
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);
263+
264264
// Register for cycling service callback
265265
Cycling_Register(SensorCB);
266266

src/EVT/EXAM/BLE/Direct_Test_Mode/.cproject

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</option>
6767
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.2020844713" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.gnu99" valueType="enumerated"/>
6868
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.177116515" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
69-
<listOptionValue builtIn="false" value="DEBUG=1"/>
69+
<listOptionValue builtIn="false" value="DEBUG=0"/>
7070
<listOptionValue builtIn="false" value="BLE_CALIBRATION_ENABLE=0"/>
7171
</option>
7272
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files.288896968" name="Include files (-include)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
@@ -161,4 +161,5 @@
161161
</storageModule>
162162
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
163163
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
164+
164165
</cproject>

0 commit comments

Comments
 (0)