Skip to content

Commit

Permalink
更新资源
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed Feb 25, 2024
1 parent f7da0a0 commit 72b46c0
Show file tree
Hide file tree
Showing 218 changed files with 32,582 additions and 411 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

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

**PIO编译生成BIN而非HEX,目前无法通过WCHISPTool进行烧录**

### 关键特性

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

PIO编译的固件为BIN而非HEX,目前无法通过WCHISPTool进行烧录
Binary file modified docs/CH583DS1.PDF
Binary file not shown.
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"keywords": [
"RISC-V",
"WCH",
"DAC","SDIO","CAN","I2C","RTC","SPI",
"DAC","ADC","CAN","I2C","RTC","SPI",
"3.6V","1.8V"
]
}
178 changes: 89 additions & 89 deletions src/EVT/CH583_List.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/EVT/CH583_List_EN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ http://wch-ic.com
Directory
|
|-- CH583: Bluetooth Low Energy - 32-bit RISC-V MCU
| |-- CH583 Android OTA Update Tool V1.1: APP update tool and source of CH583 OTA related software routines
| |-- EVT: CH583 related software routines
| | |-- EXAM:
| | | |-- SRC
Expand All @@ -18,6 +17,7 @@ Directory
| | | |-- ADC: ADC sampling routines, including temperature detection, single channel detection, differential channel detection, TouchKey detection and interrupt sampling
| | | |-- FLASH: on-chip flash routines: erase/read/write Code area and DataFlash area
| | | |-- FreeRTOS: FreeRTOS porting routine
| | | |-- HarmonyOS: HarmonyOS porting routine
| | | |-- I2C: I2C routines, master/slave mode, data transceiver
| | | |-- IAP
| | | | |-- APP: APP program routine used with IAP
Expand Down
6 changes: 3 additions & 3 deletions src/EVT/EXAM/BLE/BLE_UART/APP/peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ void Peripheral_Init()
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16), &desired_max_interval);
}

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Set advertising interval
{
uint16 advInt = DEFAULT_ADVERTISING_INTERVAL;
Expand Down Expand Up @@ -238,6 +235,9 @@ void Peripheral_Init()
DevInfo_AddService(); // Device Information Service
ble_uart_add_service(on_bleuartServiceEvt);

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Init Connection Item
peripheralInitConnItem(&peripheralConnList);

Expand Down
2 changes: 1 addition & 1 deletion src/EVT/EXAM/BLE/BLE_USB/APP/app_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void app_usb_init()
*/
uint8_t USBSendData(void)
{
if(R8_UEP2_CTRL & UEP_T_RES_NAK == UEP_T_RES_NAK)
if((R8_UEP2_CTRL & MASK_UEP_T_RES) == UEP_T_RES_ACK)
{
return FAILURE;
}
Expand Down
6 changes: 3 additions & 3 deletions src/EVT/EXAM/BLE/BLE_USB/APP/peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ void Peripheral_Init()
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desired_max_interval);
}

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

{
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;

Expand Down Expand Up @@ -248,6 +245,9 @@ void Peripheral_Init()
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
ble_usb_add_service(ble_usb_ServiceEvt);

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Setup the SimpleProfile Characteristic Values
{
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};
Expand Down
19 changes: 13 additions & 6 deletions src/EVT/EXAM/BLE/BackupUpgrade_IAP/Ld/Link.ld
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ENTRY( _start )

__stack_size = 512;

PROVIDE( _stack_size = __stack_size );

MEMORY
{
FLASH (rx) : ORIGIN = 0x0006D000, LENGTH = 12K
Expand Down Expand Up @@ -121,7 +125,7 @@ SECTIONS

.dalign :
{
. = ORIGIN(RAM) + MAX(0x800 , SIZEOF(.highcode));
. = ORIGIN(RAM) + SIZEOF(.highcode);
} >RAM AT>FLASH

.dlalign :
Expand Down Expand Up @@ -167,11 +171,14 @@ SECTIONS
PROVIDE( _end = _ebss);
PROVIDE( end = . );

.stack ORIGIN(RAM)+LENGTH(RAM) :
{
. = ALIGN(4);
PROVIDE(_eusrstack = . );
} >RAM
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
{
PROVIDE( _heap_end = . );
. = ALIGN(4);
PROVIDE(_susrstack = . );
. = . + __stack_size;
PROVIDE( _eusrstack = .);
} >RAM
}


Expand Down
2 changes: 1 addition & 1 deletion src/EVT/EXAM/BLE/BackupUpgrade_IAP/Startup/startup_CH583.S
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ handle_reset:
csrw 0x804, t0

li t0, 0x1888
csrs mstatus, t0
csrw mstatus, t0
la t0, _vector_base

/* 配置向量表模式为绝对地址模式 */
Expand Down
6 changes: 3 additions & 3 deletions src/EVT/EXAM/BLE/BackupUpgrade_OTA/APP/peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ void Peripheral_Init()
//GAPRole_PeripheralRegisterAppCBs( (gapRolesParamUpdateCB_t *)&PeripheralParamUpdate );
}

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Set advertising interval
{
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
Expand Down Expand Up @@ -266,6 +263,9 @@ void Peripheral_Init()
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
OTAProfile_AddService(GATT_ALL_SERVICES);

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Setup the SimpleProfile Characteristic Values
{
uint8_t charValue1 = 1;
Expand Down
19 changes: 13 additions & 6 deletions src/EVT/EXAM/BLE/BackupUpgrade_OTA/Ld/Link.ld
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ENTRY( _start )

__stack_size = 512;

PROVIDE( _stack_size = __stack_size );

MEMORY
{
FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 216K
Expand Down Expand Up @@ -122,7 +126,7 @@ SECTIONS

.dalign :
{
. = ORIGIN(RAM) + MAX(0x800 , SIZEOF(.highcode));
. = ORIGIN(RAM) + SIZEOF(.highcode);
} >RAM AT>FLASH

.dlalign :
Expand Down Expand Up @@ -168,11 +172,14 @@ SECTIONS
PROVIDE( _end = _ebss);
PROVIDE( end = . );

.stack ORIGIN(RAM)+LENGTH(RAM) :
{
. = ALIGN(4);
PROVIDE(_eusrstack = . );
} >RAM
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
{
PROVIDE( _heap_end = . );
. = ALIGN(4);
PROVIDE(_susrstack = . );
. = . + __stack_size;
PROVIDE( _eusrstack = .);
} >RAM
}


Expand Down
2 changes: 1 addition & 1 deletion src/EVT/EXAM/BLE/BackupUpgrade_OTA/Startup/startup_CH583.S
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ handle_reset:
csrw 0x804, t0

li t0, 0x1888
csrs mstatus, t0
csrw mstatus, t0
la t0, _vector_base

/* 配置向量表模式为绝对地址模式 */
Expand Down
4 changes: 2 additions & 2 deletions src/EVT/EXAM/BLE/CentPeri/APP/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ void Central_Init()
GAP_SetParamValue(TGAP_CONN_EST_INT_MAX, DEFAULT_MAX_CONNECTION_INTERVAL);
GAP_SetParamValue(TGAP_CONN_EST_SUPERV_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT);

GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(centralDeviceName), (uint8_t *)centralDeviceName);

// Setup the GAP Bond Manager
{
uint32_t passkey = DEFAULT_PASSCODE;
Expand All @@ -267,6 +265,8 @@ void Central_Init()
GGS_AddService(GATT_ALL_SERVICES); // GAP
GATTServApp_AddService(GATT_ALL_SERVICES); // GATT attributes

GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(centralDeviceName), (uint8_t *)centralDeviceName);

// Setup a delayed profile startup
tmos_set_event(centralTaskId, START_DEVICE_EVT);
}
Expand Down
6 changes: 3 additions & 3 deletions src/EVT/EXAM/BLE/CentPeri/APP/peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ void Peripheral_Init()
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desired_max_interval);
}

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Set advertising interval
{
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
Expand Down Expand Up @@ -239,6 +236,9 @@ void Peripheral_Init()
DevInfo_AddService(); // Device Information Service
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Setup the SimpleProfile Characteristic Values
{
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};
Expand Down
6 changes: 3 additions & 3 deletions src/EVT/EXAM/BLE/CyclingSensor/APP/cyclingsensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ void CyclingSensor_Init()
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
}

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Setup the GAP Bond Manager
{
uint32_t passkey = 0; // passkey "000000"
Expand All @@ -261,6 +258,9 @@ void CyclingSensor_Init()
Cycling_AddService(GATT_ALL_SERVICES);
DevInfo_AddService();

// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName);

// Register for cycling service callback
Cycling_Register(SensorCB);

Expand Down
3 changes: 2 additions & 1 deletion src/EVT/EXAM/BLE/Direct_Test_Mode/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</option>
<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"/>
<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">
<listOptionValue builtIn="false" value="DEBUG=1"/>
<listOptionValue builtIn="false" value="DEBUG=0"/>
<listOptionValue builtIn="false" value="BLE_CALIBRATION_ENABLE=0"/>
</option>
<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"/>
Expand Down Expand Up @@ -161,4 +161,5 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>

</cproject>
Loading

0 comments on commit 72b46c0

Please sign in to comment.