Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed Jul 17, 2021
1 parent 92822d8 commit 7ae2046
Show file tree
Hide file tree
Showing 239 changed files with 45,510 additions and 1,687 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@

### [选型建议](https://github.com/SoCXin)

[CH579](https://github.com/SoCXin/CH579)
[CH579](https://github.com/SoCXin/CH579) 是一款非常有特色的SoC,在紧凑的封装内集成了以太网所有功能,同时还具有无线通信。

* QFN48(5X5)
* QFN28(4X4)

[![sites](docs/diff.png)](http://www.wch.cn/products/CH579.html)

#### 相关开发板

[![sites](docs/B.png)](https://item.taobao.com/item.htm?spm=a230r.1.14.18.a51ac05bwhVsnp&id=608342676773&ns=1&abbucket=19#detail)

### [探索芯世界 www.SoC.xin](http://www.SoC.Xin)
Binary file added docs/B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"type": "git",
"url": "https://github.com/SoCXin/CH579.git"
},
"series":["CH579M","CH579F","CH578","CH577"],
"series":["CH579","CH578","CH577"],
"package":["QFN28","QFN48"],
"peripheral": ["TIM","ADC","USB","UART","SPI","LDO","PWM"],
"price":[4,8],
Expand All @@ -45,7 +45,7 @@
"Cortex-M",
"WCH",
"CH579",
"DAC","SDIO","CAN","I2C","RTC","SPI",
"ETH","SDIO","BLE","I2C","RTC","SPI",
"3.6V","1.8V"
]
}
36 changes: 18 additions & 18 deletions src/CH579_List.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

�Ͼ��ߺ�΢���ӹɷ����޹�˾ 2021.02
�Ͼ��ߺ�΢���ӹɷ����޹�˾ 2021.05
���������뵽���ǵ���վ�ϲ�ѯ
http://wch.cn


�ļ�Ŀ¼
|
|-- CH579: �͹������� - 32λCortex-M0�ں�΢������
| |-- CH579��׿OTA��������V1.1: CH579 OTA�����������APP�������߼�Դ��
| |-- ��׿OTA����: CH579 OTA�����������APP�������߼�Դ��,OTA����˵���ĵ����ϲ�����
| |-- EVT: CH579�������CH579�������
| | |-- PUB:
| | | |-- CH579������˵����.pdf: CH579������˵�������̴���˵��
Expand Down Expand Up @@ -60,19 +60,6 @@ http://wch.cn
| | | | |-- UDP_Server��UDP_Server���̣��������Թ㲥IP��ָ���˿ڱ��ģ��������ܵ����ĵĵ�ַ��ΪĿ���ַ���ͱ���
| | | | |-- CH57xNETЭ��ջ��˵��.pdf����̫��Э��ջ��˵��
| | | |-- BLE
| | | | |-- BLE_MESH
| | | | | |-- Ali_Genie_Light����è��������̣��ϵ��Ҷ��Ѱ����ӣ��������ܵ�
| | | | | |-- Generic_Model_With_Proxy��ͨ��ģ�����̣�֧��PB-ADV��PB-GATT��֧�ִ���
| | | | | |-- Generic_Model_With_Proxy_Only��ͨ��ģ�����̣�֧��PB-GATT��֧�ִ���
| | | | | |-- Generic_OnOff_Models��ͨ��ģ�����̣�֧��PB-ADV��֧��ת��
| | | | | |-- Self_Provision_Friend�����������ѽڵ㣬����͹��Ľڵ���ʹ��
| | | | | |-- Self_Provision_Low_Power_Node���������͹��Ľڵ㣬�������ѽڵ���ʹ��
| | | | | |-- Self_Provision_Generic_OnOff_Publish�����������̣�ͨ�ÿ���ģ�����ڷ������̣�
| | | | | |-- Self_Provision_Generic_OnOff_Subscription�����������̣�ͨ�ÿ���ģ�Ͷ�������
| | | | | |-- Self_Provisioner�����������̣����豸ͨ������������������Generic_OnOff_Models���ʹ��
| | | | | |-- Common��ͨ�������ļ�
| | | | | |-- LIB��BLE MeshЭ��ջ���ļ�����ͷ�ļ�
| | | | | |-- ��֤��֤�飺����Mesh BQB��֤֤���Լ�������è����֤��
| | | | |-- Broadcaster���㲥�߽�ɫ���̣����ڹ㲥̬һֱ�㲥
| | | | |-- CyclingSensor�����д��������̣�����������ʱ�ϴ��ٶȺ�̤Ƶ
| | | | |-- CentPeri������һ�����̣��������������̺ʹӻ����̵Ĺ���ͬʱ����
Expand All @@ -88,9 +75,22 @@ http://wch.cn
| | | | |-- Observer���۲��߽�ɫ���̣���ʱɨ�裬���ɨ������Ϊ�գ����ӡɨ�赽�Ĺ㲥��ַ
| | | | |-- DirectTest��ֱ�Ӳ������̣�����ָ��ͨ��Ƶ���������ݰ�
| | | | |-- RF_PHY���DZ�׼�����շ�����
| | | | |-- OTA��������������
| | | | |-- OTA_OnlyUpdateApp���̶���������������,ֻ�����û�����
| | | | |-- Peripheral_OnlyUpdateApp���̶������������û���������,��OTA_OnlyUpdateApp���ʹ�ã����úϳɹ��߽�IAP�ļ����û��ļ������ļ��ϳɵ���BIN�ļ�����ISP������¼��
| | | | |-- BackupUpgrade_IAP��������������IAP���̣���⵱ǰ�����־���ж��Ƿ���˱��������뵽�û����������û�������
| | | | |-- BackupUpgrade_OTA���������������û����̣�����ӻ����̻���������OTA���ܣ��ɽ������̼����浽����������תIAP�����������
| | | | |-- OnlyUpdateApp_IAP���̶�����������IAP���̣��߱�OTA���ܣ����������̼�����û��������������
| | | | |-- OnlyUpdateApp_Peripheral���̶������������û����̣�����ӻ����̻�����������תIAP������к��������Ĺ���
| | | | |-- MESH
| | | | | |-- adv_ali_light����è��������̣���ͨ����è�����Ҷ��������豸�����ƿ���״̬��Ĭ��ֻ�п������ԣ����������������ԣ����ȣ��������¶ȵȣ�����Ҫ���и��ݰ����Ʋ�Ʒ���õ������������Ӷ�Ӧ���������Լ�״̬�ϱ�������
| | | | | |-- adv_ali_light_add_lightness��MESHͨ�������������̡���è��������̵Ļ����ϣ��������������ԣ����ڶ���ԭ��è��������̣�������Ϥ��������MESHͨ�����Եķ�����
| | | | | |-- adv_ali_light_add_windspeed����è���������������̡���è��������̵Ļ����ϣ������˷������ԣ����ڶ���ԭ��è��������̣�������Ϥ����������è�������Եķ�����
| | | | | |-- adv_ali_light_with_peripheral����è��������̵Ļ����ϣ�֧���ֻ�BLE�����������ӿ��ơ�
| | | | | |-- adv_proxy�������ڵ����̣���ͨ��PV_GATT�㣨BLE���ӣ�����������
| | | | | |-- adv_vendor�������Զ���ģ�����̣����self_provisioner_vendorʹ�ã�֧����Ӧ�������Ӧ��͸������ͨ�����ԣ������ⶨͨ��Э�顣
| | | | | |-- adv_vendor_friend�������Զ���ģ�����̵Ļ����ϣ�֧�����ѽڵ㹦��
| | | | | |-- adv_vendor_low_power�������Զ���ģ�����̵Ļ����ϣ�֧�ֵ͹��Ľڵ㹦�ܣ��������ѽڵ����ʹ��
| | | | | |-- self_provisioner_vendor�������Զ���ģ�����������������̣����adv_vendorʹ�ã��Զ�������Χδ�����豸���������������mesh���磬Ĭ��֧������6���豸��Ĭ�������豸��1��APPKEY,������Ӧ�������Ӧ��͸���������豸��1�����ĵ�ַ������Ⱥ����Ӧ����Ϣ
| | | | | |-- self_provisioner_vendor_with_peripheral�������Զ���ģ�����������������̵Ļ����ϣ�֧���ֻ�BLE�����������ӿ��ƣ���ת�ֻ���mesh�����ͨ�ţ��������ⶨͨ��Э��ʵ���ֻ�����mesh�����������豸��
| | | | | |-- MESH_LIB��MESHЭ��ջ���ļ�����ͷ�ļ�
| | | | |-- HAL�����̹��õ�Ӳ������ļ�
| | | | |-- LIB��BLEЭ��ջ���ļ�����ͷ�ļ�
| | | | |-- CH57xBLEЭ��ջ��˵��.pdf������Э��ջ��˵��
Expand Down
4 changes: 2 additions & 2 deletions src/EXAM/ADC/CH57x.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<TargetName>CH57x</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060960::V5.06 update 7 (build 960)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
Expand Down Expand Up @@ -53,7 +53,7 @@
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>0</DebugInformation>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\list\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
Expand Down
118 changes: 118 additions & 0 deletions src/EXAM/BLE/BackupUpgrade_IAP/APP/include/ota.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : ota.h
* Author : WCH
* Version : V1.10
* Date : 2018/12/14
* Description : oad相关配置定义
*******************************************************************************/


/******************************************************************************/
#ifndef __OTA_H
#define __OTA_H


/* ------------------------------------------------------------------------------------------------
* OTA FLASH
* ------------------------------------------------------------------------------------------------
*/

/* 整个用户code区分成三块,120K,120K,10K,下面分别叫做imageA(用户代码),imageB (备份代码)和imageIAP*/

/* FLASH定义 */
#define FLASH_BLOCK_SIZE 512
#define IMAGE_SIZE 120*1024

/* imageA定义 */
#define IMAGE_A_FLAG 0x01
#define IMAGE_A_START_ADD 0
#define IMAGE_A_SIZE IMAGE_SIZE
#define IMAGE_A_ENTRY_ADD (IMAGE_A_START_ADD + 4)

/* imageB定义 */
#define IMAGE_B_FLAG 0x02
#define IMAGE_B_START_ADD (IMAGE_A_START_ADD + IMAGE_SIZE)
#define IMAGE_B_SIZE IMAGE_SIZE
#define IMAGE_B_ENTRY_ADD (IMAGE_B_START_ADD + 4)

/* imageIAP定义 */
#define IMAGE_IAP_FLAG 0x03
#define IMAGE_IAP_START_ADD (IMAGE_B_START_ADD + IMAGE_SIZE)
#define IMAGE_IAP_SIZE 10*1024
#define IMAGE_IAP_ENTRY_ADD (IMAGE_IAP_START_ADD + 4)

/* IAP定义 */
/* 以下为IAP下载命令定义 */
#define CMD_IAP_PROM 0x80 // IAP编程命令
#define CMD_IAP_ERASE 0x81 // IAP擦除命令
#define CMD_IAP_VERIFY 0x82 // IAP校验命令
#define CMD_IAP_END 0x83 // IAP结束标志
#define CMD_IAP_INFO 0x84 // IAP获取设备信息


/* 数据帧长度定义 */
#define IAP_LEN 20

/* 存放在DataFlash地址,不能占用蓝牙的位置 */
#define OTA_DATAFLASH_ADD 0x0003E800


/* 存放在DataFlash里的OTA信息 */
typedef struct
{
unsigned char ImageFlag; //记录的当前的image标志
unsigned char Revd[3];
}OTADataFlashInfo_t;

/* OTA IAP通讯协议定义 */
/* 地址使用4倍偏移 */
typedef union
{
struct
{
unsigned char cmd; /* 命令码 0x81 */
unsigned char len; /* 后续数据长度 */
unsigned char addr[2]; /* 擦除地址 */
unsigned char block_num[2]; /* 擦除块数 */

} erase; /* 擦除命令 */
struct
{
unsigned char cmd; /* 命令码 0x83 */
unsigned char len; /* 后续数据长度 */
unsigned char status[2]; /* 两字节状态,保留 */
} end; /* 结束命令 */
struct
{
unsigned char cmd; /* 命令码 0x82 */
unsigned char len; /* 后续数据长度 */
unsigned char addr[2]; /* 校验地址 */
unsigned char buf[IAP_LEN-4]; /* 校验数据 */
} verify; /* 校验命令 */
struct
{
unsigned char cmd; /* 命令码 0x80 */
unsigned char len; /* 后续数据长度 */
unsigned char addr[2]; /* 地址 */
unsigned char buf[IAP_LEN-4]; /* 后续数据 */
} program; /* 编程命令 */
struct
{
unsigned char cmd; /* 命令码 0x84 */
unsigned char len; /* 后续数据长度 */
unsigned char buf[IAP_LEN-2]; /* 后续数据 */
} info; /* 编程命令 */
struct
{
unsigned char buf[IAP_LEN]; /* 接收数据包*/
} other;
} OTA_IAP_CMD_t;


/* 记录当前的Image */
extern unsigned char CurrImageFlag;


#endif

/******************************** endfile @ oad ******************************/
59 changes: 59 additions & 0 deletions src/EXAM/BLE/BackupUpgrade_IAP/APP/include/peripheral.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : peripheral.h
* Author : WCH
* Version : V1.0
* Date : 2018/12/11
* Description :
*******************************************************************************/

#ifndef PERIPHERAL_H
#define PERIPHERAL_H

#ifdef __cplusplus
extern "C"
{
#endif

/*********************************************************************
* INCLUDES
*/

/*********************************************************************
* CONSTANTS
*/


// Simple BLE Peripheral Task Events
#define SBP_START_DEVICE_EVT 0x0001
#define SBP_PERIODIC_EVT 0x0002
#define OTA_FLASH_ERASE_EVT 0x0004 //OTA Flash²Á³ýÈÎÎñ



/*********************************************************************
* MACROS
*/

/*********************************************************************
* FUNCTIONS
*/

/*
* Task Initialization for the BLE Application
*/
extern void Peripheral_Init( void );

/*
* Task Event Processor for the BLE Application
*/
extern uint16 Peripheral_ProcessEvent( uint8 task_id, uint16 events );

/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif
Loading

0 comments on commit 7ae2046

Please sign in to comment.