P.Max浓缩磷脂软胶囊的作用胶囊怎么代理?

【经验分享】使用P&E Cyclone Max 烧写Kinetis芯片步骤 - ARM Cortex-M系列产品 - 恩智浦技术社区
后使用快捷导航没有帐号?
查看: 692|回复: 6
【经验分享】使用P&E Cyclone Max 烧写Kinetis芯片步骤
该用户从未签到主题帖子积分
【经验分享】使用P&E Cyclone Max 烧写Kinetis芯片步骤一 文档说明& && &通常情况下,对kinetis芯片的烧录我们使用仿真器去完成,比如P&E Multilink, JLINK, 或者板载的opensda等等,不过不管使用什么仿真器,都离不开PC。所以,如果需要脱机烧录,就需要专门的编程器去完成,本文主要讲解P&E的CycloneMAX如何实现脱机烧写kinetis芯片, 顺便也讲解下连接PC情况下的仿真烧录。& && &本文以FRDM-K22F120M为目标板,配套KSDK的代码生成的.srec文件作为烧录文件,代码源文件路径:SDK_2.1_FRDM-K22F\boards\frdmk22f\driver_examples\gpio\led_output
60.jpg (58.64 KB, 下载次数: 1)
14:41 上传
更多详细内容,请查看附件文档:
(1.16 MB, 下载次数: 37)
14:41 上传
点击文件名下载附件
该用户从未签到主题帖子积分
小小经验,希望对大家有所帮助。
TA的每日心情奋斗 17:21签到天数: 16 天[LV.4]偶尔看看III主题帖子积分
中级会员, 积分 251, 距离下一级还需 249 积分
中级会员, 积分 251, 距离下一级还需 249 积分
感谢分享,之前用过cyclone pro,企业版的license支持串口直接发送指令,无需调用dll 吧,想实现一台电脑控制多个target异步刷写,不知道行不行
该用户从未签到主题帖子积分
中级会员, 积分 304, 距离下一级还需 196 积分
中级会员, 积分 304, 距离下一级还需 196 积分
小小经验,希望对大家有所帮助。
请问CYCLONE pro能烧写KEA系列芯片吗?能否提供一个这个工具的接口定义说明书?
该用户从未签到主题帖子积分
请问CYCLONE pro能烧写KEA系列芯片吗?能否提供一个这个工具的接口定义说明书? ...
该用户从未签到主题帖子积分
中级会员, 积分 304, 距离下一级还需 196 积分
中级会员, 积分 304, 距离下一级还需 196 积分
发表于 7&天前
请问有cyclone pro的16脚接口名称分别是什么?之前用的PE都是用20脚的烧写ARM内核。cyclone pro没有20脚接口。求助。。。。
该用户从未签到主题帖子积分
发表于 6&天前
请问有cyclone pro的16脚接口名称分别是什么?之前用的PE都是用20脚的烧写ARM内核。cyclone pro没有20脚 ...
请参考官方文档介绍:
站长推荐 /2
社区开始送板子啦~如果大家手头缺少一个仿真器,可是试着申请呀~一般都会通过的~不过数量有限,大家看到抓紧时间咯~
树莓派3B+、闪迪120g固态硬盘、机械键盘、京东券……超多福利大放送。4月10日14:00,恩智浦技术日在线直播|数字网络/工业物联网专场等你来嗨!赶紧来报名占座吧~
Tel: 3-8069
版权所有@苏州灵动帧格网络科技有限公司
Powered by  这次的Proxy lab 是要求实现一个简单的web 代理。与此相关的章节是网络编程和并发编程,其实之前零零星星的看过一些讲HTTP协议的书,但是对于套接字这些都是一知半解,跟着课堂学完这两章突然柳暗花明,再看一些更详细更深入的书,像《HTTP权威指南》,《计算机网络-自顶向下的方法》就明白的多了。
  下面就说一下这次lab,共有3个部分,第一部分是实现一个单线程代理,接收客户端请求,连接服务器然后转发。第二部分是实现并发,为每一个请求新建一个进程。第三部分是最有趣的,为每个请求建立独立的进程之后,该怎么共享进程之间的数据,也就是缓存呢?这里用到了书上介绍的写者-读者模型。源代码如下(已经通过了测试)。
6 #include "csapp.h"
8 #define MAX_CACHE_SIZE 1049000
9 #define MAX_OBJECT_SIZE 102400
11 /* argument for each thread */
12 struct arg {
/* client socked */
/* the time of current request */
16 /* cache block */
17 struct cache_block {
char data[MAX_OBJECT_SIZE];
/* store the response head and body */
/* 模仿书上P673,使用写者-读者模型解决并发冲突 */
/* the time of request */
sem_t t_w;
char url[300];
/* the url of request */
sem_t url_
sem_t url_w;
34 /* total 10 cache block */
35 struct cache_block cache[10];
37 /* init the block */
38 void cache_erase(int index);
40 /* because of concurrency, all operation on cache use following 4 function */
41 /* write data, url and turn on cache[index] */
42 void cache_write(int index, char *url,char *data, int turn);
43 /* read data on cache[index] */
44 void cache_data_read(int index, char *dst, int turn);
45 /* read url on cache[index] */
46 void cache_url_read(int index,char *dst);
47 /* read turn on cache[index] */
48 int cache_turn_read(int index);
50 /* thread for each request */
51 void *thread(void *connfdp);
53 /* parse the request line */
54 void parse_url(char *url, char *hostname, char *query_path, int *port);
56 /* connect to server, if failed return -1 */
57 int connect_server(char *hostname,int port,char *query_path);
60 int main(int argc,char **argv)
Signal(SIGPIPE, SIG_IGN);
struct sockaddr_
int port,listenfd,
int turn=1;
struct arg *p;
/* check port */
if(argc!=2) {
fprintf(stderr, "usage: %s &port&\n", argv[0]);
// init 10 cache blocks
for(i=0;i&10;i++)
cache_erase(i);
port=atoi(argv[1]);
listenfd=Open_listenfd(port);
clientlen=sizeof(clientaddr);
while(1) {
p=(int*)Malloc(sizeof(struct arg));
p-&connfd=Accept(listenfd,(SA*)&clientaddr,&clientlen);
p-&turn =turn++;
/* create thread */
Pthread_create(&tid,NULL,thread,(void *)p);
94 /* parse request url */
95 void parse_url(char *ur, char *hostname, char *query_path, int *port)
char url[100];
url[0]='\0';
strcat(url,ur);
hostname[0]=query_path[0]='\0';
char *p=strstr(url,"//");
/* skip "http://" and "https://" */
if(p!=NULL) {
char *q=strstr(p,":");
/* read ":&port&" and "/index.html" */
if(q!=NULL) {
sscanf(p,"%s",hostname);
sscanf(q+1,"%d%s",port,query_path);
q=strstr(p,"/");
if(q!=NULL) {
sscanf(p,"%s",hostname);
sscanf(q,"%s",query_path);
sscanf(p,"%s",hostname);
/* the default path */
if(strlen(query_path)&=1)
strcpy(query_path,"/index.html");
131 /* connect to server and return socket fd */
132 int connect_server(char *hostname,int port,char *query_path)
static const char *user_agent = "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/ Firefox/10.0.3\r\n";
static const char *accept_str= "Accept: text/html,application/xhtml+xml,application/q=0.9,*/*;q=0.8\r\nAccept-Encoding: gzip, deflate\r\n";
static const char *connection = "Connection: close\r\nProxy-Connection: close\r\n";
char buf[MAXLINE];
/* connect to server */
int proxy_
proxy_clientfd=open_clientfd(hostname,port);
/* if failed return */
if(proxy_clientfd&0)
return proxy_
/* write request to server */
sprintf(buf,"GET %s HTTP/1.0\r\n",query_path);
Rio_writen(proxy_clientfd,buf,strlen(buf));
sprintf(buf,"Host: %s\r\n",hostname);
Rio_writen(proxy_clientfd,buf,strlen(buf));
Rio_writen(proxy_clientfd,user_agent,strlen(user_agent));
Rio_writen(proxy_clientfd,accept_str,strlen(accept_str));
Rio_writen(proxy_clientfd,connection,strlen(connection));
Rio_writen(proxy_clientfd,"\r\n",strlen("\r\n"));
return proxy_
* if there is a finished cache, read and response.
* else connect to server
163 void *thread(void *p)
Pthread_detach(pthread_self());
int connfd=((struct arg*)p)-&connfd,turn=((struct arg*)p)-&
char buf[MAXLINE];
char method[MAXLINE],version[MAXLINE],url[MAXLINE];
char host[MAXLINE],query[MAXLINE];
char url_tmp[300],*data_
int index,port,content_
/* read request line */
rio_readinitb(&rio,connfd);
rio_readlineb(&rio,buf,MAXLINE);
sscanf(buf,"%s %s %s",method,url,version);
if(strcasecmp(method,"GET")) {
/* ignore */
printf("Not GET\r\n");
Close(connfd);
return NULL;
/* ignore client request */
rio_readlineb(&rio,buf,MAXLINE-1);
}while(strcmp(buf,"\r\n"));
/* find cache block */
for(index=0;index&10;index++) {
cache_url_read(index,url_tmp);
/* the block'url is same as current url */
if(!strcmp(url,url_tmp))
data_tmp=(char*)Malloc(MAX_OBJECT_SIZE);
data_tmp[0]='\0';
if(index &10) { /* if have cached */
cache_data_read(index,data_tmp,turn);
rio_writen(connfd,data_tmp,strlen(data_tmp));
Close(connfd);
free(data_tmp);
return NULL;
/* connect to server */
parse_url(url,host,query,&port);
if((serverfd=connect_server(host,port,query))&0) {
/* connect to server failed, return */
free(data_tmp);
Close(connfd);
return NULL;
rio_readinitb(&rio,serverfd);
content_length=0;
/* read response head line */
int t=rio_readlineb(&rio,buf,MAXLINE-1);
strncat(data_tmp,buf,t);
if(strstr(buf,"Content-length")!=NULL)
sscanf(buf,"Content-length: %d\r\n",&content_length);
rio_writen(connfd,buf,t);
}while(strcmp(buf,"\r\n"));
/* read response body */
/* response is small enough to cache */
if(content_length+strlen(data_tmp)&MAX_OBJECT_SIZE) {
while(content_length&0) {
int t= rio_readnb(&rio,buf,(content_length&MAXLINE-1)?content_length:MAXLINE-1);
content_length-=t;
strncat(data_tmp,buf,t);
rio_writen(connfd,buf,t);
/* least-recently-used */
for(i=1;i&10;i++) {
if(cache_turn_read(i)&cache_turn_read(index)) {
/* cache write */
cache_write(index,url,data_tmp,turn);
/* ignore store and write to client */
while(content_length&0) {
int t= rio_readnb(&rio,buf,(content_length&MAXLINE-1)?content_length:MAXLINE-1);
content_length-=t;
rio_writen(connfd,buf,t);
Close(connfd);
Close(serverfd);
free(data_tmp);
return NULL;
272 void cache_erase(int index)
/* init all var */
cache[index].turn=0;
cache[index].url[0]='\0';
cache[index].data[0]='\0';
Sem_init(&cache[index].t_mutex,0,1);
Sem_init(&cache[index].t_w,0,1);
cache[index].t_readcnt=0;
Sem_init(&cache[index].url_mutex,0,1);
Sem_init(&cache[index].url_w,0,1);
cache[index].url_readcnt=0;
Sem_init(&cache[index].mutex,0,1);
Sem_init(&cache[index].w,0,1);
cache[index].readcnt=0;
289 void cache_write(int index,char *url, char *data, int turn)
/* semaphore */
P(&cache[index].url_w);
P(&cache[index].w);
P(&cache[index].t_w);
/* begin write operation */
cache[index].turn=
strcpy(cache[index].data,data);
strcpy(cache[index].url,url);
/* end write operation */
/* semaphore */
V(&cache[index].t_w);
V(&cache[index].w);
V(&cache[index].url_w);
308 void cache_data_read(int index, char *dst, int turn)
/* semaphore */
P(&cache[index].mutex);
cache[index].readcnt++;
if(cache[index].readcnt==1)
P(&cache[index].w);
V(&cache[index].mutex);
P(&cache[index].t_w);
/* begin read operation */
cache[index].turn=
strcpy(dst,cache[index].data);
/* end read operation */
/* semphore */
V(&cache[index].t_w);
P(&cache[index].mutex);
cache[index].readcnt--;
if(cache[index].readcnt==0)
V(&cache[index].w);
V(&cache[index].mutex);
334 void cache_url_read(int index,char *dst)
/* semaphore */
P(&cache[index].url_mutex);
cache[index].url_readcnt++;
if(cache[index].url_readcnt==1)
P(&cache[index].url_w);
V(&cache[index].url_mutex);
/* begin read operation */
strcpy(dst,cache[index].url);
/* end read operation */
/* semphore */
P(&cache[index].url_mutex);
cache[index].url_readcnt--;
if(cache[index].url_readcnt==0)
V(&cache[index].url_w);
V(&cache[index].url_mutex);
357 int cache_turn_read(int index)
/* semaphore */
P(&cache[index].t_mutex);
cache[index].t_readcnt++;
if(cache[index].t_readcnt==1)
P(&cache[index].t_w);
V(&cache[index].t_mutex);
/* begin read operation */
t=cache[index].
/* end read operation */
/* semphore */
P(&cache[index].t_mutex);
cache[index].t_readcnt--;
if(cache[index].t_readcnt==0)
V(&cache[index].t_w);
V(&cache[index].t_mutex);
阅读(...) 评论()420被浏览201,732分享邀请回答2121 条评论分享收藏感谢收起

我要回帖

更多关于 浓缩磷脂软胶囊 的文章

 

随机推荐